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

Ctrl+T does not list exported variables #8013

Closed
Ciantic opened this issue Jun 22, 2016 · 11 comments
Closed

Ctrl+T does not list exported variables #8013

Ciantic opened this issue Jun 22, 2016 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@Ciantic
Copy link

Ciantic commented Jun 22, 2016

Ctrl+T the project wide symbols listing can't find exported globals e.g.

export let globalStyles = {};

It's visible in file wide symbols listing Ctrl+Shift+O, but not in the project wide symbol listing Ctrl+T.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Jun 22, 2016
@dbaeumer
Copy link
Member

@Ciantic do you have a tsconfig.json / jsconfig.json file ? If so how does it look like and is the file exporting the globalStyles part of the project

@Ciantic
Copy link
Author

Ciantic commented Jun 23, 2016

@dbaeumer here is gist you can clone: https://gist.github.com/Ciantic/50140f189abf3e83260e6aba7cedc5ce

Clone that, open the folder in VS Code insiders, open the "openthis.ts", hit Ctrl+T and start typing "globalStyles", nothing is found. But it finds "Something" just fine.

Edit I believe someone has designed Ctrl+T this way, but I can't understand why, having exported global values in symbols would be advantageous for navigation etc. If this is implemented: microsoft/TypeScript#188 the Ctrl+T could be used as primary GUI for importing a selected symbol, but it can't be used if it doesn't include all symbols.

@dbaeumer
Copy link
Member

This gets filtered in the UI. We should remove that filtering code.

@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Jun 24, 2016
@jrieken jrieken added this to the June 2016 milestone Jun 24, 2016
@bpasero
Copy link
Member

bpasero commented Jun 27, 2016

@dbaeumer @jrieken -1 on this change, for me Cmd+P and Cmd+T are now quite unusable because for example all imports are showing up as results:

image

At the very minimum, please restore how Cmd+P was working (use the filter only when the symbol handler is being used from the openAnythingHandler.ts.

@bpasero bpasero reopened this Jun 27, 2016
@jrieken jrieken assigned dbaeumer and unassigned jrieken Jun 27, 2016
@jrieken
Copy link
Member

jrieken commented Jun 27, 2016

Not filtering in the UI is still the right thing to do. Leaving it up to @dbaeumer to teach TypeScript to exclude some items

@dbaeumer
Copy link
Member

IMO the last 'component' that should do any filtering is the language server / service. The service is asked to provide all workspace symbols the service should exactly return that.

In the example @bpasero shows most of the errors are properties on interfaces. So I think we need different ways to show/ filter that view: by type (only classes, ....) and by scope (top level, nested).

This requires work in the UI and in the API. What do you think?

@jrieken
Copy link
Member

jrieken commented Jun 27, 2016

@dbaeumer I actually think that its imports like import * as errors from '...' and in that case I would argue the usefulness

👍 for addition grouping - as in quick outline. The information should be available since both provider return arrays of SymbolInformation

@Ciantic
Copy link
Author

Ciantic commented Jun 27, 2016

I also get stuff that I have imported e.g. I use globalStyles a lot, and it lists these as symbols:

import globalStyles from "../GlobalStyles";

I think import lines (which are not re-exports) should not be listed in the symbols listing.

P.S. this change apparently removed all filtering, including "import something" what I wanted is to include export let something = {}

P.S.S. I think "listing definitions" is more appropriate for Ctrl+T, I don't think people are using it to jump to import statements, but to definitions with typically export in front.

@dbaeumer
Copy link
Member

@bpasero and I discussed it an neither filtering in the UI nor filtering in the model is the right solution. So we decided to have Ctrl+T list all workspace symbol and Ctrl+P only the global once. We will therefore add the container name to the symbol and check if this allows for proper filtering. I opened #8502 to track the UI changes.

@dbaeumer
Copy link
Member

@bpasero The container name is already part of the SymbolInformation. Will close this one now and see how the UI behaves after addressing #8502

@bpasero
Copy link
Member

bpasero commented Jun 29, 2016

@dbaeumer sorry, but the imports are showing up without containerName so they still appear in CtrlCmd+P.

@bpasero bpasero reopened this Jun 29, 2016
@bpasero bpasero added the verified Verification succeeded label Jul 1, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants