Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Not recognizing TypeScript files in project #46

Open
dannyfritz opened this issue Oct 1, 2017 · 8 comments
Open

Not recognizing TypeScript files in project #46

dannyfritz opened this issue Oct 1, 2017 · 8 comments

Comments

@dannyfritz
Copy link

Some of my TS projects are working just fine. Getting outlines, linting, errors, etc.

But this project isn't getting any IDE support and I'm not sure why https://github.com/corvid-coder/nuthatch

Try opening this file in Atom after cloning and see what happens: https://github.com/corvid-coder/nuthatch/blob/master/packages/debug/src/index.ts

atom_2017-09-30_21-08-50

@damieng
Copy link
Contributor

damieng commented Oct 1, 2017

Please open the dev tools window in Atom and see if there are any errors reported.

If there are not please enter atom.config.set('core.debugLSP', true) and press enter then restart Atom to see diagnostics information for ide-typescript and let us know of any relevant messages.

@aSapien
Copy link

aSapien commented Oct 1, 2017

Same issue here, nothing in DevTools console.

@dannyfritz
Copy link
Author

dannyfritz commented Oct 1, 2017

It was a problem in my tsconfig.json

When I turned on the debug messages I got:
atom_2017-10-01_07-04-24

So I modified my tsconfig.json over and over trying to fix it. What finally fixed it for me was modifying the tsconfig.json and then reloading the atom window and then it worked!

(trailing comma after "inlineSourceMap: false, was the culprit.)

@as-cii
Copy link

as-cii commented Jan 24, 2018

We just hit this issue as well and this time it was due to a trailing comma before a closing curly brace. We also noticed that tsc --init generates a JSON configuration file that contains comments (which are invalid in actual JSON).

We should probably:

  • Parse this file as JavaScript so that the parser is more forgiving (which seems to match TypeScript and VSCode expectations)
  • Surface errors like this to the user via a notification instead of having to enable core.debugLSP. If we weren't on the core team and didn't know about core.debugLSP, we probably would have given up and just used VS Code.

I am going to re-open this because it's a show-stopping issue when users have a configuration file that contains technically invalid JSON that TypeScript nevertheless accepts.

/cc: @damieng @daviwil

@as-cii as-cii reopened this Jan 24, 2018
@damieng
Copy link
Contributor

damieng commented Jan 24, 2018

We can probably wire up notifications if we see them - I'm not sure if we have any way to tell the typescript language server to treat .json files any differently from the current behavior. (This might be a limitation of the sourcegraph wrapper in which case a fix would need to go upstream)

@B4xAbhishek
Copy link

Hi! is this issue fixed now?

@B4xAbhishek
Copy link

check the tree setter to fix the issue. settings-core-treesetter

@johncmerfeld
Copy link

johncmerfeld commented Jan 8, 2021

check the tree setter to fix the issue. settings-core-treesetter

Specifically, check the "Use Tree Sitter Parsers" box. This worked for me!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants