microsoft / vscode

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

context key "atEndOfWord" is always false #205415

Open md-base-t opened 8 months ago

md-base-t commented 8 months ago

Type: Bug

When I open a code editor in VSCode and place the text cursor at the end of any word, the context key atEndOfWord remains false, it stays false at every cursor position. I use this context key in the "when" keys of the "keybindings.json" and it has always worked without any problems.

I think that the state of atEndOfWord is always false since version 1.85 or 1.85.1.

VS Code version: Code 1.86.2 (903b1e9d8990623e3d7da1df3d33db3e42d80eda, 2024-02-13T19:40:56.878Z) OS version: Windows 10 x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz (4 x 2195)| |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: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|7.92GB (3.01GB free)| |Process Argv|--log info| |Screen Reader|no| |VM|0%|
Extensions (23) Extension|Author (truncated)|Version ---|---|--- json-viewer|Dut|0.1.0 vscode-commands|fab|1.4.3 thefoldingstuff|geo|0.2.1 vscode-menu-builder|kyl|1.0.2 vscode-plugin-keyboard-shortcut-eval-custom-javascript-codes|Lia|1.0.13 vscode-language-pack-de|MS-|1.85.2024021409 csharp|ms-|2.15.30 vscode-dotnet-runtime|ms-|2.0.1 debugpy|ms-|2024.0.0 python|ms-|2024.0.1 vscode-pylance|ms-|2024.2.2 jupyter|ms-|2024.1.1 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 powershell|ms-|2024.0.0 multi-command|ryu|1.6.0 vbsvscode|Ser|1.2.1 memento-inputs|spa|1.0.0 vscode-autohotkey2-lsp|thq|2.3.2 vscode-inline-values-powershell|Tyl|0.0.7 vscode-autohotkey-debug|zer|1.11.0
jrieken commented 4 months ago

@md-base-t This context key is only available when having editor.tabCompletion set to on. Can you check that's the case for you?

md-base-t commented 3 months ago

@jrieken Thanks for your investigation! Indeed atEndOfWord is also in my VSCode installation available if editor.tabCompletion is on. I had it changed to off because I need the TAB key in VSCode editors (on language mode plaintext) to insert indentation (and with editor.tabCompletion = on I am often surprised if then is inserted a suggestion).

It is a possible enhancement request to make atEndOfWord context key always available, independent of editor.tabCompletion setting?

Urist-McUristurister commented 1 month ago

I'd second that request. It makes absolutely no sense to have it dependent on editor.tabCompletion setting.