-
Notifications
You must be signed in to change notification settings - Fork 14
Incoming dependent projects are not tracked by tsserver #140
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
Comments
@lorenzodallavecchia VSCode configure tsserver with some options that I have not understood https://github.com/Microsoft/vscode/blob/master/extensions/typescript/src/typescriptServiceClient.ts#L584 I think it should be interesting to explore it. But for the moment very busy with #133 |
@angelozerr don't worry about this issue for now: I'm even realizing that it is not written correctly. |
Closing, as the problem described here is a combination of separate problems. Since the command is looking for references in the Eclipse Project it is correct that it does not work cross-project (that would be Workspace reference search). However, at least one file must be opened for each tsconfig.json scope in the same Eclipse project. See #142. Workspace reference search requires a separate effort, probably similar to #144, for "merging" results from the tsserver's of all projects. I'll leave this unreported for now. |
It looks like the in-memory view of a project by
tsserver
does not include other projects that depend on the project handled by the server.For example, suppose to have
For files inside B, tsserver will correctly consider both A and B to be part of the compiler scope.
For files inside A, however, the compiler only sees A in the compiler scope.
That is correct for features like validationg a single file or showing content assist proposals.
However, features like Compile on Save or Search References may work incorrectly because of this.
Steps to Reproduce
sum
method private. An error correctly appears on shared-project/src/main.ts, but none appears on specific-project/src/main.ts. That is the bug.Workarounds (sort of)
A workaround is to modify shared-project/tsconfig.json as follows.
The include of
../specific-project/**/*
makes specific project part of the shared project compilation input. While this works technically, in practice it is not feasible because a shared library project cannot possibly list all client projects that may use it.Another option is to include
../**/*
, but this raises concearns about performance of including all files of a potentially big workspace.Considerations
The workarounds are based on including dependent client code as it was input code. While at first look this appears to work, it might cause problems, first of all by reducing performance (also, memory-wise).
It is possible that all these are tsserver limitations and so not easily solvable in typescript.java.
Please note that this issue does not reduce the value of
tsserver
integration. When using only a single tsconfig.json, the improvement in performance and dependency computation is simply not a match for the oldertsc
-based build.The text was updated successfully, but these errors were encountered: