Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[nuxt] scriptLang macro and Vue Official VSCode extension not in sync #1002

@angelhdzmultimedia

Description

@angelhdzmultimedia

Describe the bug

When I enable scriptLang: { defaultLang: "ts" } macro, colors in the <script setup> tag change.
For example, I use Synthwave Fluoromachine VSCode theme, the import keywords are pink, when I remove lang="ts" so that the macro adds it automatically, then they change to purple. Also the parentheses color change.

Image Image

What comes to my mind first is there's no sync between this macro and the Vue Official extension to let it know the script lang is "ts" to show the color syntax highlighting for the *.ts language, so it's treated as JavaScript code.

I tried adding

 "vueCompilerOptions": {
      "plugins": [
        "vue-macros/volar"
      ]
}

in tsconfig.json and in nuxt.config.ts's typescript.tsConfig option.

So it's this something that can be solved or not, so that I can know if I can continue using this macro.

Thanks.

Reproduction

No reproduction required, this is a Vue Official VSCode extension sync issue, not code related per se. If a repro is needed, I'll edit this Issue and add one.

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
    Memory: 1.67 GB / 15.77 GB
  Binaries:
    Node: 24.9.0 - C:\Users\Angel\AppData\Local\fnm_multishells\24160_1761447516787\node.EXE
    npm: 11.6.0 - C:\Users\Angel\AppData\Local\fnm_multishells\24160_1761447516787\npm.CMD
    pnpm: 10.17.1 - C:\Users\Angel\AppData\Local\fnm_multishells\24160_1761447516787\pnpm.CMD
    bun: 1.3.0 - C:\Users\Angel\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (140.0.3485.94)
    Firefox: 144.0 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.26100.1882

Used Package Manager

bun

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions