microsoft / vscode

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

Custom Editor Labels break on newest VS Code Version (v1.89) #211931

Closed PhilippHtz closed 4 months ago

PhilippHtz commented 4 months ago

Type: Bug

The Custom Editor Labels feature introduced in v1.88 seems to break on the newest version.

My Settings:

{
  "workbench.editor.customLabels.enabled": true,
  "workbench.editor.customLabels.patterns": {
    "app/**/page.tsx": "/${dirname(0)}.${extname}",
    "app/**/error.tsx": "/${dirname}-error.${extname}",
    "app/**/layout.tsx": "/${dirname}-layout.${extname}",
    "app/**/loading.tsx": "/${dirname}-loading.${extname}",
    "app/**/index.tsx": "/${dirname}.${extname}",
    "packages/**/index.tsx": "/${dirname}.${extname}",
    "packages/**/index.stories.tsx": "/${dirname}-story.${extname}"
  },
}

So the expected editor label for something like an index.tsx directly within the app folder should be /app.tsx. Instead the editor has its default label, in this case index.tsx. I didn't change my settings since intially setting them when this feature got introduced, so I can only assume this to be a bug.

VS Code version: Code 1.89.0 (b58957e67ee1e712cebf466b995adf4c5307b2bd, 2024-05-01T02:09:22.859Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900X 12-Core Processor (24 x 3700)| |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| |Load (avg)|undefined| |Memory (System)|31.93GB (15.88GB free)| |Process Argv|--crash-reporter-id e940f4f7-3f42-45fc-bb31-0769d2a33c2d| |Screen Reader|no| |VM|0%|
Extensions (74) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 github-markdown-preview|bie|0.3.0 lit-html|bie|1.11.1 markdown-checkbox|bie|0.4.0 markdown-emoji|bie|0.3.0 markdown-footnotes|bie|0.1.1 markdown-mermaid|bie|1.23.0 markdown-preview-github-styles|bie|2.0.4 markdown-yaml-preamble|bie|0.1.0 bitburner-vscode-integration|bit|1.3.3 vscode-tailwindcss|bra|0.10.5 path-intellisense|chr|2.8.5 vscode-css-modules|cli|0.5.1 codeium|Cod|1.8.28 font-preview|ctc|2.2.1 vscode-markdownlint|Dav|0.55.0 ini-for-vscode|Dav|0.0.4 vscode-eslint|dba|2.4.4 xml|Dot|2.5.1 gitlens|eam|14.9.1 vscode-html-css|ecm|2.0.9 EditorConfig|Edi|0.16.4 vsc-material-theme|Equ|34.3.1 vsc-material-theme-icons|equ|3.6.0 prettier-vscode|esb|10.4.0 indent-rainbow-palettes|evo|0.0.20 vscode-firefox-debug|fir|2.9.10 vscode-monorepo-workspace|fol|1.3.1 auto-rename-tag|for|0.1.10 code-runner|for|0.12.2 chrome-dinosaur-game|gee|0.0.1 html-slim-scss-css-class-completion|gen|1.7.8 live-sass|gle|6.1.2 auto-snippet|Gru|0.0.11 vscode-drawio|hed|1.6.6 svg|joc|1.5.3 graphql-for-vscode|kum|1.15.3 git-graph|mhu|1.30.0 theme-monokai-pro-vscode|mon|1.3.2 vscode-scss|mrm|0.10.0 vscode-docker|ms-|1.29.1 csdevkit|ms-|1.4.29 csharp|ms-|2.23.15 vscode-dotnet-runtime|ms-|2.0.3 vscodeintellicode-csharp|ms-|2.1.9 remote-containers|ms-|0.362.0 remote-wsl|ms-|0.88.2 indent-rainbow|ode|8.3.1 vscode-jest|Ort|6.2.4 cssvar|pho|2.6.4 material-icon-theme|PKi|5.1.0 material-product-icons|PKi|1.7.0 vscode-css-peek|pra|4.4.1 vscode-yaml|red|1.14.0 LiveServer|rit|5.7.9 synthwave-vscode|Rob|0.1.15 rust-analyzer|rus|0.3.1940 gitmoji-vscode|sea|1.2.5 firacode|Sey|2.2.1 svg-snippets|sid|1.0.1 iconfont-preview|stx|0.0.5 vscode-styled-components|sty|1.7.8 even-better-toml|tam|0.19.2 tauri-vscode|tau|0.2.6 ayu|tea|1.0.5 pdf|tom|1.2.2 vscode-mdx|uni|1.8.4 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-conventional-commits|viv|1.25.0 volar|Vue|2.0.8 gitblame|wad|10.10.1 json|Zai|2.0.2 html-css-class-completion|Zig|1.20.0 (3 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vstes627:30244334 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 vscrp:30673768 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 ccp2r3:30993541 dsvsc020:30976470 pythonait:31006305 chatpanelc:31018788 dsvsc021:30996838 01bff139:31013167 pythoncenvpt:31022790 dwnewjupytercf:31035177 ```
benibenj commented 4 months ago

There has been a small change which will require you to adapt your patterns. The patterns now also has to include the workspace folder. So you would need to adapt your patterns to one of the following formats:

PhilippHtz commented 4 months ago

Great, it works. Thanks for the info, I wasn't aware of that change. Though it would be nice if this is explicitly stated in the documentation. I just read through it again and I wouldn't have understood it in that way.

benibenj commented 4 months ago

You are right, I'll update the documentation