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

Fix loading a plugin that contributes a language with configuration options provided in a JSON file with comments #3253

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

azatsarynnyy
Copy link
Member

@azatsarynnyy azatsarynnyy commented Oct 23, 2018

This PR replaces using JSON parser by JSONC parser for reading the configuration options of the contributed language.

In my case I want to load VSCode Kubernetes plugin which contributes helm language with configuration options provided in a file in JSONC format.
Theia cannot load the plugin due to the following parsing error:

root INFO PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/vscode-kubernetes-tools-0.1.14.vsix
root INFO accepting packagejson with engines { vscode: '^1.23.0' }
root ERROR Uncaught Exception:  SyntaxError: Unexpected token / in JSON at position 28
root ERROR SyntaxError: Unexpected token / in JSON at position 28
    at JSON.parse (<anonymous>)
    at VsCodePluginScanner.TheiaPluginScanner.readLanguage (/home/artem/projects/github/theia-ide/theia/packages/plugin-ext/lib/hosted/node/scanners/scanner-theia.js:181:45)
    at /home/artem/projects/github/theia-ide/theia/packages/plugin-ext/lib/hosted/node/scanners/scanner-theia.js:165:68
    at Array.map (<anonymous>)
    at VsCodePluginScanner.TheiaPluginScanner.readLanguages (/home/artem/projects/github/theia-ide/theia/packages/plugin-ext/lib/hosted/node/scanners/scanner-theia.js:165:29)
    at VsCodePluginScanner.TheiaPluginScanner.readContributions (/home/artem/projects/github/theia-ide/theia/packages/plugin-ext/lib/hosted/node/scanners/scanner-theia.js:84:34)
    at VsCodePluginScanner.getModel (/home/artem/projects/github/theia-ide/theia/packages/plugin-ext-vscode/lib/node/scanner-vscode.js:66:35)
    at MetadataScanner.getPluginMetadata (/home/artem/projects/github/theia-ide/theia/packages/plugin-ext/lib/hosted/node/metadata-scanner.js:45:28)
    at HostedPluginReader.getPluginMetadata (/home/artem/projects/github/theia-ide/theia/packages/plugin-ext/lib/hosted/node/plugin-reader.js:61:43)
    at /home/artem/projects/github/theia-ide/theia/packages/plugin-ext/lib/hosted/node/plugin-service.js:117:47
root INFO [hosted-plugin: 25971] PLUGIN_HOST(25971) starting instance

It's needed for eclipse-che/che#10574

…on options provided in a JSON file with comments

Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>
@benoitf benoitf added the plug-in system issues related to the plug-in system label Oct 23, 2018
@azatsarynnyy azatsarynnyy merged commit 5fde4ae into master Oct 24, 2018
@azatsarynnyy azatsarynnyy deleted the az/parser branch October 24, 2018 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants