Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode import path intellisense for custom files extensions

When writing a code that will be later pushed through webpack, it is possible to use custom loaders for non-standard files. In effect it is possible to write

import image from './assets/image.png';

and it will be properly handled. The problem is VSCode doesn't provide autocompletion for files like .png, .svg, .scss and so on.

Is it possible to do so by some settings or an extension?

like image 884
lort Avatar asked Jan 30 '23 05:01

lort


1 Answers

I was able to fix it using Path Autocomplete extension. By default it does not include file extensions and suggests the .js files in addition to the default suggestions by VS Code. It can be changed by adding the following lines to the User Settings:

"path-autocomplete.extensionOnImport": true,
"path-autocomplete.excludedItems": {
    "**/*.js": {"when": "**"}
}
like image 59
Kirill Zinovjev Avatar answered Feb 03 '23 07:02

Kirill Zinovjev