-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[tsserver] Support for "Search Types" #8265
Comments
I used the language service modifying the get navigation items API endpoint to achieve a similar "Symbol Search" in alm tools : https://basarat.gitbooks.io/alm/content/features/omni-search.html#symbol-search |
I use the |
@drake7707 in my case I use too "navbar" tsserver command to fill outline. But it's only for a given file. My idea is to search types from the whole ts files of the project. I think searching types from the whole ts files of the project can be interested for other issues like #7849 |
use NavigateTo instead of navbar (command: "navto"). this gives you all the names given a prefix. see https://github.com/Microsoft/TypeScript/blob/master/src/server/protocol.d.ts#L1066. you can then filter on the kind, and keep the types, and remove the variables if you so choose. |
@mhegcazy many thanks for your suggestion. I will try "navto" command, but if I understand your suggestion it means that it searchs in the whole of ts files of the project? But I'm a little afraid with performance if I cannot filter on tsserver side type, because with large project, there are a lot of variables, etc although in my case I need just type. |
The server does filtering on the production side limiting to the |
@mhegazy why do you close this issue? I think a robust search types with complex criteria should be very usefull:
But perhaps you find those features are too specific so we could do that in the future with a plugin once #6508 will be implemented. |
we used to do this in the past. the size of the result was large that it caused perf issues both on th eserver and on the client serializing the result.
And #8268 is tracking it. it is marked as
This is a quick fix, not a search. we should be looking into these in TS 2.1 |
Many Thanks @mhegazy for having taken time to give me your great answer! Very exciting with TS 2.1 :) |
It should be very cool if tsserver could provide a new command "findAllTypes" which gives the capability to search types coming from ts files of the project.
To explain more my idea, I would like to implement inside typescript.java (Eclipse plugin for TypeScript) the same feature than we have with Java inside Eclipse.
See the following screenshot:
In this sample we have several classes MyServiceA, MyServiceB and an inner class MyInnerServiceA in a Java project. We can open a dialog "Open Type" to search any types in the Java Project with a filter. It's very helpful when you wish to go at a definition of class but you don't know which files defines the class (in Java world, Java class name follow the same name than the file, but in TypeScript world, you can defines any classes in any files).
The text was updated successfully, but these errors were encountered: