Microsoft/vscode

Suggestion: make `executeSelectionRangeProvider` respect settings for `editor.smartSelect`

Open

#189.972 geöffnet am 8. Aug. 2023

Auf GitHub ansehen
 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (10.221 Forks)batch import
feature-requesthelp wantedsmart-select

Repository-Metriken

Stars
 (74.848 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11h 43m) (1.000 gemergte PRs in 30 T)

Beschreibung

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.81.0
  • OS Version: macOS latest

VS Code exposes a command called executeSelectionRangeProvider. This calls provideSelectionRanges with { selectLeadingAndTrailingWhitespace: true, selectSubwords: true }:

https://github.com/microsoft/vscode/blob/42b4bf06704b84b40177f62405497a557a8fd73d/src/vs/editor/contrib/smartSelect/browser/smartSelect.ts#L308-L317

I am wondering whether VS Code should respect the smart select settings exposed under editor.smartSelect (e.g. editor.smartSelect.selectLeadingAndTrailingWhitespace), instead of passing true all of the time.

For context, I'm trying to create an extension that exposes the built-in "smart select" feature through a "quick picker". I've mostly got this working, except it doesn't respect the user's settings for smart select:

https://github.com/microsoft/vscode/assets/921609/52c59aea-9eb2-4439-9520-663daa4513d3

Code: https://github.com/OliverJAsh/vscode-smart-select-picker/blob/8158ebc258649c06a76ba9ec255a0ec315ba6863/src/extension.ts

Contributor Guide