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

More thoroughly test navigateTo #25239

Merged
4 commits merged into from
Jul 3, 2018
Merged

More thoroughly test navigateTo #25239

4 commits merged into from
Jul 3, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jun 26, 2018

Instead of just testing the number of items, assert.deepEqual the exact contents of the response.
Also fixes a bug where kindModifiers could be undefined when passed through client.ts (should be "").
Discovered #25233 and #25237.

@@ -1592,16 +1592,15 @@ namespace ts.server {
const bakedItem: protocol.NavtoItem = {
name: navItem.name,
kind: navItem.kind,
isCaseSensitive: navItem.isCaseSensitive,
matchKind: navItem.matchKind,
file: navItem.fileName,
start: scriptInfo.positionToLineOffset(navItem.textSpan.start),
end: scriptInfo.positionToLineOffset(textSpanEnd(navItem.textSpan))
};
if (navItem.kindModifiers && (navItem.kindModifiers !== "")) {
bakedItem.kindModifiers = navItem.kindModifiers;
}
Copy link
Author

Choose a reason for hiding this comment

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

"none" wasn't a possible value (detected by changing the type to a string literal union), so in practice matchKind would always be set.

@@ -1592,16 +1592,15 @@ namespace ts.server {
const bakedItem: protocol.NavtoItem = {
name: navItem.name,
kind: navItem.kind,
isCaseSensitive: navItem.isCaseSensitive,
Copy link
Author

Choose a reason for hiding this comment

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

isCaseSensitive was declared optional but we never set it anywhere.

@ghost ghost changed the title More thouroughly test navigateTo More thoroughly test navigateTo Jun 26, 2018
@ghost ghost requested a review from mhegazy July 2, 2018 18:29
@ghost ghost merged commit efc1b7d into master Jul 3, 2018
@ghost ghost deleted the navigateTo branch July 3, 2018 02:25
This pull request was closed.
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.

1 participant