language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

.vscode typescript settings not respected in .vue files

Open pleek91 opened this issue 1 year ago • 6 comments

I have the following settings added to my workspace .vscode/settings.json

    "typescript.tsdk": "node_modules/typescript/lib",  
    "typescript.preferences.importModuleSpecifier": "non-relative",
    "typescript.preferences.importModuleSpecifierEnding": "minimal",
    "typescript.preferences.quoteStyle": "single",
    "typescript.preferences.autoImportFileExcludePatterns": [
        "@vue/reactivity",
        "@vue/runtime-dom",
        "./dist",
        "./src/index.ts"
    ],

And in a .ts file I see a nice short list of suggestions image

But in a .vue file the list is much different image

Not only is autoImportFileExcludePatterns not respected it seems the other settings are not respected either. For example, changing the value of quoteStyle has no effect in a .vue file and it does in a .ts file.

pleek91 avatar May 20 '24 21:05 pleek91

Currently you must enable hybridMode to get them work

so1ve avatar May 21 '24 01:05 so1ve

I added "vue.server.hybridMode": true, to my settings but no change. Is there something else I need to do?

pleek91 avatar May 21 '24 03:05 pleek91

GIF 5-21-2024 7-28-29 PM

~~Just had a try, even tho in code action select drop down it shows double quote, the result still in single quote.~~

I see does not work for "double"

RayGuo-ergou avatar May 21 '24 09:05 RayGuo-ergou

@RayGuo-ergou are the other settings working for you? Are you using hybrid mode?

pleek91 avatar May 21 '24 13:05 pleek91

Tried another setting, and yes I am using hybrid mode

"typescript.preferences.importModuleSpecifierEnding": "js",

image

I think it always use default value

RayGuo-ergou avatar May 22 '24 02:05 RayGuo-ergou

Thanks for verifying. This is something I'd love to see working in components. The experience is so nice in my ts files but not in my vue files.

pleek91 avatar May 22 '24 21:05 pleek91

Hey there, as there have been many fixes in the last 2.x versions: Please let us know if you're still encountering this issue. Otherwise kindly close this one, thanks!

davidmatter avatar Aug 07 '24 06:08 davidmatter