Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/server/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ namespace ts.server {

const definitions = project.getLanguageService().getDefinitionAtPosition(file, position);
if (!definitions) {
return emptyArray;
return undefined;
Copy link
Member

Choose a reason for hiding this comment

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

undefined [](start = 23, length = 9)

This was probably fine as emptyArray, but I have no problem with reverting it.

}

if (simplifiedResult) {
Expand Down Expand Up @@ -669,7 +669,7 @@ namespace ts.server {
const occurrences = project.getLanguageService().getOccurrencesAtPosition(file, position);

if (!occurrences) {
return emptyArray;
return undefined;
Copy link
Member

Choose a reason for hiding this comment

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

undefined [](start = 23, length = 9)

Was probably fine.

Copy link
Author

Choose a reason for hiding this comment

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

So -- leave it, or change it like this PR does?

Copy link
Member

Choose a reason for hiding this comment

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

In master, whichever is more consistent with the other requests. My impression is that it's undefined. In release-2.5, whichever it used to return (also undefined?).

}

return occurrences.map(occurrence => {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 => {
Expand Down