Skip to content

Dont include auto type reference directives on syntax only server#39472

Merged
sheetalkamat merged 1 commit intomasterfrom
syntaxOnlyAutoTypeRefs
Jul 7, 2020
Merged

Dont include auto type reference directives on syntax only server#39472
sheetalkamat merged 1 commit intomasterfrom
syntaxOnlyAutoTypeRefs

Conversation

@sheetalkamat
Copy link
Copy Markdown
Member

Detected while working on the goto def on syntax only server that we were including node_modules/@types auto type directives on syntax only server. This disables it.
I am not sure if this is desired behavior or not though

@DanielRosenwasser
Copy link
Copy Markdown
Member

Pretty sure I noticed this in the logs but wasn't sure if that's what the syntax server was always doing 😅. Good catch!

I think this is fine for our first iteration, but I could imagine expanding this to dependencies long-term like what @andrewbranch did for #37812. I think doing that, in conjunction with noResolve, would probably give people decent behavior.

@amcasey
Copy link
Copy Markdown
Member

amcasey commented Jul 7, 2020

As a general principle, I'm happy to strip out as much functionality as possible, because it's easy to add it back later. Having said that, I'm not sure I understand the consequences of this particular change. If we're going to make things like go-to-def and nav-to work across files (including closed files?), it seems like we'd want to include these files?

@DanielRosenwasser
Copy link
Copy Markdown
Member

DanielRosenwasser commented Jul 7, 2020

I think the idea was that we can make go-to-definition work based on explicit import syntax rather than auto-including the world. Just as a reminder, the only thing we get from including all the @types packages is auto-import working better and making global declarations available (e.g. describe, require, and it) from @types/node, @types/mocha, etc.

@amcasey
Copy link
Copy Markdown
Member

amcasey commented Jul 7, 2020

@DanielRosenwasser I get that mixed up every time and it's only been a few weeks since @andrewbranch broke it down for me. 😅

@DanielRosenwasser
Copy link
Copy Markdown
Member

Well if any of this functionality was intuitive you wouldn't have heard so much about it 😄

@sheetalkamat sheetalkamat merged commit c08c059 into master Jul 7, 2020
@sheetalkamat sheetalkamat deleted the syntaxOnlyAutoTypeRefs branch July 7, 2020 20:59
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants