You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you open the folderDefinition file for a template, and it has json comments, it will show as an error in the editor.
We have allowsComments: true in the schema for folderDefinition, but regular json language support doesn't get hooked up to that schema so it reports the comments as errors. This will happen for the other files (e.g. ui, rules, variables, dashboard, etc.) as they get added.
Possible options:
dynamically set the languageId for those documents to jsonc (maybe via vscode.languages.setTextDocumentLanguage() in templateEditing when the file is open or the path-value changes).
see if there's a way to configure the default json language client to ignore the template json files, at least for diagnostics
if vscode could provide a public json-schema-association api, we could use that instead of the custom json-language-client thing we're doingin now
The text was updated successfully, but these errors were encountered:
Another side effect of the double-json-language-client setup is that we get double code-completions on enum'ed string field that have already entered text (e.g. rules.action in rules files, enter "set", do another rule, and see 2 "set"s in the code completions).
There is not a clean way to programmatically configure the default json language client to hide/disable checks (nor will there probably ever be); and, per the comments on microsoft/vscode#73424, there won't be an api to programmatically set the json schema for a .json file.
So, we're going to have to do our own language id and client + server for this, and use setTextDocumentLanguage() to dynamically switch the type for template related files. We will have to be sure that we can share the same json language configuration (e.g. spaces/tabs, auto format, prettier integration, etc.) so folks don't have to configure it twice.
If you open the folderDefinition file for a template, and it has json comments, it will show as an error in the editor.
We have allowsComments: true in the schema for folderDefinition, but regular json language support doesn't get hooked up to that schema so it reports the comments as errors. This will happen for the other files (e.g. ui, rules, variables, dashboard, etc.) as they get added.
Possible options:
jsonc
(maybe viavscode.languages.setTextDocumentLanguage()
in templateEditing when the file is open or the path-value changes).The text was updated successfully, but these errors were encountered: