dotnet / dotnet/csharp-tmLanguage

Grammar causes freeze on on long chain of ternary operators

Offen
#170 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
78
Forks
43
Ø Merge
34 Min.
Gemergte PRs (30 T.)
1

Beschreibung

Original issue filed by @nblog in https://github.com/microsoft/vscode/issues/87225
## Details

What editor are you seeing the problem in? (e.g. Atom, Visual Studio Code, etc.)
VS Code
What version of the editor are you using?
1.42 Insiders
What color theme are you using?
not applicable

## Repro
```csharp
CallEvent callEvent = new CallEvent(traceId, (ulong)((callNumber == 0UL) ? ((long)r["CallNumber"]) : ((long)callNumber)), (ulong)((long)r["Peer"]), (int)((long)r["Priority"]), (string)((obj2 == DBNull.Value) ? string.Empty : obj2), (EventFlags)((long)r["EventFlags"]), (ulong)((long)r["RetValue"]), (string)((obj3 == DBNull.Value) ? string.Empty : obj3), (string)((obj4 == DBNull.Value) ? string.Empty : obj4), (HookType)((long)r["HookType"]), (uint)((long)r["ChainDepth"]), (uint)((long)r["Cookie"]), (double)r["Time"], (double)r["GenerationTime"], (int)((long)r["ParamMainIndex"]), (uint)((long)r["Pid"]), (uint)((long)r["Tid"]), (string)((obj5 == DBNull.Value) ? string.Empty : obj5), (string)((obj6 == DBNull.Value) ? string.Empty : obj6), (string)((obj7 == DBNull.Value) ? string.Empty : obj7), (bool)r["Success"], ancestors);
```
This line cause the freeze.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduziere den Freeze in der csharp-tmLanguage-Grammatik mit der bereitgestellten C#-Zeile, die eine lange Kette ternärer Operatoren enthält. Untersuche die Grammatikregeln für verschachtelte ternäre Ausdrücke und verifiziere, dass dieselbe Eingabe nicht mehr zum Freeze führt, während die C#-Syntaxhervorhebung weiterhin funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, typescript
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.