configurationvscode-extensionspackage.json

markdownDescription cut off in my VS Code extension configuration


My VS Code extension configuration takes an array of objects. I tried to use the markdownDescription to describe the settings since it must modified in settings.json manually. But when the settings are displayed in the UI, the description is cut off and ends with ellipses "[...]".

Here is the configuration contribution in package.json:

    "configuration": {
      "properties": {
        "comblocks.blockComment.styleOverrides": {
          "type": "array",
          "markdownDescription": "Style overrides providing delimiters to use for comment blocks. By default, the \n[current Language Mode](https://code.visualstudio.com/docs/languages/overview#_language-identifier) determines the left and right delimiters. \nThe default top/bottom border character is a dash (`-`).\n\nAny style specifications included here will override the defaults. Each item in\nthis list has the following properties. For properties not included in the\noverride, the default will still apply.\n\n- **languageId** `{string}`  \n  Identifies the language mode to override. The list of currently installed \n  languages and their identifiers can be found in the Change Language Mode \n  (`Ctrl+K M`) dropdown.  \n  This property is required.\n\n- **left** `{string}` *optional*  \n  Character(s) used to start each line of the comment block.\n\n- **right** `{string}` *optional*  \n  Character(s) used to end each line of a the comment block.\n\n- **border** `{string}` *optional*  \n  Character to be used in creating the top/bottom borders of the comment block.\n\n- **single** `{string|string[]}` *optional*  \n  Single-line comment identifiers. These are removed from selected text before\n  building the comment block. \n\n**Predefined Overrides**\n\nThese overrides are predefined but may also be overridden with this setting.\n```json\n[\n  { \"languageId\": \"bat\",          \"left\":\":*\", \"right\":\"*\", \"single\":\":\" },\n  { \"languageId\": \"coffeescript\", \"left\":\"#*\", \"right\":\"*\" },\n  { \"languageId\": \"python\",       \"left\":\"#*\", \"right\":\"*\" },\n  { \"languageId\": \"ruby\",         \"left\":\"#*\", \"right\":\"*\" },\n  { \"languageId\": \"xml\",          \"border\":\"=\" },\n  { \"languageId\": \"xsl\",          \"border\":\"=\" }\n]\n```",
          "items": {
            "type": "object",
            "required": [
              "languageId"
            ],
            "properties": {
              "languageId": {
                "type": "string"
              },
              "left": {
                "type": "string"
              },
              "right": {
                "type": "string"
              },
              "border": {
                "type": "string"
              },
              "single": {
                "type": "string|string[]"
              }
            },
            "additionalProperties": false
          }
        }
      }
    }

Here's what it looks like in File/Preferences/Settings: enter image description here

Is there any way to see the full markdownDescription?

Does anyone have a suggestion?


Solution

  • Study of the VS Code source revealed there is a hard-coded limit of 20 lines for configuration descriptions. However, this is done by a simple split of the description or markdownDescription property value at the line feed \n character. The code simply tests for more than 20 lines, truncates, and adds an ellipsis ([...]).

    I took the description text from my README.md file which had many line breaks in the Markdown source. Removing the breaks and replacing the bullet list with a table brought the text down to within the physical limit of 20 lines. The resulting description displayed in the UI was acceptable.

    Markdown description rendered in the UI