Skip to content

Support changes in vscode-nls-dev that allow hint comments in package.nls.json #126408

Closed

Description

In the following change: microsoft/vscode-nls-dev@e2447e4
Support for hint comments was added to package.nls.json, as described here: microsoft/vscode-nls-dev#33

This works properly to get the hint comment into the exported XLF for localization purposes. However, VS Code appears to be failing to read from package.nls.json when this format is used, resulting in an exception thrown when the settings UI is opened. It looks like this change requires a change to VS Code to support the new schema.

Activity

  1. dbaeumer commented on Jun 16, 2021

    @dbaeumer
    Member

    With the new format a value in a package.nls.json file can look like this:

    {
    	"description": { 
                   "message": "Provides snippets, syntax highlighting, bracket matching and folding in Windows batch files.",
                   "comment": [ "line1", "line2" ]
            }
    }
    
  2. added a commit that references this issue on Jun 16, 2021
    9c3a109
  3. added
    unreleasedPatch has not yet been released in VS Code Insiders
    insiders-releasedPatch has been released in VS Code Insiders
    and removed
    unreleasedPatch has not yet been released in VS Code Insiders
    on Jun 21, 2021
  4. Colengms commented on Jul 30, 2021

    @Colengms
    ContributorAuthor

    Dirk Bäumer (@dbaeumer) This appears to not be fully addressed. With 1.58.2, doing this with the description of a setting, I get no tooltip when hovering over the setting name in settings.json.

    I get the following error when I open the settings UI, and no settings at all are displayed.

    log.ts:296   ERR (x.description || x.markdownDescription || "").split is not a function: TypeError: (x.description || x.markdownDescription || "").split is not a function
        at d.parseSettings (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1863:18950)
        at d.parseConfig (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1863:18453)
        at vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1863:17052
        at Array.reduce (<anonymous>)
        at d.getRegisteredGroups (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1863:17029)
        at d.parse (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1863:16758)
        at d.initialize (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1863:16675)
        at d.getSettingsGroups (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1863:16596)
        at s.get settingsGroups [as settingsGroups] (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1863:13279)
        at Zt.onConfigUpdate (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2301:53484)
        at Zt.setInput (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2301:39364)
        at async u.doSetInput (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2355:131518)
        at async u.openEditor (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2355:129942)
        at async vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2567:15994
        at async Object.accept (vscode-file://vscode-app/c:/Users/colen/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:641:3988)
    

    My entry in package.nls.json was defined like so:

        "c_cpp.configuration.formatting.description": { 
                "message": "Configures the formatting engine",
                "comment": [ "test comment" ]
        },
    

    And referenced like so in package.json:

              "description": "%c_cpp.configuration.formatting.description%",
    
  5. sean-mcmanus commented on Jul 31, 2021

    @sean-mcmanus
    Contributor

    When I reproed the bug, I got none of our extension's settings displayed, but the built-in ones appeared.

    Also, if this is fixed, please make sure markdownDescription is also supported.

  6. added a commit that references this issue on Aug 3, 2021
    568c51a
  7. dbaeumer commented on Aug 3, 2021

    @dbaeumer
    Member

    Missed one place where we read package.nls.json files. Fixed it.

  8. locked and limited conversation to collaborators on Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

insiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions