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

Language Service Doesn't Support non-spec tsconfig.json - Unexpected token } #21729

Closed
StephenFluin opened this issue Jan 23, 2018 · 2 comments · Fixed by angular/vscode-ng-language-service#346
Assignees
Labels
area: language-service Issues related to Angular's VS Code language service feature Issue that requests a new feature freq1: low
Milestone

Comments

@StephenFluin
Copy link
Contributor

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

#Steps to reproduce

  • Use VSCode (version shouldn't matter)
  • Open an angular application
  • Have a tsconfig.json file that conforms to TypeScript's spec, but is not valid JSON (with an extra , before a closing } for example)

Current behavior

Search path: /usr/local/google/home/stephenfluin/workspace/devfest/src/environments
Config file name: /usr/local/google/home/stephenfluin/workspace/devfest/src/tsconfig.json
SERVER ERROR: Unexpected token } in JSON at position 449
SyntaxError: Unexpected token } in JSON at position 449
    at JSON.parse (<anonymous>)
    at parseAndReEmitConfigJSONFile (/usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:257:33)
    at ProjectService.configFileToProjectOptions (/usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:1598:18)
    at ProjectService.openConfigFile (/usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:1620:42)
    at ProjectService.openOrUpdateConfiguredProjectForFile (/usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:1486:41)
    at ProjectService.openClientFile (/usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/editorServices.js:1404:23)
    at /usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/documents.js:135:47
    at TextDocuments.logErrors (/usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/documents.js:235:13)
    at /usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/documents.js:131:74
    at handleNotification (/usr/local/google/home/stephenfluin/.vscode/extensions/Angular.ng-template-0.1.7/server/node_modules/vscode-jsonrpc/lib/main.js:353:21)
[Error - 9:09:43 AM] Notification handler 'textDocument/didOpen' failed with message: Unexpected token } in JSON at position 449

Expected behavior

Because TypeScript allows this file, the language service should allow it as well

Environment


Angular CLI: 1.6.2
Node: 8.4.0
OS: linux x64
Angular: 5.1.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

@angular/cdk: 5.0.2
@angular/cli: 1.6.2
@angular/material: 5.0.2
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.2
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0

For Tooling issues:
VS Code: Version 1.19.2
Commit 490ef761b76b3f3b3832eff7a588aac891e5fe80

>
@mhevery mhevery added the area: language-service Issues related to Angular's VS Code language service label Jan 24, 2018
@ngbot ngbot bot added this to the needsTriage milestone Feb 26, 2018
@kyliau kyliau added feature Issue that requests a new feature freq1: low severity2: inconvenient labels Dec 6, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Dec 6, 2018
@rodmax
Copy link

rodmax commented Apr 4, 2019

Any updates? as i see in vscode-extension github repository
too many issues regarding broken extension

and i believe that folk put forward a bunch of false ideas (reinstall extension an so on)

whereas in many cases the problem lies in this issue

it seems if typescript supports json5-like format this package should too

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: language-service Issues related to Angular's VS Code language service feature Issue that requests a new feature freq1: low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants