This package has been deprecated

Author message:

This package has been renamed to vscode-extend-language. Install using vscode-extend-language instead.

vscode-extend-languageconf
TypeScript icon, indicating that this package has built-in type declarations

0.2.4 • Public • Published

Extend VS Code language configuration files

Currently, it is not possible to build a new language as an extension of an existing one, the language-configuration.json file must be self-contained. This can lead to tedious maintenance as changes to the base language have to be forwarded manually. This package aims at helping language developers.

Assume you wand to derive a new language configuration from A-language-configuration.json, you just need to define a file let us say B.extension.language-configuration.json containing

{
    "extends": "path/to/A-language-configuration.json",
    "overrides": {
        "comments": {
            "blockComment": [
                "<!--",
                "-->"
            ]
        },
        "surroundingPairs": [
            ["{", "}"],
            ["[", "]"],
            ["(", ")"],
            ["\"", "\""],
            ["'", "'"],
            ["$", "$"],
            ["`", "`"],
            ["_", "_"],
            ["*", "*"]
        ],
    },
    "folding": {
        "offSide": true,
        "markers": {
            "start": "^\\s*<!--\\s*#?region\\b.*-->",
            "end": "^\\s*<!--\\s*#?endregion\\b.*-->"
        }
    }
}
  • extends means that language B is based on the language configuration of language A. path/to/A-language-configuration.json can either be a relative local path to A-language-configuration.json or an url.
  • overrides enables the developer to replace some settings of A-language-configuration.json by their new value.
  • Everything outside overrides is added to the configuration. If the key already exists in A-language-configuration.json, their contents are concatenated.

To obtain the self-contained language configuration file for B, B.extension.language-configuration.json, use

import {expandConfiguration} from 'vscode-extend-languageconf'

expandConfiguration('./B.extension.language-configuration.json', './B.language-configuration.json')

Package Sidebar

Install

npm i vscode-extend-languageconf

Weekly Downloads

3

Version

0.2.4

License

MIT

Unpacked Size

11.7 kB

Total Files

6

Last publish

Collaborators

  • jlelong