Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44af823

Browse files
authored
Merge pull request #3102 from vasily-kirichenko/fix-exception-coloring
Color F# exceptions as ref types / fix coloring of backticked enum fields
2 parents11f2ae3 +c63ad2d commit44af823

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

‎src/fsharp/vs/service.fs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,8 @@ type TypeCheckInfo
12311231
if minfos|> List.exists(fun minfo-> isStructTy g minfo.EnclosingType)then
12321232
Some(m, SemanticClassificationType.ValueType)
12331233
else Some(m, SemanticClassificationType.ReferenceType)
1234+
| CNR(_, Item.ExnCase_, LegitTypeOccurence,_,_,_, m)->
1235+
Some(m, SemanticClassificationType.ReferenceType)
12341236
| CNR(_, Item.ModuleOrNamespaces refs, LegitTypeOccurence,_,_,_, m)when refs|> List.exists(fun x-> x.IsModule)->
12351237
Some(m, SemanticClassificationType.Module)
12361238
| CNR(_,(Item.ActivePatternCase_| Item.UnionCase_| Item.ActivePatternResult_),_,_,_,_, m)->

‎vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,15 @@ module internal Tokenizer =
610610
/// Fix invalid span if it appears to have redundant suffix and prefix.
611611
letfixupSpan(sourceText:SourceText,span:TextSpan):TextSpan=
612612
lettext= sourceText.GetSubText(span).ToString()
613-
match text.LastIndexOf'.'with
614-
|-1|0-> span
615-
| index-> TextSpan(span.Start+ index+1, text.Length- index-1)
613+
// backticked ident
614+
if text.EndsWith"``"then
615+
match text.[..text.Length-3].LastIndexOf"``"with
616+
|-1|0-> span
617+
| index-> TextSpan(span.Start+ index, text.Length- index)
618+
else
619+
match text.LastIndexOf'.'with
620+
|-1|0-> span
621+
| index-> TextSpan(span.Start+ index+1, text.Length- index-1)
616622

617623
letisValidNameForSymbol(lexerSymbolKind:LexerSymbolKind,symbol:FSharpSymbol,name:string):bool=
618624
letdoubleBackTickDelimiter="``"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp