microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.04k stars 12.49k forks source link

Customise extensions that import intellisense recognises #19018

Open mjbvz opened 7 years ago

mjbvz commented 7 years ago

From @Rich-Harris on October 6, 2017 15:7

As of VSCode 1.17, typing import x from './ offers autocomplete suggestions of local files and directories. However, the list of file extensions that are recognised is somewhat arbitrary — .js files are recognised, as are .ts and .jsx, but .json isn't (despite the fact that the Node handles .json files natively).

Meanwhile, when building web applications with bundlers like Webpack and Rollup, it's common to import files with extensions like .css, .html, .vue, .tsv and so on.

Is there some way to customise the list of extensions that are recognised? An alternative approach could be to recognise all file extensions rather than attempting to filter them.

Copied from original issue: Microsoft/vscode#35731

mjbvz commented 7 years ago

This is related to https://github.com/Microsoft/TypeScript/issues/10939 . Imports / requires of non-js/ts files will not be recognized by intellisense