session.ts: Revert some emptyArray back to undefined#17781
Conversation
amcasey
left a comment
There was a problem hiding this comment.
You're planning to port this to release-2.5 rather than reverting?
src/server/session.ts
Outdated
| const { project, file } = this.getFileAndProject(args); | ||
| if (isSemantic && isDeclarationFileInJSOnlyNonConfiguredProject(project, file)) { | ||
| return emptyArray; | ||
| return undefined; |
There was a problem hiding this comment.
undefined [](start = 23, length = 9)
This appears to have been [] before your original change.
| const definitions = project.getLanguageService().getDefinitionAtPosition(file, position); | ||
| if (!definitions) { | ||
| return emptyArray; | ||
| return undefined; |
There was a problem hiding this comment.
undefined [](start = 23, length = 9)
This was probably fine as emptyArray, but I have no problem with reverting it.
|
|
||
| if (!occurrences) { | ||
| return emptyArray; | ||
| return undefined; |
There was a problem hiding this comment.
undefined [](start = 23, length = 9)
Was probably fine.
There was a problem hiding this comment.
So -- leave it, or change it like this PR does?
There was a problem hiding this comment.
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?).
Reverts the changes in #17165 that changed return values from
undefinedtoemptyArray.Does not revert any type-only changes or changes from
[]toemptyArray.Ref: #17165 (comment)