vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.55k stars 373 forks source link

.vscode typescript settings not respected in .vue files #4405

Open pleek91 opened 1 month ago

pleek91 commented 1 month ago

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.

so1ve commented 1 month ago

Currently you must enable hybridMode to get them work

pleek91 commented 1 month ago

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

RayGuo-ergou commented 1 month ago

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"

pleek91 commented 1 month ago

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

RayGuo-ergou commented 1 month ago

Tried another setting, and yes I am using hybrid mode

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

image

I think it always use default value

pleek91 commented 1 month ago

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.