microsoft / vscode

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

snippet suggestion does not appear when use specific prefixes #109871

Closed almaceleste closed 3 years ago

almaceleste commented 3 years ago

Issue Type: Bug

  1. add to the ~/.config/Code/User/snippets/r.json file:
     "assignment operator": {
        "prefix": ["<-", "="],
        "body": [
            "<- "
        ],
        "description": "assignment operator"
    },
    "magrittr pipe": {
        "prefix": ["%>%", ">"],
        "body": [
            "%>%",
            "\t$0"
        ],
        "description": "magrittr pipe"
    }
  2. open .r file and type <, = or > - snippet suggestion does not appear, but if press Ctrl+Space it is in the dropdown list.
  3. type - or % and snippet suggestion appears automatically, without Ctrl+Space.

note: strange, that for javascript.json prefix < works, but > does not.

VS Code version: Code 1.50.1 (d2e414d9e4239a252d1ab117bd7067f125afd80a, 2020-10-13T14:44:48.716Z) OS version: Linux x64 5.4.0-52-lowlatency

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 3200)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|1, 1, 0| |Memory (System)|15.57GB (1.65GB free)| |Process Argv|--no-sandbox --crash-reporter-id 0bfd8309-f876-4390-99c3-dddd9b122049| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|xfce| |XDG_CURRENT_DESKTOP|XFCE| |XDG_SESSION_DESKTOP|xfce| |XDG_SESSION_TYPE|x11|
Extensions (47) Extension|Author (truncated)|Version ---|---|--- vscode-browser-preview|auc|0.6.7 unique-lines|bib|1.0.0 file-properties-viewer|bru|0.5.0 npm-intellisense|chr|1.3.1 regex|chr|0.2.0 vscode-translate|chu|0.1.5 vscode-quick-select|dba|0.2.9 apt-source-list-syntax|dei|0.1.5 gitlens|eam|10.2.2 vscode-npm-script|eg2|0.3.13 auto-close-tag|for|0.5.9 auto-rename-tag|for|0.1.5 code-runner|for|0.11.1 shell-format|fox|7.0.1 seito-openfile|Fr4|1.8.7 vscode-pull-request-github|Git|0.20.1 shortcuts|giz|0.0.1 name-that-color|gui|0.1.2 rest-client|hum|0.24.3 r|Iku|1.5.2 reg|ion|1.0.1 AWK|lug|0.0.2 python|ms-|2020.10.332292344 cpptools|ms-|1.0.1 powershell|ms-|2020.6.0 vscode-github-issue-notebooks|ms-|0.0.57 debugger-for-chrome|msj|4.12.11 reload|nat|0.0.6 linesinfostatusbar|pet|0.0.3 vscode-css-peek|pra|4.0.0 bracketeer|pus|1.3.1 vscode-data-preview|Ran|2.2.0 r-lsp|REd|0.1.11 LiveServer|rit|5.6.1 color-manager|roy|0.6.1 csspreview|san|1.0.4 trailing-spaces|sha|0.3.1 vscode-scheme|sjh|0.4.0 code-spell-checker|str|1.9.2 code-spell-checker-russian|str|0.2.8 code-spell-checker-spanish|str|1.0.6 open-in-new-instance|syd|1.2.1 open-window-tab-context|tak|1.4.2 pdf|tom|1.1.0 autocomplate-shell|tru|0.1.1 vscodeintellicode|Vis|1.2.10 open-in-external-app|YuT|0.2.1
vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

jrieken commented 3 years ago

Yes - quick suggestions (suggestions as you type) only appear when typing at word ends not when typing arbitrary characters. This is done to prevent unwanted showings of the suggest widget

almaceleste commented 3 years ago

as-designed?! really?!! javascript file (just pressed <, not pressed ctrl+space): image r file (just pressed <): image r file (pressed ctrl+space): image are these different behaviors really intended from by design?!! why?!!

jrieken commented 3 years ago

why?!!

because < is a trigger character for JS

almaceleste commented 3 years ago

because < is a trigger character for JS

trigger to what? I can create snippets for trigger characters only? if so, where can I see the entire list of trigger symbols?