Skip to content

Autocomplete for non-typescript imports (eg webpack-file-loader) #88984

@Lexicality

Description

@Lexicality

Backstory

My frontend code imports various templates via

import template from "templates/foo/bar/baz.jinja";

using Webpack to compile the templates.
To this end, I have this is my tsconfig.json:

{
    "compilerOptions": {
        "baseUrl": "client",
        "paths": {
            "templates/*": [
                "../server/templates/*"
            ]
        }
    }
}

and this in global.d.ts

declare module "*.jinja" {
    export default function(context?: { [arg: string]: any }): string;
}

With this setup I have type checking and when I start to import a template intellisense correctly gives me folders however it does not show me any of the .jinja files in those folders.
It also does not let me jump to those files by pressing F12 in the way that it does with typescript files.

Request

  • I want to be able to type import template from "templates/foo/bar/, press ctrl space and be shown baz.jinja
  • I would like to be able to press F12 on import template from "templates/foo/bar/baz.jinja"; and be taken to /server/templates/foo/bar/baz.jinja in the editor

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issuesupstream-issue-linkedThis is an upstream issue that has been reported upstream

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions