Skip to content

Suggestions regression since 3.6.0-dev.20190713 #32441

Closed
@IllusionMH

Description

@IllusionMH

TypeScript Version: 3.6.0-dev.20190717 (first version with problem 3.6.0-dev.20190713)

Search Terms: completion, completionInfo, autoimport

It is hard to provide repro code since this problem is found in large (4388 files processed by TS) code base with closed source.

However I see two regressions:

  1. Performance hit even for suggestions for variables/imports in current file
  2. Suggestions of other files exports are missing (even if there is already one named import from file where expected completion item located)

Performance problem

import { getSelectorData } from 'tools/store-reference';
...
function retrieveValue() {
    const valueType = getSe/* cursor here */
}

In TS Server log is see huge difference in performance and value for Semantic work

Log for 3.6.0-dev.20190713 (and later)

Info 4207 [15:36:38.239] request:
    {"seq":26,"type":"request","command":"completionInfo","arguments":{"file":"<filename>","line":30,"offset":28,"includeExternalModuleExports":true,"includeInsertTextCompletions":true}}
Info 4208 [15:36:38.240] getCompletionData: Get current token: 0
Info 4209 [15:36:38.240] getCompletionData: Is inside comment: 0
Info 4210 [15:36:38.240] getCompletionData: Get previous token 1: 0
Info 4211 [15:36:38.240] getCompletionData: Get previous token 2: 0
Info 4212 [15:36:38.240] getCompletionsAtPosition: isCompletionListBlocker: 0
Info 4213 [15:36:49.509] getCompletionData: Semantic work: 11269
Info 4214 [15:36:49.518] getCompletionsAtPosition: getCompletionEntriesFromSymbols: 8
Perf 4215 [15:36:49.525] 26::completionInfo: elapsed time (in milliseconds) 11286.3765
Info 4216 [15:36:49.526] response: <response object>

Log for 3.6.0-dev.20190712

Info 4180 [15:47:10.169] request:
    {"seq":23,"type":"request","command":"completionInfo","arguments":{"file":"<filename>","line":30,"offset":28,"includeExternalModuleExports":true,"includeInsertTextCompletions":true}}
Info 4181 [15:47:10.170] getCompletionData: Get current token: 0
Info 4182 [15:47:10.170] getCompletionData: Is inside comment: 0
Info 4183 [15:47:10.170] getCompletionData: Get previous token 1: 0
Info 4184 [15:47:10.170] getCompletionData: Get previous token 2: 0
Info 4185 [15:47:10.171] getCompletionsAtPosition: isCompletionListBlocker: 1
Info 4186 [15:47:10.238] getCompletionData: Semantic work: 67
Info 4187 [15:47:10.250] getCompletionsAtPosition: getCompletionEntriesFromSymbols: 11
Perf 4188 [15:47:10.260] 23::completionInfo: elapsed time (in milliseconds) 90.6148
Info 4189 [15:47:10.261] response: <response object (has more values than latest versions)>

Suggestion form other files

import { getSelectorData /*correctly suggest dispatchAction and other exports here*/ } from 'tools/store-reference';
...
dispatchAction/*no suggestion here*/

This is project written in JS has @types packages in node_modules 1 level above project package.json (since it isn't commited for everyone)

Related Issues:
Probably related to #31893 however it is unclear why there is big performance hit for "local" suggestions and why I'm unable to see suggestions from other files even (in the same folder).
I would understand why there might be no globals @types/* that are not specified in package.json, but not sure why there are no suggestion from other files at all.

Would be glad to follow instructions that will help to narrow this problem, however cannot provide source code.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions