Skip to content

Missing references in some cases #33017

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

Closed
OliverJAsh opened this issue Aug 21, 2019 · 10 comments · Fixed by #34813
Closed

Missing references in some cases #33017

OliverJAsh opened this issue Aug 21, 2019 · 10 comments · Fixed by #34813
Assignees
Labels
Bug A bug in TypeScript Domain: Symbol Navigation Relates to go-to-definition, find-all-references, highlighting/occurrences. Fix Available A PR has been opened for this issue

Comments

@OliverJAsh
Copy link
Contributor

TypeScript Version: 3.5.2

Search Terms:

Code

We have some code that looks like this:

./main.ts:

import { types } from './types';

type Test = types.Foo;

./types/index.ts:

import * as types from './types';
export { types };

./types/types.ts:

export type Foo = 1;

When I try to find references for Foo, I'm getting no results. "Go to definition" does still work.

However, I can only reproduce this behaviour in our large TS project. I've tried and failed to create a reduced test case. If I start removing files from our large TS project, it will eventually begin to work, suggesting there's some sort of (memory?) threshold which we could be crossing.

Here is a video recording to demonstrate this: https://www.dropbox.com/s/xw7c3lk0mxhr5vj/Screen%20Recording%202019-08-21%20at%2021.40.59.mov?dl=0

I have also attached a TS server log, which was recorded at the same time as the above video.

Any ideas what could be going on here? What's the best way for me to debug this?

tsserver.log

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Aug 21, 2019
@sheetalkamat
Copy link
Member

Can you please share the screen recording and tsserverlog again. (The screen share link is not working so I cant figure out what you expect and what is happening.)

@sheetalkamat sheetalkamat added Needs More Info The issue still hasn't been fully clarified and removed Needs Investigation This issue needs a team member to investigate its status. labels Sep 11, 2019
@OliverJAsh
Copy link
Contributor Author

Sorry about that @sheetalkamat. I won't delete the video this time around. 🤦‍♂

tsserver.log

Video

@sheetalkamat sheetalkamat added Needs Investigation This issue needs a team member to investigate its status. and removed Needs More Info The issue still hasn't been fully clarified labels Sep 13, 2019
@OliverJAsh
Copy link
Contributor Author

Just found another bug which might be related: #33489

@sheetalkamat
Copy link
Member

@OliverJAsh From the log it looks like when finding references its hitting the assertion. We would need code sample to investigate so please provide small repro if you can or you can share your source code. We can get NDA for getting the repro project if you need to. Thanks.

@OliverJAsh
Copy link
Contributor Author

OliverJAsh commented Sep 30, 2019 via email

@sheetalkamat
Copy link
Member

email is shkamat at microsoft dot com

@OliverJAsh
Copy link
Contributor Author

Hi @sheetalkamat, I have sent an NDA to you and @DanielRosenwasser.

@OliverJAsh
Copy link
Contributor Author

@sheetalkamat I have sent you an invite to access the repo.

To test this issue, the file I used in my video is located at app/routes/Explore/LandingPage/components/PopularCategories/PopularCategories-helpers.ts.

@OliverJAsh
Copy link
Contributor Author

@sheetalkamat Sorry I forgot to mention, this is on the maintenance/named-namespace-imports-landing-pages branch.

@sheetalkamat
Copy link
Member

@OliverJAsh Thank you for providing details. I was able to repro this and will look into this soon.

@sheetalkamat sheetalkamat added the Fix Available A PR has been opened for this issue label Oct 29, 2019
@sheetalkamat sheetalkamat added this to the TypeScript 3.8.0 milestone Oct 31, 2019
@DanielRosenwasser DanielRosenwasser added the Domain: Symbol Navigation Relates to go-to-definition, find-all-references, highlighting/occurrences. label Nov 8, 2019
sheetalkamat added a commit that referenced this issue Dec 11, 2019
…and import type node (#34813)

* Test

* Handle import type node when handling the namespace import and reexport
Fixes #33017

* Handle qualifier of the importTypeNode

* Handle export specifier

* Fix rename prefix when search for rename starts at qualifier in import type ndoe

* Fix rename of qualifier with importType node when invoked without provideSuffixAndPrefix option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Symbol Navigation Relates to go-to-definition, find-all-references, highlighting/occurrences. Fix Available A PR has been opened for this issue
Projects
None yet
4 participants