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

VSCode sometimes thinks tsconfig.json is missing. #1885

Closed
joe-herman opened this issue Jan 8, 2016 · 4 comments
Closed

VSCode sometimes thinks tsconfig.json is missing. #1885

joe-herman opened this issue Jan 8, 2016 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster
Milestone

Comments

@joe-herman
Copy link

Possibly related to:

Summary
tsconfig.json sometimes does not show up in VSCode's file list, nor does Typescript intellisense acknowledge it, despite its existence on disk. This behavior persists between VSCode restarts.

Behavior details
Begin on branchA with no changes. branchB has similar files to branchA including tsconfig.json, which is identical between both branches.

git checkout branchB    // Checkout successful
git status              // shows no files changed.

VSCode gives me arcane errors about needing to specify the module flag for Typescript. tsconfig.json does not show up in the list of files in VSCode.

ls                      // shows tsconfig.json

Opening a file explorer also shows tsconfig.json.
I restart VSCode, tsconfig.json is still not listed in VSCode despite existing on the file system.
I create a new tsconfig.json in VSCode. It lets me do it with no errors. tsconfig.json now finally shows up in VSCode. It's a blank file. Then:

git status
    On branch branchB
    Your branch is up-to-date with 'origin/branchB'.
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)

            modified:   tsconfig.json
    no changes added to commit (use "git add" and/or "git commit -a")

Weird, because tsconfig.json was unchanged before. Let me reset to the head again.

git reset --hard HEAD
   HEAD is now at 765b7b9 Some commit message

VSCode now updates tsconfig.json from disk properly and it's in the file list again.

git status
    On branch branchB
    Your branch is up-to-date with 'origin/branchB'.
    nothing to commit, working directory clean

OK, this is where I wanted to be in the first place.

Just for good measure, I type some changes to let VSCode's Typescript intellisense do its thing. I delete the changes after a few seconds, and reassure myself with the following again:

git status
    On branch branchB
    Your branch is up-to-date with 'origin/branchB'.
    nothing to commit, working directory clean

tsconfig.json is still there. Good.

git checkout branchA
    Switched to branch 'branchA'
    Your branch is up-to-date with 'origin/branchA'.

tsconfig.json is there. Looks fine.

git checkout branchB
    Switched to branch 'branchB'
    Your branch is up-to-date with 'origin/branchB'.

tsconfig.json is again perfectly fine, as it should have always been. But I definitely witnessed the behavior detailed above.

Final thoughts
I can understand tsserver.js locking files causing problems, but not tsconfig.json completely disappearing from VSCode's file list even after restarts when it is clearly there on the disk itself. It's like VSCode is completely ignoring tsconfig.json sometimes.

@joaomoreno
Copy link
Member

@bpasero I had a hard time fully understanding the issue here. Gave it to you since it seems that the problem is that tsconfig.json is not shown in the explorer. Feel free to fwd.

@bpasero
Copy link
Member

bpasero commented Jan 11, 2016

@Penryn in those cases where tsconfig.json is not showing up, does a refresh of the explorer help?

@bpasero bpasero added the info-needed Issue requires more information from poster label Jan 11, 2016
@bpasero bpasero added this to the Jan 2016 milestone Jan 11, 2016
@joe-herman
Copy link
Author

@bpasero: I actually never tried refreshing VSCode's file list, but I did restart VSCode which still did not list tsconfig.json. To be clear, tsconfig.json was present on the file system this entire time.

If this happens again I'll try refreshing the file list instead.

@bpasero
Copy link
Member

bpasero commented Jan 12, 2016

@Penryn no a restart is fine too. This is weird, even if the file is locked by some other process, asking its parent folder for its children should return it. Any ideas what could go on? Something in the console (from Help menu) maybe?

@bpasero bpasero modified the milestones: Backlog, Jan 2016 Jan 14, 2016
@bpasero bpasero closed this as completed Jan 23, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants