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

feat(typescript_indexer): implement ref inlining for imported symbols #5527

Merged
merged 9 commits into from Mar 7, 2023

Conversation

nbeloglazov
Copy link
Collaborator

@nbeloglazov nbeloglazov commented Feb 24, 2023

The goal of this PR is to connect usages of imported symbol to the its declaration from original file. Today indexer produces the following graph:

// foo.ts
//- @ANSWER defines/binding AnswerOrig
export const ANSWER = 42;


// bar.ts
//- @ANSWER ref/imports AnswerOrig
//- @ANSWER defines/binding AnswerLocal
import {ANSWER} from './foo';

//- @ANSWER ref AnswerLocal
console.log(ANSWER);

After this PR the graph will look like this:

// foo.ts
//- @ANSWER defines/binding AnswerOrig
export const ANSWER = 42;


// bar.ts
//- @ANSWER ref/imports AnswerOrig
import {ANSWER} from './foo';

//- @ANSWER ref AnswerOrig
console.log(ANSWER);

Note that AnswerLocal is gone.

The change is guarded by enableImportsEdgeReassignment flag. This will allow us to easier roll it out at Google.

This is related to #4021.

@shahms shahms requested review from jaysachs and zrlk February 27, 2023 19:28
@nbeloglazov
Copy link
Collaborator Author

@jaysachs bump

@jaysachs
Copy link
Contributor

jaysachs commented Mar 7, 2023

Looks like some trailing whitespace in comments in indexer.ts

@jaysachs jaysachs merged commit ff8bbd1 into kythe:master Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants