Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Colengms opened this issue Jun 15, 2021 · 4 comments · Fixed by #126462
Closed

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

Colengms opened this issue Jun 15, 2021 · 4 comments · Fixed by #126462
Assignees
Labels
insiders-released Patch has been released in VS Code Insiders
Milestone

Comments

@Colengms
Copy link
Contributor

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.

@dbaeumer dbaeumer assigned dbaeumer and unassigned aeschli Jun 15, 2021
@dbaeumer dbaeumer added this to the June 2021 milestone Jun 15, 2021
@dbaeumer
Copy link
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" ]
        }
}

@Colengms
Copy link
Contributor Author

Colengms commented Jul 30, 2021

@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%",

@sean-mcmanus
Copy link
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.

dbaeumer added a commit that referenced this issue Aug 3, 2021
@dbaeumer
Copy link
Member

dbaeumer commented Aug 3, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
insiders-released Patch has been released in VS Code Insiders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@dbaeumer @aeschli @sean-mcmanus @Colengms and others