Manage multiple YAML extensions - visual-studio-code

I have the Home Assistant extension installed in VSCode but also want to use the ESPHome extension, both of these are for YAML files.
I need a way of telling VSCode which extension to use.
I wonder if it is possible to configure VSCode to use a specific extension in a specified folder tree or else to put something in the YAML file itself so the extension can recognise that it should be effective for that YAML file.

If I understand your question correct, you want to select installed extensions for in your case; YAML files.
VSCode :
Home Assistant extension
ESPHome extension
Via 'exentension' > 'dis/enabled [workspace]', you can arrange it.
Workspace recommended extensions#
A good set of extensions can make working with a particular workspace or programming language more productive and you'd often like to share this list with your team or colleagues. You can create a recommended list of extensions for a workspace with the Extensions: Configure Recommended Extensions (Workspace) command.
Extra information SEE https://github.com/Microsoft/vscode/issues/19792
This option was moved into Command pallette (F1)

Related

custom vscode extension not working over ssh

I created a vscode extension for the first time..I used LSP(language server protocol) and having both client and server bundled as one extension.
The extension has highlighting and autocomplete features for a custom file type. I packaged it using vsce I got a VSIX file. I installed the extension in my vscode using the .vsix file.
The extension works when i am working on local files.
However, i connected to a remote VM using the ms-vscode-remote.remote-ssh extension such that I can view the remote files in vscode, but here my created extension is not working. I can't even see the file type i created.
Any help is appreciated. Is there some specific setting I need to put in my package.json
For your extension to properly work remotely, either installed on host or on the remote, you have to follow a few guidelines, and yes, there are some settings that you may take care of on package.json.
The first and more complete source of information is Supporting Remote Development and GitHub Codespaces API documentation. It describes the architecture, settings, how to debug, common problems and so on. There is also the Extension Host page, where it describes the Preferred extension location topic, which tells you how to configure your extension to work on the correct location.
Based on your description (a LSP related extension) I understand your extension should be a Workspace Extension. This means that you should have this on your package.json:
"extensionKind": [
"workspace"
]
The Commons Problem section describes how you can evaluate and fix Incorrect execution location. To debug using SSH follow these instructions.
Also, remember that while working with remotes, you rely on local paths anymore. Instead you must always deal with Uri, whenever possible.
I guess after reviewing your settings, based on the docs related above, you should be able to detect what is happening on your extension and fix it. Give debug a try, it will be much easier to detect issues than installing the vsix and look for erros in Console.
Hope this helps

vscode extension development: svelte content not loading in webview after building the vscode extension

I am building a vscode extension by using svelte for webview. I am following https://youtu.be/a5DX5pQ9p5M. But the deployment of extension is not mentioned in the tutorial .
So i am following https://code.visualstudio.com/api/working-with-extensions/publishing-extension.
So after packaging the extension with vsce package and installing the extension the extension doesn't load svelte content but when running in developer mode everything works fine.
I tried creating the package extension multiple Times but still didn't work.
Check if all necessarily files are included via:
vsce ls
(You can also open packaged extensions, they are just ZIP-archives with a different extension.)
If they are not (e.g. src is excluded by default), you probably can create a .vscodeignore file and manually specify what to exclude.
Running extension problems can be inspected via Help > Toggle Developer Tools, usually you will find some errors in the console.
I do not know if debugging forces the extension to load, but if so, make sure you have set the correct activationEvents.

Disable VSCode Extensions in user settings

I'm building a VSCode appliance in docker with multiple pre-installed extensions.
By default the extensions get enabled when a session is created including a settings file in $HOME/.local/share/code-server/User/state/.json.
When I disable an extension in the UI the extension gets an entry in this config file meaning that it is disabled.
Is there a way to disable an extension before a session is created?
I was looking at the $HOME/.local/share/code-server/User/settings.json file but in the documentation I can't see an attribute for that.
thanks in advance
There was an option to turn off extension for the specific project.
Unfortunately, this option is not longer available:
Feature Link(used to work): Ability to enable extensions only on specific workspaces #15611

VS Code Quick File Navigation not working for custom file system provider

I've written a custom FileSystemProvider for VS Code.
When I open the files/folder with my custom FileSystemProvider's schema it works as expected and the files are shown in the workspace explorer.
But even though the files/folders are listed in workspace the following options of vs code are not working anymore for the custom file provider
Quick File Navigation (Ctrl + P) is unable to find the files in my workspace provided by custom FileSystemProvider
Find/Replace - Find replace is also unable to find the contents from the files in the workspace provided by custom FileSystemProvider
Find Symbols/ Declaration/ Definition are also not working
Is there a way to register my custom FileSystemProvider's schema also to these tools?
Remark : My custom FileSystemProvider directly uses the files in the local disc and it uses vscode.workspace.fs to read directories and files from the disc. It just hides few files and directories provided from the disc.
This is already known and there is an proposed VS Code API FileSearchProvider available to fix this.
The API is planed to be stabilized in Stabilize FileSearchProvider API #73524

Can an extension pack set the configuration options of one of the included extensions?

I have created an extension pack for VSCode. I would like my extension pack to set some configuration options of the included extensions. Can it be done writing some magic in the package.json file of my extension pack?
https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesconfiguration explains how an extension can create its own configuration using package.json
https://github.com/Microsoft/vscode/issues/1396 seems to be a related vscode issue but I could not say if it allows the changing of the options using package.json.
I have read the package.json files of some vscode extension packs and I have not found any example of what I want to do.
i figured out an answer to this:
redefine the configuration setting but with the changed setting.
take a look at this code for example.