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

Commit527d6de

Browse files
vasily-kirichenkoKevinRansom
authored andcommitted
colorize struct constructors as value types (dotnet#2531)
1 parent54305cc commit527d6de

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/fsharp/vs/service.fs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,8 +1501,14 @@ type TypeCheckInfo
15011501
Some(m, SemanticClassificationType.ReferenceType)
15021502
| CNR(_,(Item.TypeVar_), LegitTypeOccurence,_,_,_, m)->
15031503
Some(m, SemanticClassificationType.TypeArgument)
1504-
| CNR(_,(Item.UnqualifiedType_| Item.CtorGroup_), LegitTypeOccurence,_,_,_, m)->
1505-
Some(m, SemanticClassificationType.ReferenceType)
1504+
| CNR(_, Item.UnqualifiedType tyconRefs, LegitTypeOccurence,_,_,_, m)->
1505+
if tyconRefs|> List.exists(fun tyconRef-> tyconRef.Deref.IsStructOrEnumTycon)then
1506+
Some(m, SemanticClassificationType.ValueType)
1507+
else Some(m, SemanticClassificationType.ReferenceType)
1508+
| CNR(_, Item.CtorGroup(_, minfos), LegitTypeOccurence,_,_,_, m)->
1509+
if minfos|> List.exists(fun minfo-> isStructTy g minfo.EnclosingType)then
1510+
Some(m, SemanticClassificationType.ValueType)
1511+
else Some(m, SemanticClassificationType.ReferenceType)
15061512
| CNR(_, Item.ModuleOrNamespaces refs, LegitTypeOccurence,_,_,_, m)when refs|> List.exists(fun x-> x.IsModule)->
15071513
Some(m, SemanticClassificationType.ReferenceType)
15081514
| CNR(_,(Item.ActivePatternCase_| Item.UnionCase_| Item.ActivePatternResult_),_,_,_,_, m)->

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp