Disable competing language servers / code highlighters - visual-studio-code

I want to add a language server to handle completion / highlighting / etc. for a file.
As a basis for testing stuff I am using an example from Microsoft (https://github.com/microsoft/vscode-extension-samples/tree/main/lsp-sample) and changed it to be active for any File. This language server highlights any word in all capital letters.
When opening a C++ File, I get the highlighting / completion of my language server and the default one for C++ (See image).
I would like to detect if some other extension / build in highlighter is active for a file and deactivate it for this workspace or the current file if it is impossible for the current workspace)
Is there a way to do this in a generic way where I do not have to know which extensions are highlighting code?
If no, is there a way to do this, if I know a set of extensions I want to deactivate?

I finally had enough time to try around a bit more and found that providing your own language for the same extension is enough.
In package.json I added an element in contributes.languages with extensions containing .cpp (since I am using cpp files for testing).
I also copied over some implementation code from an example.
This suppressed the default highlighter and code completion for cpp files. Since i am only implementing a semantic token provider, I can see the default highlighting before my provider takes over. (I think this could be solved by adding a syntax highlighter, but this is already sufficient fo my preliminary testing)
I am not sure, how stable all of this would be as a plugin (I only tested in Extension Development Host mode)
Here an image of the results:

Related

vscode: Speed up navigation througe huge projects - intellisense etc

Objective
I've a huge vscode Project:
2 Mio Files
100+ GB.
a lot of C-Files, but also build folders a lots of other irrelevant crap.
vscode is slow.
The project includes besides a lot of C/C++ files maybe in some parts cmake files, some codegen/glue-code, external headers, build scripts, external includes from SDK.
I want to use vscode to edit the code, not to compile or run it. The project consists besides the relevant c-files out of a lot of precompiled libs, helper tools, a huge amount of other files and images.
I want to speed my vscode setup up.
How to tell the user supporting tools of vscode, where to set their focus?
Are there any other options to speed up vscode?
Approach
My First Idea: "Make vscode ignore of everything I do not need and tell the tools precisely on what to focus and which leave aside."
Is there a way to make vscode ignore all of such folders in search and in the c++ indexer, the tool which supports code navigation and syntax highlighting?
Clarification / Additional info
I do not have configured vscode. I do not know how. Most the time intellisens/code heighlighting / autocompletion etc. works fine and I can jump around in that code. How ever I've encountered some huge projects, where intellisens failed half or in total or took a lot of time to do so. I do want to set up an project properly. I do not know where to find such settings and most important, which behavior it affects:
intellisense, please have a look only at folders ...
actially, ignore everything below those folders
take this single subfolder, but ignore everything around it.
btw, there is an totally different location for SDK headers, could you also use code and header from there?
I do use vscode to edit the code, I do not use it to compile or debug the code.
In short, I do not know which support tool (intellisense, c++ Extension, ???, ...) have which effect and where they can be configured. Like which vscode components make my life as easy as it is and how do I configure them?
EDIT: List of installed Plugins
as from #user requested :). If cmake is known for eating resources, I could discard it. Is it mandatory for the intellisens stuff?
Could discard python too, if necessary.
ms-vscode.cpptools
https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options
ms-vscode.cpptools-extension-pack
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack
ms-vscode.cpptools-themes
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-themes
alefragnani.bookmarks
https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks
twxs.cmake
https://marketplace.visualstudio.com/items?itemName=twxs.cmake
ms-vscode.cmake-tools
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
ms-python.python
https://marketplace.visualstudio.com/items?itemName=ms-python.python
ms-python.vscode-pylance
https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance

VSCode SCSS extension with better error checking

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.

Visual Studio Code Grammar files location

I'm using Visual Studio Code for development of PHP and would like to style the background color of the different embedded languages HTML/PHP/JavaScript differently, and to trigger the use of heredoc <<<sql .... sql to switch to SQL syntax. From what I can see from VSCode documentation, I need to edit the grammar files stored in storage.json, but for the life of me I cannot find where those files are. Can anyone point me in the right direction?
Sumirizing our comments, in order to modify the extension files, try to access the following folder:
./yourVSCodeFolder/extensions/resources/app/extensions
As you said, for those in windows, that folder is in:
%LocalAppData%\Programs\Microsoft VS Code\resources\app\extensions\php
There you will find a lot of folders that contains JSON files with the instructions of the custom formats and snippets that your editor uses.
For example: in mine, the /syntax/php.tmLanguage.json has all the instructions for how my php should look, and php/language-configuration.json has some parsing rules.
Find the files that allready has the rules that you are looking for, but it could be tricky because maybe you will need a prettyfier and to link or create new rules.
Also, if you didn't, check the Language Extensions Guide that VSCode provides.
Hope it was useful.
PD: As you also said:
VSCode already recognizes embedded SQL as long as the heredoc is in upper case <<<SQL .... SQL

VS Code - Text formatting in a new language extension

I'm building an extension providing a syntax highlighting for the 'Jack' language used in an online course I am taking (Nand2Tetris at Coursera - it is not a part of the course assignment). I have the syntax highlighting rules ready, but I would like to add custom formatting for some language elements. In particular, I would like type definitions to appear in italic.
I know how to change the user settings to get the desired result on my VS Code installation, but I would like that formatting to be the default behavior for anyone using the extension.
I've tried to create a new theme extension and then copy paste the 'themes' folder from it to the 'syntax' extension and reference the file from that folder in package.json, but it didn't work. I also tried adding the 'configuration' setting in the 'contributes' section of package.json, without success. I browsed numerous VC Code extensions on GitHub and couldn't find one providing similar functionality.
Is it even possible to provide syntax definition and 'theming' in one extension? If so how?
Based on VS Code Semantic Highlight Guide, besides syntax highlighting rules, you'll also need
Implement and register a Semantic token provider in your extension.
Declare Enablement of semantic highlighting in settings.json.
Customize tokens in Theming.
VS Code team kindly provides a Semantic tokens sample. Note that this example skips step 3 and customizes tokens directly in settings.json.

VSCode all autocomplete

Can VSCode's Intellisense/autocomplete be configured to work across all open files similar to Sublime's All Autocomplete plugin? Is there an extension that supports this?
Specifically, I am looking to get basic function and variable name autocompletion to work across C, C++, Matlab, and Python source files.
No, this is not possible. All actions in VS code are strictly limited to the document, which is passed in to the various APIs an extension has to implement.
I can imagine a hack, however, where you store code completion info persistently (in vscode settings, external file etc.), once you have collected them for a document and use that persistance layer to load all the info from there. This is however not very dynamic and requires that a file has been scanned for code completion info at least once (i.e. it was open in vscode and active at least once).