Dev lang completion

Extension name

The Learn Authoring Pack, Visual Studio Code meta extension is comprised of multiple sub extensions. This feature is included in the Learn Markdown extension. The Learn Markdown extension is part of the Learn Authoring Pack, there is no need to install it separately.

Summary

Contributors need assistance determining the valid language identifiers (dev langs) that can follow triple-backticks (code fence openings) in a Markdown file. Unfortunately, build-time validation of dev langs doesn't exist. The result is disparate representations of a single language within the same conceptual docset.

Consider C# as an example. Contributors have used c#, C#, cs, csharp, and others as dev lang representations of the language. Which of the preceding representations is correct?

The Dev lang completion feature dispels the confusion by displaying a list of known dev langs. Upon selecting a dev lang name from IntelliSense:

  • The code fence is closed.
  • The caret is positioned in the code fence.

Preferences

It's not possible to disable this feature. The following settings are available:

Display commonly used dev langs

Only a subset of the valid dev langs will be used in a single docset. To enhance the user experience:

  1. In Visual Studio Code, open the docset to the root directory.

  2. Select File > Preferences > Settings and filter by Learn Markdown Extension.

  3. Click the Edit in settings.json link in the Markdown: Docset Languages section.

  4. Add the following markdown.docsetLanguages property to the settings.json file:

    {
        "markdown.docsetLanguages": [
    
        ]
    }
    
  5. Position your caret in the property's empty array, and activate IntelliSense (via Ctrl + Space). A list of known dev lang names appears.

  6. Add dev lang names to the array until you're satisfied with the list. For example, the following list will display four dev lang names to the user after typing triple-ticks:

    {
        "markdown.docsetLanguages": [
            ".NET Core CLI",
            "C#",
            "Markdown",
            "YAML"
        ]
    }
    
  7. Save your changes to the settings.json file.

Warning

An empty markdown.docsetLanguages array causes all known dev langs to display.

Display all known dev langs

By default, all known dev lang names are displayed in IntelliSense. This setting overrides the markdown.docsetLanguages property described in Display commonly used dev langs.

To change this setting:

  1. Select File > Preferences > Settings and filter by Learn Markdown Extension.
  2. Toggle the setting in the Markdown: All Available Languages section.

In action

Below is a brief demonstration of this feature:

Dev lang completion