-
Notifications
You must be signed in to change notification settings - Fork 110
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
tide spawns extraneous tsserver instances when navigating to files in node_modules #268
Comments
Can you share some errors that are different between |
With the example repo I gave in the initial report, I get this with
But when I navigate to I can tweak my I'm more concerned by the number of
True. |
So how about ... making that not true then? Let's say I know there are systems where the current behaviour is desired (i.e. like LERNA), but I don't use LERNA and I don't think everyone else is doing that either, so optimizing for that use-case only seems like an odd decision. We could at least make in an option to search further up the path when the current project-path is resolved to something which is a subfolder of And maybe only do that when the resolved folder doesn't contain a These are just a few ways we can go at this which all:
If none of these are optimal, I'm sure there are other reasonably simple ways too. What do you guys think? |
There might not be a parent-child relation in the folder structure always, for example we ship the typings for standard library inside #256 might fix this issue if properly solved. Then we will have this problem only if we have to start multiple version of tsserver. |
typedoc (which I contribute to) is planning to use Lerna. I also have projects that I'm thinking of moving to Lerna.
That would not solve the issue I reported. I think you misunderstood the details of the problem. The issue is not that tide finds a I've not yet run into a library that bundles a And there are other scenarios that don't involve
Files in And for even more fun, you could imagine another subdirectory named @ananthakumaran The file to #256 would solve the problem partially. There would be only one I still haven't formed an opinion as to that the solution should be. |
Fair enough. My point was simply that optimizing for Lerna-projects only seemed like the wrong thing to do.
That may very well be. You're usually much well versed in things once you comment than I am, so I'll take your word for it. I was just suggesting there might be other, simpler solutions, but if they are indeed too simplistic I see no reason to further pursuit those ideas. |
Old issue is old. Closing! :) |
Checklist
M-x tide-restart-server
in the buffer where I had the problem.The rest of the checklist does not apply to the situation being reported.
Relevant Version Numbers
Steps to Reproduce the Bug
It is assumed your Emacs automatically starts
tide
.Clone https://github.com/lddubeau/tide-spurious-tsservers.git
Open
src/main.ts
.Move the pointer to
Observable
on the first line.Hit
M-.
.Expected Behavior
One
tsserver
is started forsrc/main.ts
, which usessrc/tsconfig.json
. When navigating to the file that definesObservable
, a newtsserver
should not be started.tide
should instead use thetsserver
started forsrc/main.ts
.Actual Behavior
Two
tsserver
instances are launched.Observations
Besides possibly causing differences in error reporting between running
tsc
and what a user sees in Emacs, this also causestide
to spawn a bunch of unnecessary instances oftsserver
.The 2nd file that is opened when navigating to the definition of
Observable
is already part of the project that coverssrc/main.ts
(otherwise tide would not be able to find the definition ofObservable
). Tide would have to pass that information along so that the buffer opened for the 2nd file does not try to figure out which project pertains to it.The text was updated successfully, but these errors were encountered: