How to stop a single VS Code extension from auto update? - visual-studio-code

Some of my vs code extension update every day, and I have a limited amount of internet bandwidth, is it possible to stop a specific extension from the auto update?
Thanks in advance.

Yes, it is possible (and simple):
In the package.json of the extension,
you will find a metadata section that look like so:
"__metadata": {
"id": "0fcefdee-e09c-4b96-9998-f5dc891893dd",
"publisherId": "1e02cadf-73ee-47be-8772-75da47b7921f",
"publisherDisplayName": "Robert Plant"
}
Rename the id field, as "OLD id".
Below the OLD id line, add the following line
"id": "00000000-0000-0000-0000-000000000000",
You will end up with:
"__metadata": {
"OLD id": "0fcefdee-e09c-4b96-9998-f5dc891893dd",
"id": "00000000-0000-0000-0000-000000000000",
"publisherId": "1e02cadf-73ee-47be-8772-75da47b7921f",
"publisherDisplayName": "Robert Plant"
}
You might have to reload the window and/or to disable/reenable the extension.
NB: If you need to do it for more than one extension, you will need to give each one a different id, otherwise, it won't work:
00000000-0000-0000-0000-000000000000
00000000-0000-0000-0000-000000000001
00000000-0000-0000-0000-000000000002
Etc.
That's it!

So far, there are only settings for controlling all of your extensions. You can use the settings below:
{
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false
}
Of course, you can always submit a feature request for controlling specific extensions individually.

From GH Issue: Please make it possible to disable auto-update for a specific extension
Please try the feature Install Another Version... - right click on
extension to see this action. Installing another version will lock the
extension to that version.
So specifically choosing a certain version should stop future updates.
Also see https://stackoverflow.com/a/53755378/836330 about pinning/reverting to a specific extension version which should not allow auto-updating.

Add line bellow to settings.json
Use this format -
"settingsSync.ignoredExtensions": ["extension-name"]
You can find the name of your extensions in VS Code settings or on the marketplace.
Example for quokka - VS Code extension marketplace
Example for quokka - "settingsSync.ignoredExtensions": ["wallabyjs.quokka-vscode"]
These settings will exclude extensions from auto-update.

Related

Creating a new editor.tokenColorCustomizations color Scope

I was changing the colors of the VS Code UI using editor.tokenColorCustomizations, when I noticed that some elements share the same scopes (which results in the scopes sharing the same color no matter what).
What I would like to know, is if there is a way to create a new scope, and asign a specific keyword to it?
For example, I would like to add a customized local scope for "Lua".
Here's an example of "local" and "nil" sharing the same scopes:
local
nil
Thank you for your time
Grammar Contribution
What you want to do is Contribute a Grammar using, VSCode provided, contribution points. The grammar contribution point is: contributes.grammars
Contribution points are part of the VS-Code Extension Manifest.
The VS-Code Extension Manifest is a package.json located in the Root Directory of a VS-Code Extension, or Theme. You cannot contribute Grammars from a ./.vscode/settings.json file.
Defining a Grammar in the Extension Manifest
The type of contribution you will be making in this case looks like:
"grammars": []
Here's an Example of a Grammar Being Defined in a VS-Code Extension's Manifest
/*
Grammars are defined in the Extension Manifest (package.json),
inside of the contributions property.
*/
{
"name": "language-latex",
"description": "LaTex Language Support",
"version": "0.0.1",
"publisher": "someone",
"engines": {
"vscode": "0.10.x"
},
"categories": ["Programming Languages", "Snippets"],
"contributes": {
"languages": [
{
"id": "latex",
"aliases": ["LaTeX", "latex"],
"extensions": [".tex"]
}
],
"grammars": [
{
"language": "latex",
"scopeName": "text.tex.latex",
"path": "./syntaxes/latex.tmLanguage.json"
}
],
"snippets": [
{
"language": "latex",
"path": "./snippets/snippets.json"
}
]
}
}
Originally authored as part of a contribution example # VSCode's URL: https://code.visualstudio.com/api/references/extension-manifest#combining-extension-contributions
Notice how the Language is defined in the Manifest? This is because this example is defining the Language Latex. It sounds like you want to contribute a Grammar on top of a per-exsisting language, in that case you probably will not need to define a new language. I posted three links to Official VSCode documentation at the bottom of this answer. You will need to read the three links so you can decide exactly what your extension will need. How your Extension Manifest is filled out will be contingent on the grammar you want to define. This probably sounds complicated, but once you get the hang of it, you will find it is a breeze.
Note: Lots of the Advanced VSCode features, like themes, extensions, contributions, tasks, configuring a debugger (things you can't just set a boolean value for in the settings.json file), use the same type of methods for using the features. For example, to create a theme, you also contribute the theme, which means once you learn how to contribute a grammar, you will know how to create a theme as well. Visit the contribution Link below to learn more (there's approx 20 different contribution types to read about).
As far as the Grammars section goes, you will need to provide 3 specific values, by assigning them each to the right property:
grammars.language property
grammars.scopeName property
grammars.pathname property
The path will use a json file that looks like this:
"./syntaxes/<Your-language>.tmLanguage.json"
It is a TextMate file converted to a JSON format, and can be located in your VSCode's file, or in the VSCode repository (search through the VSCode repository. It should popup as you are typing it.)
Here is a Link to the VSCode Repository
For more information about Grammar Contributions visit this link: https://code.visualstudio.com/api/references/contribution-points#grammar-example
For more information about Contributions in general visit this link: https://code.visualstudio.com/api/references/contribution-points
For more information about the VSCode Extension Manifest visit this link: https://code.visualstudio.com/api/references/extension-manifest#combining-extension-contributions
Any questions regarding this answer, should be asked in the comments section that belongs to this answer.
(Will edit & delete this line, and the line above June 21st # 11:59pm UTC)

how to make a reference for settings inside extension contributes/configuration in vscode

similar to vscode settings reference
am trying to do the same using
"someExt.test": {
"type": "string",
"default": 'hello',
"markdownDescription": "test [Emmet](command:workbench.action.openSettings?#ext:vscode.emmet)"
}
but it doesn't work & i cant find any documentation for it, so any help is appreciated
This is the line in the file resources/app/out/nls.metadata.json for this option
"Controls the delay in ms after which a dirty file is saved automatically.
Only applies when `#files.autoSave#` is set to `{0}`."
I don't know if it is documented but
`#files.autoSave#`
looks like the syntax to get a reference to another setting.

Is there a way to check which UE version was used to create a project?

When opening a project, it complains about it being created using a different version of Unreal. I obviously get a bunch of compile errors if I go through with opening it anyway.
Is there a way to check what version was used to create it?
I was hopeful when I saw the EngineAssociation entry inside the uproject file but it ended up being meaningless to me
{
"FileVersion": 3,
"EngineAssociation": "{0004AAA1-08D6-A558-739F-534E0C642FD2}",
"Category": "",
"Description": "",
"TargetPlatforms": [
"PS4",
"WindowsNoEditor"
]
}
This means that the project was associated with a custom version of the engine, manually built using the source code of the engine downloaded from GitHub. You can not tell just from looking at the .uproject file which version of the engine this custom build is based on.
In vanilla builds of the engine, the EngineAssociation field holds a meaningful value, e.g. "4.24"

Add an extension to an existing extension.js in visual studio code

I want to add an extension(for e.g. Docker extension) to my existing extension and repackage it as one single extension.
Assuming you want to create a user experience, where the end user gets the benefit of multiple VS Code extensions that complement each other well, or one depends on another, you should check out the mechanism called extension pack:
Create an extension that will have no code, but will list other extensions via this package.json. Here is an example:
{
"extensionPack": [
"felixfbecker.php-debug",
"felixfbecker.php-intellisense",
"Kasik96.format-php"
]
}
https://code.visualstudio.com/api/references/extension-manifest#extension-packs
And here is some further reading...
https://code.visualstudio.com/blogs/2017/03/07/extension-pack-roundup

Set .history folder as ignored by intellisense

I need to ignore .history folder from intellisense.
Now it looks like this when I start typing Focus:
As you can see intellisense will offer me every Identical class found in .history folder and this is very very confusing (and find correct one).
I try find something in vscode settings, and on editor site but no success.
.history folder is ignored from git, display in explorer, and tslint:
"files.exclude": {
"**/.history": true ...
},
"files.watcherExclude": {
"**/.history/**": true ...
},
"tslint.exclude": ["**/.history/**"] ...
How to achieve ignore .history from intellisense?
Next part is based on the answer from Matt
An important assumption:
Visual Studio Code itself does not contain automatic import and you need an extension for it.
Solution:
I am using extension Auto Import (steoates.autoimport) which contains the setting autoimport.filesToScan. I changed default value from "**/*.{ts,tsx}" to "{src,e2e,node_modules}/**/*.{ts,tsx}" and now everything work as I expected.
Those suggestions are coming whatever extension you have installed that is providing auto-import functionality. Please check to see if that extension has its own exclude setting that you also need to configure
In your settings.json, you could add this:
"autoimport.filesToScan": "./index.{ts,tsx} ./App.{ts,tsx} ./src/**.*.{ts,tsx}"
Or, if you prefer:
"autoimport.filesToScan": "./{index,App,src/**}.{ts,tsx}"