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

Monaco editor shows red squigglies on trailing commas #4008

Closed
sqs opened this issue May 14, 2019 · 0 comments · Fixed by #4100
Closed

Monaco editor shows red squigglies on trailing commas #4008

sqs opened this issue May 14, 2019 · 0 comments · Fixed by #4100
Assignees
Labels
bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases
Milestone

Comments

@sqs
Copy link
Member

sqs commented May 14, 2019

This is a recent regression that I think I caused.

For example, at https://sourcegraph.com/site-admin/global-settings:

image

This is confusing, because we do support JSONC.

@sqs sqs added the bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. label May 14, 2019
@sqs sqs self-assigned this May 14, 2019
@sqs sqs added this to the 3.4 milestone May 17, 2019
@sqs sqs added the release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases label May 17, 2019
sqs added a commit that referenced this issue May 17, 2019
fix #4008

All JSON documents we use (for settings, site config, external services, and extension manifests) support trailing commas on the frontend and backend. However, an upgrade to monaco-editor unexpectedly caused the Monaco JSON editors in our UI to show red squiggly errors for trailing commas.

The (undocumented) way to do this is to add `allowComments` to the root of the JSON Schema. It is not sufficient to set `allowComments: true` in a `monaco.languages.json.jsonDefaults.setDiagnosticsOptions` call. I found this secret fix by finding microsoft/vscode#19992 (comment) and then inferring what changes that might entail, to discover `allowComments` in the JSON Schema is responsible for ignoring trailing comma errors.
@sqs sqs closed this as completed in #4100 May 17, 2019
sqs added a commit that referenced this issue May 17, 2019
fix #4008

All JSON documents we use (for settings, site config, external services, and extension manifests) support trailing commas on the frontend and backend. However, an upgrade to monaco-editor unexpectedly caused the Monaco JSON editors in our UI to show red squiggly errors for trailing commas.

The (undocumented) way to do this is to add `allowComments` to the root of the JSON Schema. It is not sufficient to set `allowComments: true` in a `monaco.languages.json.jsonDefaults.setDiagnosticsOptions` call. I found this secret fix by finding microsoft/vscode#19992 (comment) and then inferring what changes that might entail, to discover `allowComments` in the JSON Schema is responsible for ignoring trailing comma errors.
sqs added a commit that referenced this issue May 17, 2019
fix #4008

All JSON documents we use (for settings, site config, external services, and extension manifests) support trailing commas on the frontend and backend. However, an upgrade to monaco-editor unexpectedly caused the Monaco JSON editors in our UI to show red squiggly errors for trailing commas.

The (undocumented) way to do this is to add `allowComments` to the root of the JSON Schema. It is not sufficient to set `allowComments: true` in a `monaco.languages.json.jsonDefaults.setDiagnosticsOptions` call. I found this secret fix by finding microsoft/vscode#19992 (comment) and then inferring what changes that might entail, to discover `allowComments` in the JSON Schema is responsible for ignoring trailing comma errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error, flaw or fault that produces an incorrect or unexpected result, or behavior. release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant