Skip to content

Long running 'completions' request on TS project using lodash #23285

Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#47253 (comment)

TypeScript Version: 2.9.0-dev.20180409

Search Terms:

  • completions

Code
In a new folder without a tsconfig:

package.json:

{
  "name": "test",
  "private": true,
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@types/lodash": "^4.14.106",
    "lodash": "^4.17.5",
    "typescript": "^2.9.0-dev.20180409"
  }
}

index.ts:

import * as _ from 'lodash';

const result = _.chain([]).ma
// or
const result = _([]).ma
  1. Run npm install
  2. Open index.ts in vscode
  3. Trigger completions on .ma

Bug:
TS Server completions requests end up taking ~6seconds each time. Here's my tsserver log
tsserver copy.log

Look for the lines around: getCompletionData: Semantic work: 6974

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions