mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
* Port #48978 forward to the revised FAR code The old regression test didn't catch the corresponding bug in the new code because it hit the fast path where there's only a single project. * Drop spurious non-null assertion
This commit is contained in:
parent
46e53016e4
commit
757a3acbde
@ -379,8 +379,8 @@ namespace ts.server {
|
||||
// have started the other project searches from related symbols. Propagate the
|
||||
// correct results to all other projects.
|
||||
|
||||
const defaultProjectResults = perProjectResults.get(defaultProject)!;
|
||||
if (defaultProjectResults[0].references[0].isDefinition === undefined) {
|
||||
const defaultProjectResults = perProjectResults.get(defaultProject);
|
||||
if (defaultProjectResults?.[0].references[0]?.isDefinition === undefined) {
|
||||
// Clear all isDefinition properties
|
||||
perProjectResults.forEach(projectResults => {
|
||||
for (const referencedSymbol of projectResults) {
|
||||
@ -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;
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
[]
|
||||
|
||||
[]
|
||||
@ -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": []
|
||||
}
|
||||
]
|
||||
|
||||
[]
|
||||
@ -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')
|
||||
@ -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')
|
||||
Loading…
x
Reference in New Issue
Block a user