microsoft / vscode

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

Snippet expansion regression in 1.67 #148976

Closed af4jm closed 2 years ago

af4jm commented 2 years ago

Issue Type: Bug

Prior to 1.67, the following code snippets just worked. In 1.67, the select-lists are severely truncated (see screenshots below snippets

in the first one, I tried removing the parens & the non-Latin character (i.e., changed Geʿez to Geez), and it had no effect

"lang": {
    "scope": "markdown",
    "prefix": "lang",
    "body": ["<abbr title=\"${1|Ancient (Koine) Greek,Ancient Hebrew,Aramaic,Latin,German,Spanish,English,Akkadian,Arabic,Coptic,Egyptian,Geʿez (Classic Ethiopic),Hittite,Phoenician,Sumerian,Syriac,Ugaritic|}\">`${2|grc,hbo,arc,lat,deu,spa,eng,akk,ara,cop,egy,gez,hit,phn,sux,syc,uga|}`</abbr>$0"],
    "description": "HTML <abbr> element for a language"
},
"abbr": {
    "scope": "markdown",
    "prefix": "abbr",
    "body": ["<abbr title=\"${1|Ancient Near Eastern,Septuagint,Masoretic Text,Dead Sea Scrolls / Qumran Cave Scrolls,Peshitta,Yahwist source,Elohist source,Deuteronomist source,Priestly source,Dictionary of Biblical Imagery,Dictionary of Deities and Demons in the Bible,Dictionary of Biblical Languages with Semantic Domains,Enhanced Hebrew and English Lexicon (Brown\\, Driver\\, & Briggs),Greek–English Lexicon (Liddell & Scott w/ Jones),A Greek–English Lexicon of the New Testament and Other Early Christian Literature (Bauer\\, Danker\\, Arndt\\, & Gingrich),The Hebrew & Aramaic Lexicon of the Old Testament|}\">${2|ANE,ⅬⅩⅩ,$\\mathfrak{M}$,DSS,*pšîṭtâ*,J,E,D,P,DBI,DDD,DBL,BDB,LSJ,BDAG,HAL|}</abbr>$0"],
    "description": "HTML <abbr> element for something other than a language"
}

image\ image

VS Code version: Code 1.67.0 (57fd6d0195bb9b9d1b49f6da5db789060795de47, 2022-05-04T12:06:02.889Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz (8 x 1800)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|31.89GB (22.36GB free)| |Process Argv|--file-uri file:///c%3A/src/AF4JM.code-workspace --crash-reporter-id 06338080-eec2-498d-98e0-cf3111dc1cde| |Screen Reader|no| |VM|0%|
Extensions (97) Extension|Author (truncated)|Version ---|---|--- html-snippets|abu|0.2.1 vscode-icalendar|af4|1.0.1 vscode-m3u|af4|1.0.0 vscode-caniuse|aga|0.5.0 case-change|Aka|1.0.2 Bookmarks|ale|13.2.4 rtf|ale|2.5.0 vscode-sqlite|ale|0.14.0 swagger-viewer|Arj|3.1.2 spellright|ban|3.0.64 armview|ben|0.4.6 markdown-checkbox|bie|0.3.2 markdown-emoji|bie|0.2.1 markdown-footnotes|bie|0.0.7 markdown-mermaid|bie|1.13.2 vscode-tldr|bmu|1.0.0 mermaid-markdown-syntax-highlighting|bpr|1.2.3 npm-intellisense|chr|1.4.1 gitignore|cod|0.7.0 disableligatures|Coe|0.0.10 vscode-markdownlint|Dav|0.47.0 jshint|dba|0.11.0 vscode-eslint|dba|2.2.2 rushcore|Dev|1.0.2 rushnav|Dev|1.0.2 githistory|don|0.6.19 xml|Dot|2.5.1 escaping-characters|drp|1.0.0 vscode-babel-coloring|dza|0.0.4 EditorConfig|Edi|0.16.4 vscode-npm-script|eg2|0.3.25 vscode-macros|EXC|1.4.0 git-project-manager|fel|1.8.2 scriptcsRunner|fil|0.1.0 vscode-firefox-debug|fir|2.9.6 vscode-npm|fkn|3.3.0 shell-format|fox|7.2.2 macros|ged|1.2.1 matlab|Gim|2.3.1 vscode-pull-request-github|Git|0.42.0 gc-excelviewer|Gra|4.2.54 beautify|Hoo|1.5.0 vscode-favorites|how|1.10.2 rest-client|hum|0.24.6 path-autocomplete|ion|1.19.1 mediawiki|jak|2.1.0 markdown-katex|jef|0.1.4 nuget-reverse-package-search|jes|0.1.68 vscode-nuget-package-manager|jmr|1.1.6 vscode-peacock|joh|4.0.1 gpg|jva|0.1.2 docomment|k--|0.1.30 vscode-liquid-snippets|kil|2.0.3 gnuplot|mam|1.0.5 markdown-shortcuts|mdi|0.12.0 openapi-lint|mer|1.2.0 HTMLHint|mka|0.10.0 azure-pipelines|ms-|1.204.0 vscode-azureappservice|ms-|0.23.3 vscode-azurefunctions|ms-|1.6.2 vscode-azureresourcegroups|ms-|0.4.0 vscode-azurestorage|ms-|0.13.0 vscode-azurevirtualmachines|ms-|0.5.0 vscode-bicep|ms-|0.6.1 vscode-cosmosdb|ms-|0.18.1 csharp|ms-|1.24.4 vscode-dotnet-runtime|ms-|1.5.0 python|ms-|2022.6.0 vscode-pylance|ms-|2022.4.3 jupyter|ms-|2022.4.1011282140 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.6 vscode-ai-remote|ms-|0.12.0 azure-account|ms-|0.10.1 azurecli|ms-|0.5.0 live-server|ms-|0.2.12 powershell|ms-|2022.5.1 vscode-node-azure-pack|ms-|0.3.0 vscode-typescript-tslint-plugin|ms-|1.3.4 azurerm-vscode-tools|msa|0.15.6 debugger-for-edge|msj|1.0.15 language-liquid|nei|0.1.1 bib|phr|0.3.0 vscode-commons|red|0.0.6 vscode-yaml|red|1.7.0 kuskus-kusto-language-server|ros|1.0.24 kuskus-kusto-syntax-highlighting|ros|1.1.20 vscode-hexdump|sle|1.8.1 vscode-zipexplorer|sle|0.3.1 addDocComments|ste|0.0.8 msbuild-project-tools|tin|0.4.3 shell-launcher|Tyr|0.4.1 vscodeintellicode|Vis|1.2.20 nanoid-generator|vk-|0.1.2 vscode-icons|vsc|11.11.0 JavaScriptSnippets|xab|1.8.0 t4-support|zbe|0.5.0
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 pythonvspyl392:30443607 pythontb:30283811 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 pythondataviewer:30285071 vscod805cf:30301675 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 pythonvsnew555:30457759 vscscmwlcmt:30465135 cppdebug:30475216 ```
af4jm commented 2 years ago

same snippets in Insiders 1.64 (because I haven't updated it in a while... but release was the same in 1.66)

image\ image

gjsjohnmurray commented 2 years ago

Perhaps a consequence of #146164

af4jm commented 2 years ago

noticed also that selecting one of the options mangles the text, both of these were created by invoking the snippet & tab, tab to keep the first value from each drop-down... this is the wrong output (highlighted part is duplicated... and in the first one, it changes to the last item in the list):

<abbr title="Ancient (Koine) Ancient (Koine) Greek">`uga`</abbr>

<abbr title="Ancient Near Ancient Near Eastern">ANE</abbr>

jrieken commented 2 years ago

Bug is here: https://github.com/microsoft/vscode/blob/d6f55b65e981c6470b70b1dc7028c4350d497c65/src/vs/editor/contrib/snippet/browser/snippetController2.ts#L149. We use the word at position, not everything from the choice element

vscodenpa commented 2 years ago

This bug has been fixed in the latest release of VS Code Insiders!

@af4jm, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 9c29becfad5f68270b9b23efeafb147722c5feba of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

af4jm commented 2 years ago

just let Insiders update itself & yes, the snippets are back to working as documented there... thx!