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

LSP doesn't support references in tsconfig #1634

Open
nicholaides opened this issue Dec 4, 2024 · 2 comments
Open

LSP doesn't support references in tsconfig #1634

nicholaides opened this issue Dec 4, 2024 · 2 comments
Labels
lsp Language Server Protocol or other VSCode issues

Comments

@nicholaides
Copy link

Here are some quick steps to reproduce. If I had more time I'd provide a more stripped-down example.

  1. Make a new app from a vite template. The react-ts template sets up an app that uses tsconfig files with references.
yarn create vite my-app --template react-ts
cd my-app
yarn

CleanShot 2024-12-04 at 11 07 12@2x

CleanShot 2024-12-04 at 11 07 39@2x

  1. Open it in VSCode and open ./src/main.tsx. You'll see this error:

Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.typescript(2584)

This issue does not show up when the civet VSCode extension is disabled.

CleanShot 2024-12-04 at 11 00 09@2x

  1. Be confused because ./tsconfig.app.json does include the dom in the lib compiler option and no changes to ./tsconfig.app.json seem to have any effect.

  2. Fix the problem by moving ./tsconfig.app.json to ./src/tsconfig.json and updating reference to it in ./tsconfig.json

  3. Open ./src/main.tsx and observe the problem is fixed. (there are other problems, but those can be addressed by updating civet config and/or ./src/tsconfig.json.)

@edemaine edemaine added the lsp Language Server Protocol or other VSCode issues label Dec 4, 2024
@edemaine
Copy link
Collaborator

edemaine commented Dec 4, 2024

Thanks for the report! I'll need to study exactly how references is supposed to work. If you (or anyone else) has cycles to work on this, it'd be much appreciated.

@nicholaides
Copy link
Author

I wish I did have free cycles to dig in. I was mostly filing the issue to document it for the next person who runs into the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lsp Language Server Protocol or other VSCode issues
Projects
None yet
Development

No branches or pull requests

2 participants