You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Prism incorrectly highlights the "from" word as a keyword in some languages which are not supposed to be highlighted. An example of this is Javascript and C#.
Although in C# is kinda tricky since it is a keyword when using a from-in clause:
func(from:"America",to:"Asia");// Prism incorrectly highlights "from" as a keywordfromelementinlist;// no issues here
We use a little trick to only highlight the from in imports as a keyword: from(?=\s*(?:['"]|$)). The fromkeyword is guaranteed to be preceded by a string literal, so our regex checks for that.
C#:
As you said, this is tricky. Prism's regex-based highlighting approach is not powerful enough to detect whether from is used as a keyword inside a LINQ query or as a regular identifier elsewhere.
However, I think we could use a similar trick as for JS. The from keyword is guaranteed to be preceded by either a type or an identifier. I'll make a PR for this trick.
Information:
Description
Prism incorrectly highlights the "from" word as a keyword in some languages which are not supposed to be highlighted. An example of this is Javascript and C#.
Although in C# is kinda tricky since it is a keyword when using a from-in clause:
Example
JSFiddle
The text was updated successfully, but these errors were encountered: