Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

[preview] jump to definition should respect the current context #6811

Merged
merged 1 commit into from
Aug 14, 2018

Conversation

jasonLaster
Copy link
Contributor

Fixes Issue: #6028

Summary of Changes

Improves selectSourceURL so that it knows to respect the current context (original/generated) when selecting a new location.

Test Plan

add Jest tests

GIF

@jasonLaster jasonLaster force-pushed the function-link2 branch 3 times, most recently from 9ea910a to fc38bf3 Compare August 13, 2018 16:40
@jasonLaster jasonLaster force-pushed the function-link2 branch 2 times, most recently from 47b9ede to 5465a9a Compare August 13, 2018 20:51
const bOriginal = isOriginalId(bId);

return (aOriginal && !bOriginal) || (!aOriginal && bOriginal);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is pretty embarrassing... I think I can re-write this as

isOriginalId(selectedSource.id) != isOriginalId(location.sourceId)

@@ -367,7 +367,7 @@ describe("QuickOpenModal", () => {
};
wrapper.find("SearchInput").simulate("keydown", event);
expect(props.setQuickOpenQuery).not.toHaveBeenCalled();
expect(props.selectLocation).not.toHaveBeenCalled();
expect(props.selectSpecificLocation).not.toHaveBeenCalled();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all this selectSpecificLocation is here so that in some places we can say, YES, we really do want to go somewhere

clearASTs();
clearSymbols();
await clearSymbols();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if i need this...

@jasonLaster jasonLaster force-pushed the function-link2 branch 4 times, most recently from 1426e97 to dfbcf02 Compare August 14, 2018 15:20
@darkwing darkwing merged commit c0c0ad4 into firefox-devtools:master Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants