Skip to content

Error: TypeError: Cannot read property 'kind' of undefined in getCompletionsAtPosition #22618

@mjbvz

Description

@mjbvz

From microsoft/vscode#45529 and microsoft/vscode#44440

TypeScript Version: 2.8.0-dev.20180314

Search Terms:

  • getCompletionsAtPosition

Code

  1. In VS Code. In an html file script block (which uses the TS server as a library):
<!DOCTYPE html>
<html>
<body>
<script>
   
</script>
</body>
</html>
  1. Inside the script block, type }

bug

TypeError: Cannot read property 'kind' of undefined
    at Object.isClassElement (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/typescript.js:13334:24)
    at isFromClassElementDeclaration (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/typescript.js:85829:27)
    at tryGetClassLikeCompletionContainer (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/typescript.js:85865:33)
    at tryGetGlobalSymbols (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/typescript.js:85349:42)
    at getCompletionData (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/typescript.js:85254:22)
    at Object.getCompletionsAtPosition (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/typescript.js:84536:34)
    at Object.getCompletionsAtPosition (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/typescript.js:103187:35)
    at Object.doComplete (/Users/matb/projects/vscode/extensions/html/server/out/modes/javascriptMode.js:80:49)
    at Object.<anonymous> (/Users/matb/projects/vscode/extensions/html/server/out/htmlServerMain.js:329:43)
    at step (/Users/matb/projects/vscode/extensions/html/server/out/htmlServerMain.js:36:23)

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions