@@ -249,23 +249,28 @@ type TestType() =
249249 member _.memb(?optional:string) = optional
250250 member _.anotherMember(?opt1:int, ?opt2:string) = (opt1, opt2)
251251"""
252+
252253 let ranges = getRanges sourceText
253-
254+
254255 // The parameter name "optional" should be classified as a parameter/local value, not as a type
255256 // After the fix, QuickParse correctly handles the ? prefix and doesn't confuse semantic classification
256- let optionalParamRanges =
257- ranges
258- |> List.filter ( fun item ->
259- let text = sourceText.Substring( item.Range.StartColumn, item.Range.EndColumn - item.Range.StartColumn)
257+ let optionalParamRanges =
258+ ranges
259+ |> List.filter ( fun item ->
260+ let text =
261+ sourceText.Substring( item.Range.StartColumn, item.Range.EndColumn - item.Range.StartColumn)
262+
260263 text = " optional" )
261-
264+
262265 // Verify that we have classification data for "optional"
263266 Assert.True( optionalParamRanges.Length > 0 , " Should have classification data for 'optional' parameter" )
264-
267+
265268 // The first occurrence should be the parameter (not incorrectly classified as a type/namespace)
266269 let firstOptional = optionalParamRanges.[ 0 ]
267- let classificationType = FSharpClassificationTypes.getClassificationTypeName firstOptional.Type
268-
270+
271+ let classificationType =
272+ FSharpClassificationTypes.getClassificationTypeName firstOptional.Type
273+
269274 // Should NOT be classified as a type or namespace
270275 Assert.NotEqual( ClassificationTypeNames.ClassName, classificationType)
271276 Assert.NotEqual( ClassificationTypeNames.NamespaceName, classificationType)
0 commit comments