Skip to content

VS Code

Brenton M. Wiernik edited this page Sep 19, 2023 · 1 revision

VS Code is a powerful text editor and IDE for CSL style development. Many useful features can be enabled by installing the XML language support plugin from RedHat.

In particular, opening your VS Code user settings file (settings.json) and adding the following code will show macro and locale names in the outline view for the CSL file. See here for details.

{
    "xml.symbols.filters": [
        {
          // match any file ending with .csl extension
          "pattern": "**/*.csl",
          "expressions": [
            {
              // keep the value of the attribute "name" on the same line
              // as the "macro" element, and don't show the attribute name
              "xpath": "//macro/@name",
              "inlineAttribute" : true,
              "showAttributeName": false
            },
            {
              // keep the value of the attribute "name" on the same line
              // as the "macro" element, and don't show the attribute name
              "xpath": "//locale/@xml:lang",
              "inlineAttribute" : true,
              "showAttributeName": false
            },
          ]
        }
      ]
}
Clone this wiki locally