I'm writing extension that provides CompletionItems to VSCode CSS Intellisense. The issue is that some completions are already being provided to Intellisense by internal VSCode completion providers resulting in showing same complitions twice.
What I need is to remove those duplications. How can I achieve this without messing with css language-server?
VS Code shows suggestions from all extensions that provide suggestions. It is not possible for your extension to disable the suggestions from another extension: https://github.com/Microsoft/vscode/issues/63004
You could try:
Tell users to disable the built-in css extension.
Have your extension register a new language and a new completion provider for that language.
Related
If this is due to an extension, how can I remove that extension?
It overwrites my custom snippet, which bothers me.
I disabled many extensions, but nothing changed.
What you're seeing in your screenshot (suggestions for dba_<etc.>) are not coming from any extension. One can verify that by running the command Developer: Reload With Extensions Disabled and trying triggering suggestions again. So this is just functionality that comes out-of-box with a standard VS Code installation. You don't even need to install any PHP extension to get this.
As for your custom snippets getting "overwritten", it's hard to tell without more detail why this is happening. If you're on version 1.75, it might just be due to a bug that will be fixed later (Ex. As was the case in this other recent Q&A: Visual Studio Code's recent update is disrupting autocompletion).
As #Mark showed in their answer, these are function suggestions. You can disable function suggestions with the following setting:
"[php]": {
"editor.suggest.showFunctions": false
}
Those icons indicate that those are Methods and Functions (not Snippets). See What do the Intellisense icons mean.
So you can try to disable two settings in your Settings UI:
Editor > Suggest: Show Methods
Editor > Suggest: Show Functions - this looks like the right one to disable
Of course, there might be situations where you want to see Function suggestions, so you will have to see if disabling the setting is acceptable.
You can disable those Function suggestions for php files only with this setting (in your settings.json):
"[php]": {
"editor.suggest.showFunctions": false
}
I recently started writing SCSS in VSCode. VSCode itself along with vscode-scss extension provides relatively good support for SCSS, but an important feature seems missing - error checking.
Though VSCode and vscode-scss can offer suggestions through Intellisense based on scanning, no errors will be prompted if I misspelled a variable, or used a mixin that hadn't been imported yet. Also, no auto refactoring takes place after renaming an SCSS file that has been used by other sources.
Is there any VSCode extension that provides such validations? Or maybe they can be turned on through some options in extension settings?
Note: I do have noticed the scss.showErrors option of vscode-scss, but no errors get prompted in scenarios mentioned above after turning this option on.
I've installed many code snippet extensions in my Visual Stuidio Code, but when I considered to use them, I got several snippets choices with a same input. I cannot tell which one should I use.
Now I have to disable some extensions. How can I find out what extensions that each snippet is provided by? or what snippets an extension is providing?
Select a code snippet, and the extension name is showed in the hint window near the auto completing window.
In Vim, I love using:
Ctrl+X, Ctrl+F to trigger code completion using local file names.
Ctrl+X, Ctrl+L to trigger completion of full lines from open files.
I'd like to have the same features in VSCode. A Google and SO search did not show me any extensions that provide this feature.
Is there an VSCode extension that does this?
What is the best way of adding this feature? Should I write my own extension or is there an existing commonly used "intellisense" extension where I easily contribute these features?
The extension Path Autocomplete does file name completion.
If you search for autocompletion in the marketplace there are other extensions as well which might provide the line completion that you're looking for.
I use vscode.vim extension which is a vim emulator for VSCode. It has most of the features of vim, including the completion of full lines from open files with the same keyboard shortcut: Ctrl+X, Ctrl+L.
I've been using PhpStorm for awhile, for PHP as well as JS. I would love, however, to switch to VSCode since it's lighter, open source and free. But one feature that I cannot quite carry over with extensions is Code Style settings.
PhpStorm has a sweet visual interface in settings that allows you to set up detailed code style rules with live examples right there. ESLint, unfortunately, doesn't have anything similar - it's all text rules (which is a drag and takes forever to set up).
So I'm wondering if there's any way at all to export PhpStorm code style settings as ESLint rules? Or if there's an app that has a similar interface to set up ESLint? Or maybe there's a VScode extension that I am missing that has a similar interface?