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

Introducing error in project requires IDE restart to pick up #11720

Closed
evmar opened this issue Oct 18, 2016 · 4 comments
Closed

Introducing error in project requires IDE restart to pick up #11720

evmar opened this issue Oct 18, 2016 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@evmar
Copy link
Contributor

evmar commented Oct 18, 2016

TypeScript Version: 2.0.3
VSCode: 1.6.1
Code

  1. Create a two-file project.

magic.d.ts:

declare var magic;

foo.ts:

magic = 3;

tsconfig.json (standard tsconfig, with a files block referencing the above two files):

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "noImplicitAny": false,
        "sourceMap": false
    },
    "files": [
        "foo.ts",
        "magic.d.ts"
    ]
}

Load this up into VSCode; everything's fine.

  1. Now create a new file:
    foo2.ts:
magic = 3;

Red squigglies as expected, because it doesn't know about the global declaration.

  1. Now edit foo.ts to add:
import './foo2';

Errors are fixed.

  1. Now comment out that import, reintroducing the error.

Expected: error in foo2.ts reappears.
Actual: project is error clean until you restart the IDE.

@vladima
Copy link
Contributor

vladima commented Oct 18, 2016

tried the nightly build and this is not the behavior I'm seeing: if I comment out import then indeed error did not appear, however I got error squiggles once I edit foo2.ts. Reason why this is happening - currently VSCode does not re-query diagnostics for file if file was not changed, We already have workitem to push notifications from the server in case if they should be updated on the editor side.

@evmar
Copy link
Contributor Author

evmar commented Oct 18, 2016

I can confirm that if I edit foo2.ts, the squigglies reappear. Feel free to close this as a dup of your work item if that's all you need.

@vladima vladima added the Duplicate An existing issue was already created label Oct 18, 2016
@vladima
Copy link
Contributor

vladima commented Oct 18, 2016

duplicate of #11229

@vladima vladima closed this as completed Oct 18, 2016
@mihailik
Copy link
Contributor

I believe this error is likely triggered by syntactic JSON error in tsconfig.json.

When you edit tsconfig.json with autosave enabled, intermediate edits result in syntactically incorrect JSON. And that crashes compiler. Not errors in TS files, but errors in TSCONFIG.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants