-
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
Navigate-to does not pick up any identifiers in class expression #4481
Comments
Should this work for function expressions too? @mhegazy @CyrusNajmabadi |
We chose to not include functions in the past, just to avoid polluting the list. I think class expressions are different enough; I woul not mind trying the experience with function expressions as well. |
@mhegazy While this was fixed for classes, I have an existing code base with a lot of modules written in the style of:
What is counter-intuitive (by VSCode's own standard) is that it'll show these functions through "Goto Symbol in File" while "Goto Symbol in Workspace" will not show it. This discrepancy is very confusing and does not make sense. Anecdotally, Sublime does this and I have no issue using it - I never scroll through the list, just like I don't scroll through the list when using the command palette. I understand the argument that it may pollute, although I cannot confirm that I agree as I haven't seen it enabled, but the UX experience is really bad. It comes off as a bug. Is there any way we could improve the experience or have it as a configuration setting? |
@scarlac That looks like an entirely different issue. I would recommend creating a new bug to track this. |
@CyrusNajmabadi, I followed issues for that to this ticket. The others were closed with a reference to this one. Should I still create a new one? |
@mhegazy That sounds odd as it works when using "Go to Symbol in File". Was a specific workaround implemented to make it work there and not in the workspace? |
Is "go to symbol in file" using a different engine (perhaps just a textual one), rather than using the TS language server? |
@scarlac It looks like "Go to Symbol in Workspace" requires you to start typing the name. The navigation features don't use the type system, they use custom code in |
@andy-ms I appreciate that explanation. As a user I just need it to work. The only reasonable reason I've heard is that it's too many results for it to be practical, but Sublime does it and it works very well so I can't entirely agree with that argument. I wouldn't mind posting a separate issue but it seems I'm not the first to point this out - the request just keeps being tacked on to other issues without being directly addressed. Right now, Sublime gives me better practical code navigation even though VSCode has much deeper code understanding. Thus, VSCode should theoretically be better at navigation and I think it's just a matter of pushing the technical boundaries a bit :) |
You might want to make an issue on VSCode then? The TypeScript language service is the same for Sublime and VSCode. |
Try searching for any of the identifiers in the above with navigate-to.
Expected: All of them are found.
Actual: Only
ffffffffffff
is found.Probable cause:
computeNamedDeclarations
doesn't account forClassExpression
kinds.The text was updated successfully, but these errors were encountered: