Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions src/server/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ namespace ts.server {
// correct results to all other projects.

const defaultProjectResults = perProjectResults.get(defaultProject)!;
if (defaultProjectResults[0].references[0].isDefinition === undefined) {
if (defaultProjectResults?.[0].references[0]?.isDefinition === undefined) {
Comment thread
amcasey marked this conversation as resolved.
// Clear all isDefinition properties
perProjectResults.forEach(projectResults => {
for (const referencedSymbol of projectResults) {
Expand Down Expand Up @@ -580,7 +580,6 @@ namespace ts.server {

return resultsMap;

// May enqueue to otherPositionQueue
function searchPosition(project: Project, location: DocumentPosition): readonly TResult[] | undefined {
const projectResults = getResultsForPosition(project, location);
if (!projectResults) return undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[]

[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"definition": {
"containerKind": "",
"containerName": "",
"fileName": "/a/a.ts",
"kind": "var",
"name": "hello",
"textSpan": {
"start": 56,
"length": 5
},
"displayParts": [
{
"text": "\"hello\"",
"kind": "stringLiteral"
}
]
},
"references": []
}
]

[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference path="../fourslash.ts"/>

// @Filename: /a/tsconfig.json
////{ "files": ["a.ts"] }

// @Filename: /a/a.ts
/////// <reference path="../b/b.ts" />
/////*1*/;

// @Filename: /b/tsconfig.json
////{ "files": ["b.ts"] }

// @Filename: /b/b.ts
/////*2*/;

verify.baselineFindAllReferences('1', '2')
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// <reference path="../fourslash.ts"/>

// @Filename: /a/tsconfig.json
////{ "files": ["a.ts"] }

// @Filename: /a/a.ts
/////// <reference path="../b/b.ts" />
////const str: string = "hello/*1*/";

// @Filename: /b/tsconfig.json
////{ "files": ["b.ts"] }

// @Filename: /b/b.ts
////const str2: string = "hello/*2*/";

verify.baselineFindAllReferences('1', '2')