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

Vetur, VSCode and TypeScript issue #68343

Closed
iam3yal opened this issue Feb 10, 2019 · 4 comments
Closed

Vetur, VSCode and TypeScript issue #68343

iam3yal opened this issue Feb 10, 2019 · 4 comments
Assignees
Labels
*caused-by-extension Issue identified to be caused by an extension

Comments

@iam3yal
Copy link

iam3yal commented Feb 10, 2019

About 8 months ago I made an issue on the Vetur repo and on StackOverflow that causes an error and degrades the experience in VSCode when working with Vue and still no fix and the workarounds don't work for everyone.

As far as it seems the issue is when you open the project from a directory that has no tsconfig.json then TypeScript will complain about it and will result the following message:

Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

VSCode then will add red squiggles and mark the directories in red which makes the experience really unpleasant, one way to "solve" it is open the project from the location of the tsconfig.json but then you need to have two instances of VSCode one to work on .vue files and another to work on other parts of the project and as I mentioned before there are other workarounds provided on the Vetur repo but they don't work for everyone due to different setups and whatnot.

This might not be a VSCode problem per se but because we don't really know where it should be solved and what's the best approach to take here I decided to post this here, hoping that the VSCode team would know or at least shed some light on it.

p.s. It doesn't seems to happen in Visual Studio 2017 but then I don't need to install anything there for it to work as VS2017 support Vue out of the box.

@vscodebot vscodebot bot added the typescript Typescript support issues label Feb 10, 2019
@octref
Copy link
Contributor

octref commented Feb 13, 2019

Yeah, I need to revive vuejs/vetur#385 (comment).

@mjbvz Do you do any special handling for tsconfig.json on TS extension side, when it's not on the top level or if there are multiple tsconfigs? Or are they all handled by TSServer automatically?

@octref octref added this to the On Deck milestone Feb 13, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 13, 2019

The TSServe finds tsconfigs in sub directories and correctly handles when there are multiple tsconfigs in a project. However we do not pick up tsconfigs that are not named tsconfig.json (so tsconfig.dev.json or my-tsconfig.json would not be picked up)

@octref
Copy link
Contributor

octref commented Feb 13, 2019

I took a look of TS extension, seems you are calling compilerOptionsForInferredProjects on TS Server for each project's inferred options. However, I didn't find such API on TS's LanguageServiceHost, guess it's just a matter of finding the right API...

@mjbvz mjbvz removed their assignment Feb 20, 2019
@octref
Copy link
Contributor

octref commented May 9, 2019

I enabled experimentalDecorator in the case no jsconfig/tsconfig can be found vuejs/vetur#1289. Reading tsconfig from non-top level is not easily doable.

@octref octref closed this as completed May 9, 2019
@octref octref added *caused-by-extension Issue identified to be caused by an extension and removed typescript Typescript support issues labels May 9, 2019
@octref octref removed this from the On Deck milestone May 9, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension
Projects
None yet
Development

No branches or pull requests

3 participants