microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.98k stars 29.19k forks source link

@import url('@/index.css') Not Navigating to File in CSS/SCSS/LESS with @ alias #232781

Open Eunknight opened 1 day ago

Eunknight commented 1 day ago

Type: Bug

The syntax @import url('@/index.css') in CSS (scss, less) does not allow jumping (ctrl+click) to the specified file when used with @ alias. *.css @import url('@/index.css') not works. @import '@/index.css' not works.

@import url('./index.css') works. @import './index.css' works.

*.js import '@/index.css' not work

import '.index.css' works import '@/index.js' works

Other scenarios work fine: JS imports work. Vue component imports work. The jsconfig.json has been correctly configured.

VS Code version: Code 1.95.1 (65edc4939843c90c34d61f4ce11704f09d3e5cb6, 2024-10-31T05:14:54.222Z) OS version: Windows_NT x64 10.0.26100 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2592)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|15.92GB (5.09GB free)| |Process Argv|--crash-reporter-id e0594036-6f5d-4214-9986-19d1ad97df1a| |Screen Reader|no| |VM|0%|
Extensions (18) Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|13.5.0 vscode-tailwindcss|bra|0.12.12 vscode-eslint|dba|3.0.10 gitlens|eam|15.6.2 EditorConfig|Edi|0.16.4 vscode-element-helper|Ele|0.5.6 prettier-vscode|esb|11.0.0 auto-close-tag|for|0.5.15 auto-rename-tag|for|0.1.10 eslint-rules-zh-plugin|mag|0.2.2 marscode-extension|Mar|1.1.24 vscode-language-pack-zh-hans|MS-|1.95.2024103009 vetur|oct|0.37.3 vscode-css-navigation|puc|1.15.0 vscode-stylelint|sty|1.4.0 var-translation|sve|0.13.51 highlight-matching-tag|vin|0.11.0 sort-js-object-keys|zen|1.0.6
aeschli commented 16 hours ago

I beliebe the @ syntax in imports os not valid in CSS, just SCSS. If I'm wrong, I'd be happy if you have a link to the spec.