Intellisense does not work for .vue files

I work with Vue and Typescript in Visual Studio code and the Vetur extension. Problem: when updating any code, intellisense will not recognize changes when working in a file .vue. .tsIntellisense IS works in files !

I use this definition file so that Typescript recognizes the file extension .vue:

declare module "*.vue" {
    import Vue from "vue";
    export default Vue;
}

Example

test.ts just changed

export default class Test {
    // testFunction() {}    // just removed this
    dummyFunction() {}      // added this
}

app.vue intellisense not working

In any file, .vueintellisense continues to offer testFunction and does not recognize dummyFunction:

import Test from "./test"
export default class App extends Vue {
    created() {
        const t = new Test()
        t.testFunction()        // allowed - but it doesn't exist
        t.dummyFunction()       // not allowed - but it does exist
    }
}

somefile.ts intellisense works

In regular old .ts files, intellisense works.

import Test from "./test"
const t = new Test()
t.testFunction()        // here it works - this is not allowed
t.dummyFunction()       // here it works - this is allowed

If I close the VS code and open it again, the new changes are updated. Is this a Vietnam glitch? Do I need to modify tsconfig files or definitions?

+4

Source: https://habr.com/ru/post/1688331/


All Articles