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

TypeScript file needs to be open for symbol search to work #17393

Closed
massimocode opened this issue Dec 16, 2016 · 5 comments
Closed

TypeScript file needs to be open for symbol search to work #17393

massimocode opened this issue Dec 16, 2016 · 5 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues

Comments

@massimocode
Copy link

  • VSCode Version: Code - Insiders 1.9.0-insider (89bdb7c, 2016-12-15T07:11:14.563Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:
Extension Author Version
path-intellisense christian-kohler 1.2.0
vscode-eslint dbaeumer 1.2.2
githistory donjayamanne 0.1.4
EditorConfig EditorConfig 0.3.4
tslint eg2 0.7.1
csharp ms-vscode 1.5.3
PowerShell ms-vscode 0.7.2
typescript-javascript-grammar ms-vscode 0.0.12
vscode-subword-navigation ow 1.1.5
Ruby rebornix 0.10.4
vscode-icons robertohuertasm 4.1.0
annotator ryu1kn 0.10.1
cucumber stevejpurves 0.9.6

Steps to Reproduce:

  1. Open a typescript project
  2. Make sure all files are closed
  3. Search for a symbol - nothing will come up
  4. Open a typescript file
  5. Search for a symbol - the results will show, even if that symbol is not related to the currently opened file
@mjbvz mjbvz self-assigned this Dec 16, 2016
mjbvz added a commit to mjbvz/vscode that referenced this issue Dec 16, 2016
Fixes microsoft#17393

Makes the TS extension activate when the top level folder opened contains a jsconfig or tsconfig file
@mjbvz
Copy link
Collaborator

mjbvz commented Dec 16, 2016

@dbaeumer I sent out a PR #17412 to make the TS extension activate when the workspace contains a jsconfig or tsconfig file, but this alone will not fix this issue. We'll still need to update the workspaceSymbolProvider to be smarter about finding a ts file for the navto request. Right now, it only looks in workspace.textDocuments

@mjbvz mjbvz added javascript JavaScript support issues typescript Typescript support issues labels Dec 16, 2016
@dbaeumer
Copy link
Member

dbaeumer commented Dec 18, 2016

@mjbvz without good support for this from TSServer this will never be a nice experience so I stayed away from doing workarounds here. For example the contains tsconfig.json (or jsconfig.json) only works if these files are in the root. It doesn't if in a sub folder. So adding this might cause more confusion than it helps.

In addition it is very hard to pick the right TS file for the NavTo request (consider that case where you have 2 tsconfig.json files in one workspace folder). IMO we need to ask the TS team to provide us with a request without a file and they do the smartness of opening and scanning the projects.

As said I would push the TS team for better support here.

Regarding activation: @bpasero and I discussed that a while ago and we came to the conclusion that we need a 'project' info to do that proper. So for example if a workspace is marks (somehow) as a TS workspace then we could activate the TSServer more eagerly to fulfill a workspace symbol request. However we didn't come up with a design how and where such a TS project indication should be store

@waderyan
Copy link

FYI I have this prioritized on my end.

@massimocode
Copy link
Author

Thank you everyone for your responses.

Just to give some feedback as a user, I would feel comfortable being asked to provide something in the workspace config to tell VSCode how to treat the project. I feel like that's a little similar with how I have to specify a tasks.json file to tell VSCode how to build the TypeScript.

But as always, if it could automagically do it that would be awesome. Although it would be interesting to see how it would handle more complex use cases such as opening a folder that contains several different typescript projects (i.e. maybe something like a Node JS backend and an Angular 2 front end that use different compiler options and different Node packages).

@mjbvz mjbvz added feature-request Request for new features or functionality *duplicate Issue identified as a duplicate of another issue(s) labels Apr 21, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 25, 2017

I believe this is a duplicate of #17022

@mjbvz mjbvz closed this as completed Apr 25, 2017
@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
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

4 participants