Can an extension pack set the configuration options of one of the included extensions? - visual-studio-code

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.

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.

Atom stylelint - how to set rules globally?

I need to set stylelint globally because it seems like unnecessary work to configure every single project alone, and I am just unable to find such guide anywhere.
How to do this please?
it seems like unnecessary work to configure every single project alone
stylelint allows you to extend an existing configuration.
You can create your configuration file once and then extend that within each of your projects, like so:
// .stylelintrc
{
"extends": "../my-stylelint-config.js"
}
Many users publish their configurations to npm, so that they can install them into new projects using npm install their-config-as-package --save-dev.
Alternatively, AtomLinter has a configuration option to use the stylelint standard configuration.

Manage multiple YAML extensions

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)

VS Code style-lint ignore directories

Is it possible to ignore my CSS path, beacuse I only use stylelint for SCSS validation?
e.g. - I have the following structure:
assets/
css/
scss/
How can I disable the css/ folder from being indexed, trough the settings.json file of VSCode?
I found this in the docs, but I don't know how to implement it in VSCode.
If you're using the VS Code stylelint extension, you can specify ignore paths via the stylelint.configOverrides setting.
Add the following to your VS Code settings.json file:
"stylelint.configOverrides": {
"ignoreFiles": "assets/css/**"
}
Alternatively you can add a .stylelintignore file to the root folder of your project and add the ignore paths there:
assets/css/**
I'm using stylelint#9.2.0 with vscode-stylelint#0.20.4, and for me the .stylelintignore file is not being respected. If i use the CLI it is respected but the vscode plugin does not seem to do this correctly.
Similar to Jack Russell, I found that the VS Code stylelint plugin currently seems to ignore the .stylelintignore file.
To get around this limitation, I removed the .stylelintignore entirely and moved its settings into .stylelintrc instead. I.e. from something like this in .stylelintignore:
ignorethisfolder/**/*
path/to/ignorethisfile.css
To something like this in .stylelintrc:
"ignoreFiles": [
"ignorethisfolder/**/*",
"path/to/ignorethisfile.css",
]