Wrong syntax highlighting for `<%==` erb syntax
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 38/100
Direzione di ricerca
Inizia con vscode/grammars/erb.cson.json e vscode/languages/erb.json, usando la riproduzione della sintassi <%= e il diff proposto come punto di partenza. Verifica che i tag ERB < %== ricevano l’evidenziazione della sintassi corretta e che la configurazione del linguaggio includa le coppie di parentesi e di delimitatori circostanti previste; l’issue segnala che non sono presenti test esistenti per l’evidenziazione ERB.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Ruby LSP Information
Details
VS Code Version
1.95.1
Ruby LSP Extension Version
0.8.14
Ruby LSP Server Version
0.22.1
Ruby LSP Addons
- Ruby LSP Rails
Ruby Version
3.3.6
Ruby Version Manager
rbenv
Installed Extensions
Click to expand
- asciidoctor-vscode (3.4.2)
- gitlens (16.0.4)
- go (0.42.1)
- material-icon-theme (5.14.1)
- remote-containers (0.388.0)
- ruby-lsp (0.8.14)
- sorbet-vscode-extension (0.3.37)
- vscode-github-actions (0.27.0)
- vscode-rdbg (0.2.2)
- vscode-wakatime (24.9.1)
- vscode-yaml (1.15.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": "auto"
},
"customRubyCommand": "",
"formatter": "none",
"linters": null,
"bundleGemfile": "",
"testTimeout": 30,
"branch": "",
"pullDiagnosticsOn": "both",
"useBundlerCompose": false,
"bypassTypechecker": false,
"rubyExecutablePath": "",
"indexing": {},
"erbSupport": true,
"useLauncher": false,
"featureFlags": {}
}
Reproduction steps
A lesser used but valid syntax of erb is <%== which will mark the passed string as html safe. Rails documents it at the bottom of https://guides.rubyonrails.org/active_support_core_extensions.html#safe-strings, although I'm not sure if this is rails specific or not. Could very well be erubi only.
ruby-lsp fails to consider the second equal sign, showing the code like this:
A fix seems rather straightforward but erb highlighting has no tests and I don't really understand these gramar files so I'm not very confident in my change. I can open a PR if it looks reasonable and no tests are fine.
Patch
diff --git a/vscode/grammars/erb.cson.json b/vscode/grammars/erb.cson.json
index 475a9454..fe88bb21 100644
--- a/vscode/grammars/erb.cson.json
+++ b/vscode/grammars/erb.cson.json
@@ -80,7 +80,7 @@
"tags": {
"patterns": [
{
- "begin": "<%+(?!>)[-=]?(?![^%]*%>)",
+ "begin": "<%+(?!>)[-=]?=?(?![^%]*%>)",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.erb"
@@ -113,7 +113,7 @@
]
},
{
- "begin": "<%+(?!>)[-=]?",
+ "begin": "<%+(?!>)[-=]?=?",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.erb"
diff --git a/vscode/languages/erb.json b/vscode/languages/erb.json
index ae1564fb..f8373735 100644
--- a/vscode/languages/erb.json
+++ b/vscode/languages/erb.json
@@ -5,6 +5,7 @@
"brackets": [
["<%", "%>"],
["<%=", "%>"],
+ ["<%==", "%>"],
["<%#", "%>"]
],
"autoClosingPairs": [
@@ -35,6 +36,7 @@
"surroundingPairs": [
["<%", "%>"],
["<%=", "%>"],
+ ["<%==", "%>"],
["<%#", "%>"],
["{", "}"],
["[", "]"],
- 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 @efegokdemir l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
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 206 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 3 giorni 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 7 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
check-labels intermittently fails due to the organization IP allow listForse già presa @soutaro l’ha presa 10 giorni fa. Aperta
Shopify/ruby-lsp#4219 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Shopify/ruby-lsp
Issue simili
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
bridgetownrb/bridgetown#1130 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
stripe/stripe-ruby#1994 ·
I maintainer di solito rispondono entro 1 giorno
-
[Fehler]: /abdeckstift wirft 500 — part_type aus der Phonemreduction-Umbenennung nicht mitgezogenApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
wort-schule/wort.schule#787 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
lugassawan/swe-workbench#799 ·
I maintainer di solito rispondono entro 1 giorno
-
2.8.6: NoMethodError "undefined method 'first'" in profdata_coverage_dir whenever --scheme is usedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
SlatherOrg/slather#586 · 2 commenti ·