-
Notifications
You must be signed in to change notification settings - Fork 12.8k
session.ts: Revert some emptyArray
back to undefined
#17781
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -601,7 +601,7 @@ namespace ts.server { | |
|
||
const definitions = project.getLanguageService().getDefinitionAtPosition(file, position); | ||
if (!definitions) { | ||
return emptyArray; | ||
return undefined; | ||
} | ||
|
||
if (simplifiedResult) { | ||
|
@@ -669,7 +669,7 @@ namespace ts.server { | |
const occurrences = project.getLanguageService().getOccurrencesAtPosition(file, position); | ||
|
||
if (!occurrences) { | ||
return emptyArray; | ||
return undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Was probably fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So -- leave it, or change it like this PR does? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In |
||
} | ||
|
||
return occurrences.map(occurrence => { | ||
|
@@ -913,7 +913,7 @@ namespace ts.server { | |
if (simplifiedResult) { | ||
const nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position); | ||
if (!nameInfo) { | ||
return emptyArray; | ||
return undefined; | ||
} | ||
|
||
const displayString = displayPartsToString(nameInfo.displayParts); | ||
|
@@ -1176,7 +1176,7 @@ namespace ts.server { | |
|
||
const completions = project.getLanguageService().getCompletionsAtPosition(file, position); | ||
if (!completions) { | ||
return emptyArray; | ||
return undefined; | ||
} | ||
if (simplifiedResult) { | ||
return mapDefined(completions.entries, entry => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was probably fine as
emptyArray
, but I have no problem with reverting it.