Skip to content

"Feature can only be used in a .ts file." when switching the language mode to TypeScript in a .js file #9199

Closed
@niieani

Description

@niieani
  • VSCode Version: all versions, tested also on latest: 1.4.0-insider 50a0945
  • OS Version: OS X 10.11

Steps to Reproduce:

  1. Create a TypeScript file with a .js extension
  2. Change the language mode inside VSCode to "TypeScript" (defaults to JavaScript in files with a .js extension)
  3. Add some TypeScript specific code, e.g. interface ABC {}

Causes an error:

'interface declarations' can only be used in a .ts file.

Mentioned in the discussion here: microsoft/TypeScript#7926

Metadata

Metadata

Assignees

Labels

typescriptTypescript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions