Search code examples
visual-studio-codedocumentationvscode-extensionsyo

What are types of extensions in VSCode?


Hi i am creating my first extension for VSCode following the official tutorial After running the command yo code to create a boilerplate the program asks which type of extension to create. I couldn't find any docs for these types of extensions that would help me determine how they differ from each other except for Language Extensions.

It would be helpful if there were some documentation explaining these.

Running yo code in vscode


Solution

  • From top to bottom:

    1. An extension that adds any of the possible contribution points (theme, keybindings, language support, icons, snippets etc.). Initial language is Typescript, but you can use other languages at any time, as long as they can be transpiled to Javascript.

    2. Like 1), but with JS as initial language. Still, you can use other languages too.

    3. A color theme for syntax highlighting, which is a collection of colors for predefined token types (these types are determined by a language extension, either provided by another extension or yours).

    4. Language support, which means handling of a programming or markup language. That includes parsing of such code and providing the tokens for syntax highlighting, code completion, code lenses, parameter info, formatting, linting etc. This could include a language server (which is just a separate process for all that mentioned here), but that has an own entry in this list.

    5. Code snippets, to provide small code parts for use during programming.

    6. Keymap, to provide specific keybindings (e.g. vim is a very popular keybinding).

    7. Extension pack, not 100% sure about that, but I believe this packs multiple extensions into one (e.g. if you have separate keybindings and color theme extensions, you can pack them into a combine extension).

    8. The previously mentioned language server. Language processing can be time consuming and you don't want to block the main (UI) thread. So, any such processing can be moved out to a language server, which can even be written in faster languages like C++ for highest performance.

    Given this list it should be clear that you either want 1), 2) or 4).