On type formatting for blocks is unhelpful due to cursor placement
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- ruby, vscode
- Ambito
- developer-experience, devtools
Direzione di ricerca
Inizia riproducendo gli esempi di blocchi e metodi in VS Code con la funzionalità onTypeFormatting di Ruby LSP abilitata. Verifica come il completamento posiziona il cursore dopo l’inserimento dei delimitatori di blocco e verifica che il cursore si trovi nella posizione prevista per continuare il corpo del blocco o del metodo senza usare i tasti freccia per la navigazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Ruby LSP Information
VS Code Version
1.95.3
Ruby LSP Extension Version
0.8.16
Ruby LSP Server Version
0.22.1
Ruby LSP Addons
- Ruby LSP Rails
Ruby Version
3.3.6
Ruby Version Manager
custom
Installed Extensions
Click to expand
- amx-netlinx (0.6.1)
- better-toml (0.3.2)
- copy-text (0.4.9)
- cpptools (1.22.11)
- csharp (2.55.29)
- elixir-ls (0.24.2)
- gitlens (16.0.5)
- go (0.42.1)
- haml (1.4.1)
- isort (2023.10.1)
- material-icon-theme (5.15.0)
- platformio-ide (3.3.3)
- postcss (2.0.0)
- python (2024.20.0)
- ruby-lsp (0.8.16)
- rust-analyzer (0.3.2212)
- vscode-ansi (1.1.7)
- vscode-dotnet-runtime (2.2.3)
- vscode-eslint (3.0.10)
- vscode-npm-script (0.3.29)
- vscode-projects-plus (1.24.0)
- vscode-zipfs (3.0.0)
Ruby LSP Settings
Click to expand
Workspace
{}
User
{
"enabledFeatures": {
"codeActions": true,
"diagnostics": true,
"documentHighlights": true,
"documentLink": true,
"documentSymbols": true,
"foldingRanges": true,
"formatting": true,
"hover": true,
"inlayHint": true,
"onTypeFormatting": true,
"selectionRanges": true,
"semanticHighlighting": true,
"completion": true,
"codeLens": true,
"definition": true,
"workspaceSymbol": true,
"signatureHelp": true,
"typeHierarchy": true
},
"featuresConfiguration": {},
"addonSettings": {},
"rubyVersionManager": {
"identifier": "custom"
},
"customRubyCommand": "rbenv init - fish | source",
"formatter": "auto",
"linters": null,
"bundleGemfile": "",
"testTimeout": 30,
"branch": "",
"pullDiagnosticsOn": "both",
"useBundlerCompose": false,
"bypassTypechecker": false,
"rubyExecutablePath": "",
"indexing": {},
"erbSupport": true,
"featureFlags": {}
}
Reproduction steps
ruby-lsp auto-completes ruby blocks which is potentially a great feature, but the implementation is not quite there. Examples:
- Type
method do |. ruby-lsp autocompletes the argument pipes tomethod do ||, but the cursor is after the closing pipe, so attempting to finish typing e.g.|a|results inmethod do ||a||. You have to remember to arrow left before typing the argument. - Type
def method_name<enter>. ruby-lsp autocompletes the method structure with an empty line andend, but the cursor is afterendso you have to remember to arrow up before typing the method body. Same withdo ... endblocks.
This behavior IMO is unexpected because in other cases where VSCode autocompletes, the cursor is placed where you would expect. E.g. if you type " or ( you get "" or () but the cursor is between the two characters and you can immediately continue typing.
I really like the completion feature in concept, but since the cursor is placed in the wrong spot it slows me down to the point where disabling completion and typing the whole block myself is faster. Especially since completion isn't enabled in ERB files, so working on a Rails project I have to keep track of the context to type blocks successfully.
- Lingua principale
- Ruby
- Stelle
- 2k
- Fork
- 284
- Merge medio
- 11h 11m
- PR unite (30g)
- 10
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Shopify/ruby-lsp
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memoryForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Multi-line `<%# %>` ERB comments are parsed as Ruby, so semantic highlighting colors the prose as method callsForse già presa @Pybsama l’ha presa 72 giorni fa. Apertabug Stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Shopify/ruby-lsp#4181 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Linux file system with square brackets in the directory/filename are failing to be indexedForse già presa @andriytyurnikov l’ha presa 204 giorni fa. Apertabug help-wanted pinned
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Shopify/ruby-lsp#3503 · 8 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Rename of a class moves its file and leaves require_relative on the old pathForse già presa @efegokdemir l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
I maintainer di solito rispondono entro 1 giorno
-
Paths need to be escapedForse già presa @Vraiment l’ha presa 5 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Shopify/ruby-lsp
Issue simili
-
area/web interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
mastodon/mastodon#41000 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
zerocracy/judges-action#2743 ·
I maintainer di solito rispondono entro 8 giorni
-
Python 3.15 supportForse già presa @amnesiaof l’ha presa oggi. ApertaL: python L: python:uv
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dependabot/dependabot-core#16524 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add Nagoya Ruby Kaigi 05Apertacontent good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
rubyevents/rubyevents#2182 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno