From 6fe78b88024c1aefe27b0eba82f582a1ebc68afc Mon Sep 17 00:00:00 2001
From: ijklam <43789618+Tangent-90@users.noreply.github.com>
Date: Wed, 26 Feb 2025 21:35:31 +0800
Subject: [PATCH 1/6] override method completion improvement
---
src/Compiler/Service/FSharpCheckerResults.fs | 97 ++++++++---
src/Compiler/Service/FSharpCheckerResults.fsi | 12 +-
src/Compiler/Service/ServiceParsedInputOps.fs | 28 +--
.../Service/ServiceParsedInputOps.fsi | 3 +-
...vice.SurfaceArea.netstandard20.release.bsl | 27 +--
.../Completion/CompletionProvider.fs | 16 +-
.../FSharp.Editor/Options/EditorOptions.fs | 2 +
.../IntelliSenseOptionControl.xaml | 53 +++---
.../FSharp.UIResources/Strings.Designer.cs | 163 +++++++++---------
.../src/FSharp.UIResources/Strings.resx | 3 +
.../src/FSharp.UIResources/xlf/Strings.cs.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.de.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.es.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.fr.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.it.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.ja.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.ko.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.pl.xlf | 5 +
.../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.ru.xlf | 5 +
.../src/FSharp.UIResources/xlf/Strings.tr.xlf | 5 +
.../xlf/Strings.zh-Hans.xlf | 5 +
.../xlf/Strings.zh-Hant.xlf | 5 +
.../CompletionProviderTests.fs | 4 +-
.../FsxCompletionProviderTests.fs | 2 +-
25 files changed, 317 insertions(+), 158 deletions(-)
diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs
index 771ab536ff8..521d7de02aa 100644
--- a/src/Compiler/Service/FSharpCheckerResults.fs
+++ b/src/Compiler/Service/FSharpCheckerResults.fs
@@ -1063,7 +1063,7 @@ type internal TypeCheckInfo
|> Option.defaultValue completions
/// Gets all methods that a type can override, but has not yet done so.
- let GetOverridableMethods pos ctx (typeNameRange: range) spacesBeforeOverrideKeyword hasThis isStatic =
+ let GetOverridableMethods pos ctx (typeNameRange: range) newlineIndentCount hasThis isStatic genBodyForOverridedMeth =
let checkImplementedSlotDeclareType ty slots =
slots
|> Option.map (List.exists (fun (TSlotSig(declaringType = ty2)) -> typeEquiv g ty ty2))
@@ -1111,8 +1111,11 @@ type internal TypeCheckInfo
let (nenv, ad), m = GetBestEnvForPos pos
let denv = nenv.DisplayEnv
+ /// Check if the method is abstract, return "raise (NotImplementedException())" if it is abstract, otherwise return the given body
let checkMethAbstractAndGetImplementBody (meth: MethInfo) implementBody =
- if meth.IsAbstract then
+ if not genBodyForOverridedMeth then
+ String.Empty
+ elif meth.IsAbstract then
if nenv.DisplayEnv.openTopPathsSorted.Force() |> List.contains [ "System" ] then
"raise (NotImplementedException())"
else
@@ -1120,8 +1123,8 @@ type internal TypeCheckInfo
else
implementBody
- let newlineIndent =
- Environment.NewLine + String.make (spacesBeforeOverrideKeyword + 4) ' '
+ let newlineIndentCount = max 1 newlineIndentCount
+ let newlineIndent = Environment.NewLine + String.make newlineIndentCount ' '
let getOverridableMethods superTy (overriddenMethods: MethInfo list) overriddenProperties =
// Do not check a method with same name twice
@@ -1197,12 +1200,6 @@ type internal TypeCheckInfo
let this = if hasThis || prop.IsStatic then String.Empty else "this."
- let getterWithBody =
- if String.IsNullOrWhiteSpace getterWithBody then
- String.Empty
- else
- getterWithBody + newlineIndent
-
let name = $"{prop.DisplayName} with {getter}{keywordAnd}{setter}"
let textInCode =
@@ -1211,6 +1208,7 @@ type internal TypeCheckInfo
+ newlineIndent
+ "with "
+ getterWithBody
+ + (if String.IsNullOrEmpty keywordAnd then String.Empty else newlineIndent)
+ keywordAnd
+ setterWithBody
@@ -1721,7 +1719,8 @@ type internal TypeCheckInfo
filterCtors,
resolveOverloads,
completionContextAtPos: (pos * CompletionContext option) option,
- getAllSymbols: unit -> AssemblySymbol list
+ getAllSymbols: unit -> AssemblySymbol list,
+ genBodyForOverridedMeth
) : (CompletionItem list * DisplayEnv * CompletionContext option * range) option =
let loc =
@@ -1957,8 +1956,21 @@ type internal TypeCheckInfo
getDeclaredItemsNotInRangeOpWithAllSymbols ()
|> Option.bind (FilterRelevantItemsBy getItem2 None IsPatternCandidate)
- | Some(CompletionContext.MethodOverride(ctx, enclosingTypeNameRange, spacesBeforeOverrideKeyword, hasThis, isStatic)) ->
- GetOverridableMethods pos ctx enclosingTypeNameRange spacesBeforeOverrideKeyword hasThis isStatic
+ | Some(CompletionContext.MethodOverride(ctx,
+ enclosingTypeNameRange,
+ spacesBeforeOverrideKeyword,
+ hasThis,
+ isStatic,
+ spacesBeforeEnclosingDefinition)) ->
+ let indent = max 1 (spacesBeforeOverrideKeyword - spacesBeforeEnclosingDefinition)
+ GetOverridableMethods
+ pos
+ ctx
+ enclosingTypeNameRange
+ (spacesBeforeOverrideKeyword + indent)
+ hasThis
+ isStatic
+ genBodyForOverridedMeth
// Other completions
| cc ->
@@ -2025,7 +2037,7 @@ type internal TypeCheckInfo
scope.IsRelativeNameResolvable(cursorPos, plid, symbol.Item)
/// Get the auto-complete items at a location
- member _.GetDeclarations(parseResultsOpt, line, lineStr, partialName, completionContextAtPos, getAllEntities) =
+ member _.GetDeclarations(parseResultsOpt, line, lineStr, partialName, completionContextAtPos, getAllEntities, genBodyForOverridedMeth) =
let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName
DiagnosticsScope.Protect
@@ -2044,7 +2056,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.Yes,
completionContextAtPos,
- getAllEntities
+ getAllEntities,
+ genBodyForOverridedMeth
)
match declItemsOpt with
@@ -2085,7 +2098,7 @@ type internal TypeCheckInfo
DeclarationListInfo.Error msg)
/// Get the symbols for auto-complete items at a location
- member _.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, getAllEntities) =
+ member _.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, getAllEntities, genBodyForOverridedMeth) =
let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName
DiagnosticsScope.Protect
@@ -2104,7 +2117,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.Yes,
None,
- getAllEntities
+ getAllEntities,
+ genBodyForOverridedMeth
)
match declItemsOpt with
@@ -2285,7 +2299,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.Yes,
None,
- (fun () -> [])
+ (fun () -> []),
+ false
)
match declItemsOpt with
@@ -2347,7 +2362,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.No,
None,
- (fun () -> [])
+ (fun () -> []),
+ false
)
match declItemsOpt with
@@ -2393,7 +2409,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.No,
None,
- (fun () -> [])
+ (fun () -> []),
+ false
)
match declItemsOpt with
@@ -2434,7 +2451,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.No,
None,
- (fun () -> [])
+ (fun () -> []),
+ false
)
match declItemsOpt with
@@ -2470,7 +2488,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.Yes,
None,
- (fun () -> [])
+ (fun () -> []),
+ false
)
match declItemsOpt with
@@ -2618,7 +2637,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.Yes,
None,
- (fun () -> [])
+ (fun () -> []),
+ false
)
match declItemsOpt with
@@ -2647,7 +2667,8 @@ type internal TypeCheckInfo
ResolveTypeNamesToCtors,
ResolveOverloads.Yes,
None,
- (fun () -> [])
+ (fun () -> []),
+ false
)
match declItemsOpt with
@@ -3348,20 +3369,40 @@ type FSharpCheckFileResults
| Some(scope, _builderOpt) -> Some scope.TcImports
/// Intellisense autocompletions
- member _.GetDeclarationListInfo(parsedFileResults, line, lineText, partialName, ?getAllEntities, ?completionContextAtPos) =
+ member _.GetDeclarationListInfo
+ (
+ parsedFileResults,
+ line,
+ lineText,
+ partialName,
+ ?getAllEntities,
+ ?completionContextAtPos,
+ ?genBodyForOverridedMeth
+ ) =
let getAllEntities = defaultArg getAllEntities (fun () -> [])
+ let genBodyForOverridedMeth = defaultArg genBodyForOverridedMeth true
match details with
| None -> DeclarationListInfo.Empty
| Some(scope, _builderOpt) ->
- scope.GetDeclarations(parsedFileResults, line, lineText, partialName, completionContextAtPos, getAllEntities)
+ scope.GetDeclarations(
+ parsedFileResults,
+ line,
+ lineText,
+ partialName,
+ completionContextAtPos,
+ getAllEntities,
+ genBodyForOverridedMeth
+ )
- member _.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, ?getAllEntities) =
+ member _.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, ?getAllEntities, ?genBodyForOverridedMeth) =
let getAllEntities = defaultArg getAllEntities (fun () -> [])
+ let genBodyForOverridedMeth = defaultArg genBodyForOverridedMeth true
match details with
| None -> []
- | Some(scope, _builderOpt) -> scope.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, getAllEntities)
+ | Some(scope, _builderOpt) ->
+ scope.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, getAllEntities, genBodyForOverridedMeth)
member _.GetKeywordTooltip(names: string list) =
ToolTipText.ToolTipText
diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi
index 607232f3c92..cb80e8520db 100644
--- a/src/Compiler/Service/FSharpCheckerResults.fsi
+++ b/src/Compiler/Service/FSharpCheckerResults.fsi
@@ -290,13 +290,17 @@ type public FSharpCheckFileResults =
///
/// Completion context for a particular position computed in advance.
///
+ ///
+ /// A switch to determine whether to generate an default implementation body for overridden method when completing.
+ ///
member GetDeclarationListInfo:
parsedFileResults: FSharpParseFileResults option *
line: int *
lineText: string *
partialName: PartialLongName *
?getAllEntities: (unit -> AssemblySymbol list) *
- ?completionContextAtPos: (pos * CompletionContext option) ->
+ ?completionContextAtPos: (pos * CompletionContext option) *
+ ?genBodyForOverridedMeth: bool ->
DeclarationListInfo
/// Get the items for a declaration list in FSharpSymbol format
@@ -317,12 +321,16 @@ type public FSharpCheckFileResults =
///
/// Function that returns all entities from current and referenced assemblies.
///
+ ///
+ /// A switch to determine whether to generate an default implementation body for overridden method when completing.
+ ///
member GetDeclarationListSymbols:
parsedFileResults: FSharpParseFileResults option *
line: int *
lineText: string *
partialName: PartialLongName *
- ?getAllEntities: (unit -> AssemblySymbol list) ->
+ ?getAllEntities: (unit -> AssemblySymbol list) *
+ ?genBodyForOverridedMeth: bool ->
FSharpSymbolUse list list
/// Compute a formatted tooltip for the given keywords
diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs
index 2ed457116b6..374f648947a 100644
--- a/src/Compiler/Service/ServiceParsedInputOps.fs
+++ b/src/Compiler/Service/ServiceParsedInputOps.fs
@@ -118,7 +118,8 @@ type CompletionContext =
enclosingTypeNameRange: range *
spacesBeforeOverrideKeyword: int *
hasThis: bool *
- isStatic: bool
+ isStatic: bool *
+ spacesBeforeEnclosingDefinition: int
type ShortIdent = string
@@ -1543,7 +1544,8 @@ module ParsedInput =
let overrideContext path (mOverride: range) hasThis isStatic isMember =
match path with
- | _ :: SyntaxNode.SynTypeDefn(SynTypeDefn(typeInfo = SynComponentInfo(longId = [ enclosingType ]))) :: _ when
+ | _ :: SyntaxNode.SynTypeDefn(SynTypeDefn(
+ typeInfo = SynComponentInfo(longId = [ enclosingType ]); trivia = { LeadingKeyword = keyword })) :: _ when
not isMember
->
Some(
@@ -1552,12 +1554,13 @@ module ParsedInput =
enclosingType.idRange,
mOverride.StartColumn,
hasThis,
- isStatic
+ isStatic,
+ keyword.Range.StartColumn
)
)
- | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty)) :: SyntaxNode.SynTypeDefn(SynTypeDefn(
+ | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: SyntaxNode.SynTypeDefn(SynTypeDefn(
typeInfo = SynComponentInfo(longId = [ enclosingType ]))) :: _
- | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty)) :: SyntaxNode.SynTypeDefn(SynTypeDefn(
+ | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: SyntaxNode.SynTypeDefn(SynTypeDefn(
typeInfo = SynComponentInfo(longId = [ enclosingType ]))) :: _ ->
let ty =
match ty with
@@ -1570,11 +1573,12 @@ module ParsedInput =
enclosingType.idRange,
mOverride.StartColumn,
hasThis,
- isStatic
+ isStatic,
+ enclosingDefn.Range.StartColumn
)
)
- | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty)) :: (SyntaxNode.SynExpr(SynExpr.ObjExpr _) as expr) :: _
- | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty)) :: (SyntaxNode.SynExpr(SynExpr.ObjExpr _) as expr) :: _ ->
+ | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: (SyntaxNode.SynExpr(SynExpr.ObjExpr _) as expr) :: _
+ | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: (SyntaxNode.SynExpr(SynExpr.ObjExpr _) as expr) :: _ ->
let ty =
match ty with
| SynType.App(typeName = ty) -> ty
@@ -1586,10 +1590,11 @@ module ParsedInput =
ty.Range,
mOverride.StartColumn,
hasThis,
- isStatic
+ isStatic,
+ enclosingDefn.Range.StartColumn
)
)
- | SyntaxNode.SynExpr(SynExpr.ObjExpr(objType = ty)) as expr :: _ ->
+ | SyntaxNode.SynExpr(SynExpr.ObjExpr(objType = ty; newExprRange = newExprRange)) as expr :: _ ->
let ty =
match ty with
| SynType.App(typeName = ty) -> ty
@@ -1601,7 +1606,8 @@ module ParsedInput =
ty.Range,
mOverride.StartColumn,
hasThis,
- isStatic
+ isStatic,
+ newExprRange.StartColumn
)
)
| _ -> Some CompletionContext.Invalid
diff --git a/src/Compiler/Service/ServiceParsedInputOps.fsi b/src/Compiler/Service/ServiceParsedInputOps.fsi
index 427ffda43aa..d99277893d4 100644
--- a/src/Compiler/Service/ServiceParsedInputOps.fsi
+++ b/src/Compiler/Service/ServiceParsedInputOps.fsi
@@ -90,7 +90,8 @@ type public CompletionContext =
enclosingTypeNameRange: range *
spacesBeforeOverrideKeyword: int *
hasThis: bool *
- isStatic: bool
+ isStatic: bool *
+ spacesBeforeEnclosingDefinition: int
type public ModuleKind =
{ IsAutoOpen: bool
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
index fabaa710607..8e92f93f0e1 100755
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
@@ -2066,7 +2066,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.CodeAnalysi
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.CodeAnalysis.FSharpSymbolUse[] GetUsesOfSymbolInFile(FSharp.Compiler.Symbols.FSharpSymbol, Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken])
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Diagnostics.FSharpDiagnostic[] Diagnostics
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Diagnostics.FSharpDiagnostic[] get_Diagnostics()
-FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.DeclarationListInfo GetDeclarationListInfo(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Position,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.EditorServices.CompletionContext]]])
+FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.DeclarationListInfo GetDeclarationListInfo(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Position,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.EditorServices.CompletionContext]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.FindDeclResult GetDeclarationLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.MethodGroup GetMethods(Int32, Int32, System.String, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[System.String]])
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.SemanticClassificationItem[] GetSemanticClassification(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range])
@@ -2079,7 +2079,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Symbols.FSh
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Symbols.FSharpOpenDeclaration[] get_OpenDeclarations()
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Text.Range[] GetFormatSpecifierLocations()
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUsesAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String])
-FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetDeclarationListSymbols(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]])
+FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetDeclarationListSymbols(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean])
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUseAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] GetDisplayContextForPos(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] ImplementationFile
@@ -2830,12 +2830,20 @@ FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 GetHashCod
FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 Tag
FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 get_Tag()
FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: System.String ToString()
+FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId
+FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat
+FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId()
+FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat()
FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData: FSharp.Compiler.Symbols.FSharpType ActualType
FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData: FSharp.Compiler.Symbols.FSharpType get_ActualType()
FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField ImplementationField
FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField SignatureField
FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_ImplementationField()
FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_SignatureField()
+FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId
+FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat
+FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId()
+FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat()
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo ContextInfo
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo get_ContextInfo()
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext
@@ -2851,22 +2859,13 @@ FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo
+FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData
-FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId
-FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat
-FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId()
-FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat()
-FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData
-FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId
-FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat
-FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId()
-FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat()
-FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData
FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity Severity
FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity get_Severity()
@@ -3048,7 +3047,9 @@ FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler
FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.EditorServices.MethodOverrideCompletionContext get_ctx()
FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.Text.Range enclosingTypeNameRange
FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.Text.Range get_enclosingTypeNameRange()
+FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 get_spacesBeforeEnclosingDefinition()
FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 get_spacesBeforeOverrideKeyword()
+FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 spacesBeforeEnclosingDefinition
FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 spacesBeforeOverrideKeyword
FSharp.Compiler.EditorServices.CompletionContext+OpenDeclaration: Boolean get_isOpenType()
FSharp.Compiler.EditorServices.CompletionContext+OpenDeclaration: Boolean isOpenType
@@ -3103,7 +3104,7 @@ FSharp.Compiler.EditorServices.CompletionContext: Boolean get_IsUnionCaseFieldsD
FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext AttributeApplication
FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext Invalid
FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewInherit(FSharp.Compiler.EditorServices.InheritanceContext, System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.String],Microsoft.FSharp.Core.FSharpOption`1[System.String]])
-FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewMethodOverride(FSharp.Compiler.EditorServices.MethodOverrideCompletionContext, FSharp.Compiler.Text.Range, Int32, Boolean, Boolean)
+FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewMethodOverride(FSharp.Compiler.EditorServices.MethodOverrideCompletionContext, FSharp.Compiler.Text.Range, Int32, Boolean, Boolean, Int32)
FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewOpenDeclaration(Boolean)
FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewParameterList(FSharp.Compiler.Text.Position, System.Collections.Generic.HashSet`1[System.String])
FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewPattern(FSharp.Compiler.EditorServices.PatternContext)
diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs
index f43c53b2c0e..b50f99eb751 100644
--- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs
+++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs
@@ -150,7 +150,8 @@ type internal FSharpCompletionProvider
(
document: Document,
caretPosition: int,
- getAllSymbols: FSharpCheckFileResults -> AssemblySymbol array
+ getAllSymbols: FSharpCheckFileResults -> AssemblySymbol array,
+ genBodyForOverridedMeth: bool
) =
cancellableTask {
@@ -189,7 +190,8 @@ type internal FSharpCompletionProvider
line,
partialName,
getAllSymbols,
- (completionContextPos, completionContext)
+ (completionContextPos, completionContext),
+ genBodyForOverridedMeth
)
let results = List()
@@ -353,7 +355,15 @@ type internal FSharpCompletionProvider
else
Array.empty
- let! results = FSharpCompletionProvider.ProvideCompletionsAsyncAux(context.Document, context.Position, getAllSymbols)
+ let genBodyForOverridedMeth = settings.IntelliSense.GenerateBodyForOverridedMethod
+
+ let! results =
+ FSharpCompletionProvider.ProvideCompletionsAsyncAux(
+ context.Document,
+ context.Position,
+ getAllSymbols,
+ genBodyForOverridedMeth
+ )
context.AddItems results
diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
index ef67e6482ba..be38600c42f 100644
--- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
+++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
@@ -24,6 +24,7 @@ type IntelliSenseOptions =
ShowAfterCharIsDeleted: bool
IncludeSymbolsFromUnopenedNamespacesOrModules: bool
EnterKeySetting: EnterKeySetting
+ GenerateBodyForOverridedMethod: bool
}
static member Default =
@@ -32,6 +33,7 @@ type IntelliSenseOptions =
ShowAfterCharIsDeleted = false
IncludeSymbolsFromUnopenedNamespacesOrModules = false
EnterKeySetting = EnterKeySetting.NeverNewline
+ GenerateBodyForOverridedMethod = true
}
[]
diff --git a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml
index dbb7b6bb8fc..330729935a7 100644
--- a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml
+++ b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml
@@ -1,16 +1,18 @@
-
+
-
+
@@ -19,21 +21,32 @@
-
-
-
+
+
+
-
+
+
-
-
-
+
+
+
diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs
index e0244a62086..075abe4d083 100644
--- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs
+++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs
@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
@@ -13,12 +13,12 @@ namespace Microsoft.VisualStudio.FSharp.UIResources {
///
- /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@@ -33,7 +33,7 @@ internal Strings() {
}
///
- /// Returns the cached ResourceManager instance used by this class.
+ /// 返回此类使用的缓存的 ResourceManager 实例。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
@@ -47,8 +47,8 @@ internal Strings() {
}
///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
+ /// 重写当前线程的 CurrentUICulture 属性,对
+ /// 使用此强类型资源类的所有资源查找执行重写。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
@@ -61,7 +61,7 @@ internal Strings() {
}
///
- /// Looks up a localized string similar to Additional performance telemetry (experimental).
+ /// 查找类似 Additional performance telemetry (experimental) 的本地化字符串。
///
public static string AdditionalTelemetry {
get {
@@ -70,7 +70,7 @@ public static string AdditionalTelemetry {
}
///
- /// Looks up a localized string similar to Always place open statements at the top level.
+ /// 查找类似 Always place open statements at the top level 的本地化字符串。
///
public static string Always_place_opens_at_top_level {
get {
@@ -79,7 +79,7 @@ public static string Always_place_opens_at_top_level {
}
///
- /// Looks up a localized string similar to Keep analyzing the entire solution for diagnostics as a low priority background task (requires restart).
+ /// 查找类似 Keep analyzing the entire solution for diagnostics as a low priority background task (requires restart) 的本地化字符串。
///
public static string Analyze_full_solution_on_background {
get {
@@ -88,7 +88,7 @@ public static string Analyze_full_solution_on_background {
}
///
- /// Looks up a localized string similar to Background analysis.
+ /// 查找类似 Background analysis 的本地化字符串。
///
public static string Background_analysis {
get {
@@ -97,7 +97,7 @@ public static string Background_analysis {
}
///
- /// Looks up a localized string similar to Block Structure Guides.
+ /// 查找类似 Block Structure Guides 的本地化字符串。
///
public static string Block_Structure {
get {
@@ -106,7 +106,7 @@ public static string Block_Structure {
}
///
- /// Looks up a localized string similar to Code Fixes.
+ /// 查找类似 Code Fixes 的本地化字符串。
///
public static string Code_Fixes {
get {
@@ -115,7 +115,7 @@ public static string Code_Fixes {
}
///
- /// Looks up a localized string similar to Completion Lists.
+ /// 查找类似 Completion Lists 的本地化字符串。
///
public static string Completion_Lists {
get {
@@ -124,7 +124,7 @@ public static string Completion_Lists {
}
///
- /// Looks up a localized string similar to D_ash underline.
+ /// 查找类似 D_ash underline 的本地化字符串。
///
public static string Dash_underline {
get {
@@ -133,7 +133,7 @@ public static string Dash_underline {
}
///
- /// Looks up a localized string similar to Diagnostics.
+ /// 查找类似 Diagnostics 的本地化字符串。
///
public static string Diagnostics {
get {
@@ -142,7 +142,7 @@ public static string Diagnostics {
}
///
- /// Looks up a localized string similar to D_ot underline.
+ /// 查找类似 D_ot underline 的本地化字符串。
///
public static string Dot_underline {
get {
@@ -151,7 +151,7 @@ public static string Dot_underline {
}
///
- /// Looks up a localized string similar to Keep background symbol keys.
+ /// 查找类似 Keep background symbol keys 的本地化字符串。
///
public static string Enable_Background_ItemKeyStore_And_Semantic_Classification {
get {
@@ -160,7 +160,7 @@ public static string Enable_Background_ItemKeyStore_And_Semantic_Classification
}
///
- /// Looks up a localized string similar to Enable fast find references & rename (experimental).
+ /// 查找类似 Enable fast find references & rename (experimental) 的本地化字符串。
///
public static string Enable_Fast_Find_References {
get {
@@ -169,7 +169,7 @@ public static string Enable_Fast_Find_References {
}
///
- /// Looks up a localized string similar to _Enable in-memory cross project references.
+ /// 查找类似 _Enable in-memory cross project references 的本地化字符串。
///
public static string Enable_in_memory_cross_project_references {
get {
@@ -178,7 +178,7 @@ public static string Enable_in_memory_cross_project_references {
}
///
- /// Looks up a localized string similar to Use live (unsaved) buffers for analysis (restart required).
+ /// 查找类似 Use live (unsaved) buffers for analysis (restart required) 的本地化字符串。
///
public static string Enable_Live_Buffers {
get {
@@ -187,7 +187,7 @@ public static string Enable_Live_Buffers {
}
///
- /// Looks up a localized string similar to Enable parallel reference resolution.
+ /// 查找类似 Enable parallel reference resolution 的本地化字符串。
///
public static string Enable_Parallel_Reference_Resolution {
get {
@@ -196,7 +196,7 @@ public static string Enable_Parallel_Reference_Resolution {
}
///
- /// Looks up a localized string similar to Enable partial type checking.
+ /// 查找类似 Enable partial type checking 的本地化字符串。
///
public static string Enable_partial_type_checking {
get {
@@ -205,7 +205,7 @@ public static string Enable_partial_type_checking {
}
///
- /// Looks up a localized string similar to Enable stale data for IntelliSense features.
+ /// 查找类似 Enable stale data for IntelliSense features 的本地化字符串。
///
public static string Enable_Stale_IntelliSense_Results {
get {
@@ -214,7 +214,7 @@ public static string Enable_Stale_IntelliSense_Results {
}
///
- /// Looks up a localized string similar to Always add new line on enter.
+ /// 查找类似 Always add new line on enter 的本地化字符串。
///
public static string Enter_key_always {
get {
@@ -223,7 +223,7 @@ public static string Enter_key_always {
}
///
- /// Looks up a localized string similar to Never add new line on enter.
+ /// 查找类似 Never add new line on enter 的本地化字符串。
///
public static string Enter_key_never {
get {
@@ -232,7 +232,7 @@ public static string Enter_key_never {
}
///
- /// Looks up a localized string similar to Only add new line on enter after end of fully typed word.
+ /// 查找类似 Only add new line on enter after end of fully typed word 的本地化字符串。
///
public static string Enter_key_only {
get {
@@ -241,7 +241,7 @@ public static string Enter_key_only {
}
///
- /// Looks up a localized string similar to Enter key behavior.
+ /// 查找类似 Enter key behavior 的本地化字符串。
///
public static string Enter_Key_Rule {
get {
@@ -250,7 +250,7 @@ public static string Enter_Key_Rule {
}
///
- /// Looks up a localized string similar to Find References Performance Options.
+ /// 查找类似 Find References Performance Options 的本地化字符串。
///
public static string Find_References_Performance {
get {
@@ -259,7 +259,7 @@ public static string Find_References_Performance {
}
///
- /// Looks up a localized string similar to Re-format indentation on paste (Experimental).
+ /// 查找类似 Re-format indentation on paste (Experimental) 的本地化字符串。
///
public static string Format_on_paste {
get {
@@ -268,7 +268,7 @@ public static string Format_on_paste {
}
///
- /// Looks up a localized string similar to Formatting.
+ /// 查找类似 Formatting 的本地化字符串。
///
public static string Formatting {
get {
@@ -277,7 +277,16 @@ public static string Formatting {
}
///
- /// Looks up a localized string similar to Inline Hints.
+ /// 查找类似 Generate default implementation body for overrided method 的本地化字符串。
+ ///
+ public static string Generate_Body_For_Overrided_Method {
+ get {
+ return ResourceManager.GetString("Generate_Body_For_Overrided_Method", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Inline Hints 的本地化字符串。
///
public static string Inline_Hints {
get {
@@ -286,7 +295,7 @@ public static string Inline_Hints {
}
///
- /// Looks up a localized string similar to IntelliSense Performance Options.
+ /// 查找类似 IntelliSense Performance Options 的本地化字符串。
///
public static string IntelliSense_Performance {
get {
@@ -295,7 +304,7 @@ public static string IntelliSense_Performance {
}
///
- /// Looks up a localized string similar to Keep all background intermediate resolutions (increases memory usage).
+ /// 查找类似 Keep all background intermediate resolutions (increases memory usage) 的本地化字符串。
///
public static string Keep_All_Background_Resolutions {
get {
@@ -304,7 +313,7 @@ public static string Keep_All_Background_Resolutions {
}
///
- /// Looks up a localized string similar to Keep all background symbol uses (increases memory usage).
+ /// 查找类似 Keep all background symbol uses (increases memory usage) 的本地化字符串。
///
public static string Keep_All_Background_Symbol_Uses {
get {
@@ -313,7 +322,7 @@ public static string Keep_All_Background_Symbol_Uses {
}
///
- /// Looks up a localized string similar to Performance.
+ /// 查找类似 Performance 的本地化字符串。
///
public static string Language_Service_Performance {
get {
@@ -322,7 +331,7 @@ public static string Language_Service_Performance {
}
///
- /// Looks up a localized string similar to Language service settings (advanced).
+ /// 查找类似 Language service settings (advanced) 的本地化字符串。
///
public static string Language_Service_Settings {
get {
@@ -331,7 +340,7 @@ public static string Language_Service_Settings {
}
///
- /// Looks up a localized string similar to Live Buffers.
+ /// 查找类似 Live Buffers 的本地化字符串。
///
public static string LiveBuffers {
get {
@@ -340,7 +349,7 @@ public static string LiveBuffers {
}
///
- /// Looks up a localized string similar to Navigation links.
+ /// 查找类似 Navigation links 的本地化字符串。
///
public static string Navigation_links {
get {
@@ -349,7 +358,7 @@ public static string Navigation_links {
}
///
- /// Looks up a localized string similar to Outlining.
+ /// 查找类似 Outlining 的本地化字符串。
///
public static string Outlining {
get {
@@ -358,7 +367,7 @@ public static string Outlining {
}
///
- /// Looks up a localized string similar to Parallelization (requires restart).
+ /// 查找类似 Parallelization (requires restart) 的本地化字符串。
///
public static string Parallelization {
get {
@@ -367,7 +376,7 @@ public static string Parallelization {
}
///
- /// Looks up a localized string similar to Preferred description width in characters.
+ /// 查找类似 Preferred description width in characters 的本地化字符串。
///
public static string Preferred_description_width_in_characters {
get {
@@ -376,7 +385,7 @@ public static string Preferred_description_width_in_characters {
}
///
- /// Looks up a localized string similar to F# Project and Caching Performance Options.
+ /// 查找类似 F# Project and Caching Performance Options 的本地化字符串。
///
public static string Project_Performance {
get {
@@ -385,7 +394,7 @@ public static string Project_Performance {
}
///
- /// Looks up a localized string similar to Remove unnecessary parentheses (experimental, might affect typing performance).
+ /// 查找类似 Remove unnecessary parentheses (experimental, might affect typing performance) 的本地化字符串。
///
public static string Remove_parens_code_fix {
get {
@@ -394,7 +403,7 @@ public static string Remove_parens_code_fix {
}
///
- /// Looks up a localized string similar to Send additional performance telemetry.
+ /// 查找类似 Send additional performance telemetry 的本地化字符串。
///
public static string Send_Additional_Telemetry {
get {
@@ -403,7 +412,7 @@ public static string Send_Additional_Telemetry {
}
///
- /// Looks up a localized string similar to Show s_ymbols in unopened namespaces.
+ /// 查找类似 Show s_ymbols in unopened namespaces 的本地化字符串。
///
public static string Show_all_symbols {
get {
@@ -412,7 +421,7 @@ public static string Show_all_symbols {
}
///
- /// Looks up a localized string similar to Show completion list after a character is _deleted.
+ /// 查找类似 Show completion list after a character is _deleted 的本地化字符串。
///
public static string Show_completion_list_after_a_character_is_deleted {
get {
@@ -421,7 +430,7 @@ public static string Show_completion_list_after_a_character_is_deleted {
}
///
- /// Looks up a localized string similar to _Show completion list after a character is typed.
+ /// 查找类似 _Show completion list after a character is typed 的本地化字符串。
///
public static string Show_completion_list_after_a_character_is_typed {
get {
@@ -430,7 +439,7 @@ public static string Show_completion_list_after_a_character_is_typed {
}
///
- /// Looks up a localized string similar to Show structure guidelines for F# code.
+ /// 查找类似 Show structure guidelines for F# code 的本地化字符串。
///
public static string Show_guides {
get {
@@ -439,7 +448,7 @@ public static string Show_guides {
}
///
- /// Looks up a localized string similar to Display inline parameter name hints (preview).
+ /// 查找类似 Display inline parameter name hints (preview) 的本地化字符串。
///
public static string Show_Inline_Parameter_Name_Hints {
get {
@@ -448,7 +457,7 @@ public static string Show_Inline_Parameter_Name_Hints {
}
///
- /// Looks up a localized string similar to Display inline type hints (preview).
+ /// 查找类似 Display inline type hints (preview) 的本地化字符串。
///
public static string Show_Inline_Type_Hints {
get {
@@ -457,7 +466,7 @@ public static string Show_Inline_Type_Hints {
}
///
- /// Looks up a localized string similar to S_how navigation links as.
+ /// 查找类似 S_how navigation links as 的本地化字符串。
///
public static string Show_navigation_links_as {
get {
@@ -466,7 +475,7 @@ public static string Show_navigation_links_as {
}
///
- /// Looks up a localized string similar to Show outlining and collapsible nodes for F# code.
+ /// 查找类似 Show outlining and collapsible nodes for F# code 的本地化字符串。
///
public static string Show_Outlining {
get {
@@ -475,7 +484,7 @@ public static string Show_Outlining {
}
///
- /// Looks up a localized string similar to Show remarks in Quick Info.
+ /// 查找类似 Show remarks in Quick Info 的本地化字符串。
///
public static string Show_remarks_in_Quick_Info {
get {
@@ -484,7 +493,7 @@ public static string Show_remarks_in_Quick_Info {
}
///
- /// Looks up a localized string similar to Display return type hints (preview).
+ /// 查找类似 Display return type hints (preview) 的本地化字符串。
///
public static string Show_Return_Type_Hints {
get {
@@ -493,7 +502,7 @@ public static string Show_Return_Type_Hints {
}
///
- /// Looks up a localized string similar to Simplify names (remove unnecessary qualifiers).
+ /// 查找类似 Simplify names (remove unnecessary qualifiers) 的本地化字符串。
///
public static string Simplify_name_code_fix {
get {
@@ -502,7 +511,7 @@ public static string Simplify_name_code_fix {
}
///
- /// Looks up a localized string similar to _Solid underline.
+ /// 查找类似 _Solid underline 的本地化字符串。
///
public static string Solid_underline {
get {
@@ -511,7 +520,7 @@ public static string Solid_underline {
}
///
- /// Looks up a localized string similar to Suggest names for unresolved identifiers.
+ /// 查找类似 Suggest names for unresolved identifiers 的本地化字符串。
///
public static string Suggest_names_for_errors_code_fix {
get {
@@ -520,7 +529,7 @@ public static string Suggest_names_for_errors_code_fix {
}
///
- /// Looks up a localized string similar to Text hover.
+ /// 查找类似 Text hover 的本地化字符串。
///
public static string Text_hover {
get {
@@ -529,7 +538,7 @@ public static string Text_hover {
}
///
- /// Looks up a localized string similar to Time until stale results are used (in milliseconds).
+ /// 查找类似 Time until stale results are used (in milliseconds) 的本地化字符串。
///
public static string Time_until_stale_completion {
get {
@@ -538,7 +547,7 @@ public static string Time_until_stale_completion {
}
///
- /// Looks up a localized string similar to In-memory cross-project references store project-level data in memory to allow IDE features to work across projects..
+ /// 查找类似 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. 的本地化字符串。
///
public static string Tooltip_in_memory_cross_project_references {
get {
@@ -547,7 +556,7 @@ public static string Tooltip_in_memory_cross_project_references {
}
///
- /// Looks up a localized string similar to Format signature to the given width by adding line breaks conforming with F# syntax rules. .
+ /// 查找类似 Format signature to the given width by adding line breaks conforming with F# syntax rules. 的本地化字符串。
///
public static string Tooltip_preferred_description_width_in_characters {
get {
@@ -556,7 +565,7 @@ public static string Tooltip_preferred_description_width_in_characters {
}
///
- /// Looks up a localized string similar to Transparent Compiler Cache Factor.
+ /// 查找类似 Transparent Compiler Cache Factor 的本地化字符串。
///
public static string Transparent_Compiler_Cache_Factor {
get {
@@ -565,7 +574,7 @@ public static string Transparent_Compiler_Cache_Factor {
}
///
- /// Looks up a localized string similar to Higher number means more memory will be used for caching. Changing the value wipes cache..
+ /// 查找类似 Higher number means more memory will be used for caching. Changing the value wipes cache. 的本地化字符串。
///
public static string Transparent_Compiler_Cache_Factor_Tooltip {
get {
@@ -574,7 +583,7 @@ public static string Transparent_Compiler_Cache_Factor_Tooltip {
}
///
- /// Looks up a localized string similar to Create new project snapshots from existing ones.
+ /// 查找类似 Create new project snapshots from existing ones 的本地化字符串。
///
public static string Transparent_Compiler_Snapshot_Reuse {
get {
@@ -583,7 +592,7 @@ public static string Transparent_Compiler_Snapshot_Reuse {
}
///
- /// Looks up a localized string similar to Transparent Compiler (experimental).
+ /// 查找类似 Transparent Compiler (experimental) 的本地化字符串。
///
public static string TransparentCompiler {
get {
@@ -592,7 +601,7 @@ public static string TransparentCompiler {
}
///
- /// Looks up a localized string similar to WARNING! Transparent Compiler does not yet support all features and can cause crashes or give incorrect results..
+ /// 查找类似 WARNING! Transparent Compiler does not yet support all features and can cause crashes or give incorrect results. 的本地化字符串。
///
public static string TransparentCompiler_Disclaimer1 {
get {
@@ -601,7 +610,7 @@ public static string TransparentCompiler_Disclaimer1 {
}
///
- /// Looks up a localized string similar to Use at your own risk!.
+ /// 查找类似 Use at your own risk! 的本地化字符串。
///
public static string TransparentCompiler_Disclaimer2 {
get {
@@ -610,7 +619,7 @@ public static string TransparentCompiler_Disclaimer2 {
}
///
- /// Looks up a localized string similar to By checking this you also opt-in for additional performance telemetry.
+ /// 查找类似 By checking this you also opt-in for additional performance telemetry 的本地化字符串。
///
public static string TransparentCompiler_Disclaimer3 {
get {
@@ -619,7 +628,7 @@ public static string TransparentCompiler_Disclaimer3 {
}
///
- /// Looks up a localized string similar to Analyze and suggest fixes for unused values.
+ /// 查找类似 Analyze and suggest fixes for unused values 的本地化字符串。
///
public static string Unused_declaration_code_fix {
get {
@@ -628,7 +637,7 @@ public static string Unused_declaration_code_fix {
}
///
- /// Looks up a localized string similar to Remove unused open statements.
+ /// 查找类似 Remove unused open statements 的本地化字符串。
///
public static string Unused_opens_code_fix {
get {
@@ -637,7 +646,7 @@ public static string Unused_opens_code_fix {
}
///
- /// Looks up a localized string similar to Use Transparent Compiler (restart required).
+ /// 查找类似 Use Transparent Compiler (restart required) 的本地化字符串。
///
public static string Use_Transparent_Compiler {
get {
diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx
index 61b3bab1750..88860d9ce66 100644
--- a/vsintegration/src/FSharp.UIResources/Strings.resx
+++ b/vsintegration/src/FSharp.UIResources/Strings.resx
@@ -312,4 +312,7 @@
By checking this you also opt-in for additional performance telemetry
+
+ Generate default implementation body for overrided method
+
\ No newline at end of file
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf
index 0c938e3f447..bfb58172dfc 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf
@@ -52,6 +52,11 @@
Formátování
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Vložené nápovědy
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf
index 99bac691cac..0cf08dd0c92 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf
@@ -52,6 +52,11 @@
Formatierung
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Inlinehinweise
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf
index 5ae03505500..612bc3f1f2a 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf
@@ -52,6 +52,11 @@
Formato
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Sugerencias insertadas
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf
index 283e9d5d0f8..b54fc5f57bd 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf
@@ -52,6 +52,11 @@
Mise en forme
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Indicateurs inline
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf
index 9c534e8f8dd..764c0ff6c32 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf
@@ -52,6 +52,11 @@
Formattazione
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Suggerimenti inline
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf
index 0e0bb91c628..3eb804f79f5 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf
@@ -52,6 +52,11 @@
書式設定
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
インラインのヒント
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf
index 0d92ba2bb3a..81f6784929f 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf
@@ -52,6 +52,11 @@
서식
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
인라인 힌트
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf
index 16ab9bfc3a1..73858549bc6 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf
@@ -52,6 +52,11 @@
Formatowanie
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Wskazówki w tekście
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf
index 82976646315..8dca5564d7d 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf
@@ -52,6 +52,11 @@
Formatação
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Dicas Embutidas
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf
index 737584669c1..3a2466a4500 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf
@@ -52,6 +52,11 @@
Форматирование
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Встроенные подсказки
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf
index d6763de0ed5..ceb4037ad29 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf
@@ -52,6 +52,11 @@
Biçimlendirme
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
Satır İçi İpuçları
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf
index 917893a6b9c..47f9185c5ba 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf
@@ -52,6 +52,11 @@
格式设置
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
内联提示
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf
index 0eeef704704..d4fb7d576e8 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf
@@ -52,6 +52,11 @@
格式化
+
+ Generate default implementation body for overrided method
+ Generate default implementation body for overrided method
+
+
Inline Hints
內嵌提示
diff --git a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
index d8e92581f10..94e8bb1c092 100644
--- a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
+++ b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
@@ -34,7 +34,7 @@ module CompletionProviderTests =
let results =
let task =
- FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]))
+ FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]), false)
|> CancellableTask.start CancellationToken.None
task.Result |> Seq.map (fun result -> result.DisplayText)
@@ -82,7 +82,7 @@ module CompletionProviderTests =
let actual =
let task =
- FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]))
+ FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]), false)
|> CancellableTask.start CancellationToken.None
task.Result
diff --git a/vsintegration/tests/FSharp.Editor.Tests/FsxCompletionProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/FsxCompletionProviderTests.fs
index 1b633c973d0..eac0c3f6e52 100644
--- a/vsintegration/tests/FSharp.Editor.Tests/FsxCompletionProviderTests.fs
+++ b/vsintegration/tests/FSharp.Editor.Tests/FsxCompletionProviderTests.fs
@@ -32,7 +32,7 @@ type Worker() =
let actual =
let x =
- FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]))
+ FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]), false)
|> CancellableTask.start CancellationToken.None
x.Result
From f6cc69eb4db41455ccbf82160623559b6c49380c Mon Sep 17 00:00:00 2001
From: ijklam <43789618+Tangent-90@users.noreply.github.com>
Date: Wed, 26 Feb 2025 22:12:36 +0800
Subject: [PATCH 2/6] release note; fix typo
---
.../.FSharp.Compiler.Service/9.0.300.md | 3 ++
docs/release-notes/.VisualStudio/17.14.md | 9 ++++
src/Compiler/Service/FSharpCheckerResults.fs | 43 ++++++++++++-------
src/Compiler/Service/FSharpCheckerResults.fsi | 8 ++--
.../Completion/CompletionProvider.fs | 8 ++--
.../FSharp.Editor/Options/EditorOptions.fs | 4 +-
.../IntelliSenseOptionControl.xaml | 6 +--
.../FSharp.UIResources/Strings.Designer.cs | 4 +-
.../src/FSharp.UIResources/Strings.resx | 4 +-
.../src/FSharp.UIResources/xlf/Strings.cs.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.de.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.es.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.fr.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.it.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.ja.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.ko.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.pl.xlf | 6 +--
.../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.ru.xlf | 6 +--
.../src/FSharp.UIResources/xlf/Strings.tr.xlf | 6 +--
.../xlf/Strings.zh-Hans.xlf | 6 +--
.../xlf/Strings.zh-Hant.xlf | 6 +--
22 files changed, 96 insertions(+), 71 deletions(-)
create mode 100644 docs/release-notes/.VisualStudio/17.14.md
diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
index 1c78cff8fe9..47fb8555bf1 100644
--- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
+++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
@@ -20,6 +20,8 @@
* Nullness warnings are issued for signature<>implementation conformance ([PR #18186](https://github.com/dotnet/fsharp/pull/18186))
* Symbols: Add FSharpAssembly.IsFSharp ([PR #18290](https://github.com/dotnet/fsharp/pull/18290))
* Type parameter constraint `null` in generic code will now automatically imply `not struct` ([Issue #18320](https://github.com/dotnet/fsharp/issues/18320), [PR #18323](https://github.com/dotnet/fsharp/pull/18323))
+* Add a switch to determine whether to generate an default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341)
+
### Changed
@@ -29,6 +31,7 @@
* Added nullability annotations to `.Using` builder method for `async`, `task` and compiler-internal builders ([PR #18292](https://github.com/dotnet/fsharp/pull/18292))
* Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330))
* Warning for "useless null handling" works with piped syntax constructs now ([PR #18331](https://github.com/dotnet/fsharp/pull/18331))
+* Make indent in generated overriden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341))
### Breaking Changes
* Struct unions with overlapping fields now generate mappings needed for reading via reflection ([Issue #18121](https://github.com/dotnet/fsharp/issues/17797), [PR #18274](https://github.com/dotnet/fsharp/pull/17877))
diff --git a/docs/release-notes/.VisualStudio/17.14.md b/docs/release-notes/.VisualStudio/17.14.md
new file mode 100644
index 00000000000..0bfaf98fb8b
--- /dev/null
+++ b/docs/release-notes/.VisualStudio/17.14.md
@@ -0,0 +1,9 @@
+### Fixed
+
+### Added
+* Add a switch to determine whether to generate an default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341)
+
+### Changed
+* Make indent in generated overriden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341))
+
+### Breaking Changes
diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs
index 521d7de02aa..8cb27875075 100644
--- a/src/Compiler/Service/FSharpCheckerResults.fs
+++ b/src/Compiler/Service/FSharpCheckerResults.fs
@@ -1063,7 +1063,7 @@ type internal TypeCheckInfo
|> Option.defaultValue completions
/// Gets all methods that a type can override, but has not yet done so.
- let GetOverridableMethods pos ctx (typeNameRange: range) newlineIndentCount hasThis isStatic genBodyForOverridedMeth =
+ let GetOverridableMethods pos ctx (typeNameRange: range) newlineIndentCount hasThis isStatic genBodyForOverriddenMeth =
let checkImplementedSlotDeclareType ty slots =
slots
|> Option.map (List.exists (fun (TSlotSig(declaringType = ty2)) -> typeEquiv g ty ty2))
@@ -1113,7 +1113,7 @@ type internal TypeCheckInfo
/// Check if the method is abstract, return "raise (NotImplementedException())" if it is abstract, otherwise return the given body
let checkMethAbstractAndGetImplementBody (meth: MethInfo) implementBody =
- if not genBodyForOverridedMeth then
+ if not genBodyForOverriddenMeth then
String.Empty
elif meth.IsAbstract then
if nenv.DisplayEnv.openTopPathsSorted.Force() |> List.contains [ "System" ] then
@@ -1208,7 +1208,10 @@ type internal TypeCheckInfo
+ newlineIndent
+ "with "
+ getterWithBody
- + (if String.IsNullOrEmpty keywordAnd then String.Empty else newlineIndent)
+ + (if String.IsNullOrEmpty keywordAnd then
+ String.Empty
+ else
+ newlineIndent)
+ keywordAnd
+ setterWithBody
@@ -1720,7 +1723,7 @@ type internal TypeCheckInfo
resolveOverloads,
completionContextAtPos: (pos * CompletionContext option) option,
getAllSymbols: unit -> AssemblySymbol list,
- genBodyForOverridedMeth
+ genBodyForOverriddenMeth
) : (CompletionItem list * DisplayEnv * CompletionContext option * range) option =
let loc =
@@ -1963,6 +1966,7 @@ type internal TypeCheckInfo
isStatic,
spacesBeforeEnclosingDefinition)) ->
let indent = max 1 (spacesBeforeOverrideKeyword - spacesBeforeEnclosingDefinition)
+
GetOverridableMethods
pos
ctx
@@ -1970,7 +1974,7 @@ type internal TypeCheckInfo
(spacesBeforeOverrideKeyword + indent)
hasThis
isStatic
- genBodyForOverridedMeth
+ genBodyForOverriddenMeth
// Other completions
| cc ->
@@ -2037,7 +2041,16 @@ type internal TypeCheckInfo
scope.IsRelativeNameResolvable(cursorPos, plid, symbol.Item)
/// Get the auto-complete items at a location
- member _.GetDeclarations(parseResultsOpt, line, lineStr, partialName, completionContextAtPos, getAllEntities, genBodyForOverridedMeth) =
+ member _.GetDeclarations
+ (
+ parseResultsOpt,
+ line,
+ lineStr,
+ partialName,
+ completionContextAtPos,
+ getAllEntities,
+ genBodyForOverriddenMeth
+ ) =
let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName
DiagnosticsScope.Protect
@@ -2057,7 +2070,7 @@ type internal TypeCheckInfo
ResolveOverloads.Yes,
completionContextAtPos,
getAllEntities,
- genBodyForOverridedMeth
+ genBodyForOverriddenMeth
)
match declItemsOpt with
@@ -2098,7 +2111,7 @@ type internal TypeCheckInfo
DeclarationListInfo.Error msg)
/// Get the symbols for auto-complete items at a location
- member _.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, getAllEntities, genBodyForOverridedMeth) =
+ member _.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, getAllEntities, genBodyForOverriddenMeth) =
let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName
DiagnosticsScope.Protect
@@ -2118,7 +2131,7 @@ type internal TypeCheckInfo
ResolveOverloads.Yes,
None,
getAllEntities,
- genBodyForOverridedMeth
+ genBodyForOverriddenMeth
)
match declItemsOpt with
@@ -3377,10 +3390,10 @@ type FSharpCheckFileResults
partialName,
?getAllEntities,
?completionContextAtPos,
- ?genBodyForOverridedMeth
+ ?genBodyForOverriddenMeth
) =
let getAllEntities = defaultArg getAllEntities (fun () -> [])
- let genBodyForOverridedMeth = defaultArg genBodyForOverridedMeth true
+ let genBodyForOverriddenMeth = defaultArg genBodyForOverriddenMeth true
match details with
| None -> DeclarationListInfo.Empty
@@ -3392,17 +3405,17 @@ type FSharpCheckFileResults
partialName,
completionContextAtPos,
getAllEntities,
- genBodyForOverridedMeth
+ genBodyForOverriddenMeth
)
- member _.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, ?getAllEntities, ?genBodyForOverridedMeth) =
+ member _.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, ?getAllEntities, ?genBodyForOverriddenMeth) =
let getAllEntities = defaultArg getAllEntities (fun () -> [])
- let genBodyForOverridedMeth = defaultArg genBodyForOverridedMeth true
+ let genBodyForOverriddenMeth = defaultArg genBodyForOverriddenMeth true
match details with
| None -> []
| Some(scope, _builderOpt) ->
- scope.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, getAllEntities, genBodyForOverridedMeth)
+ scope.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, getAllEntities, genBodyForOverriddenMeth)
member _.GetKeywordTooltip(names: string list) =
ToolTipText.ToolTipText
diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi
index cb80e8520db..c80371d2d27 100644
--- a/src/Compiler/Service/FSharpCheckerResults.fsi
+++ b/src/Compiler/Service/FSharpCheckerResults.fsi
@@ -290,7 +290,7 @@ type public FSharpCheckFileResults =
///
/// Completion context for a particular position computed in advance.
///
- ///
+ ///
/// A switch to determine whether to generate an default implementation body for overridden method when completing.
///
member GetDeclarationListInfo:
@@ -300,7 +300,7 @@ type public FSharpCheckFileResults =
partialName: PartialLongName *
?getAllEntities: (unit -> AssemblySymbol list) *
?completionContextAtPos: (pos * CompletionContext option) *
- ?genBodyForOverridedMeth: bool ->
+ ?genBodyForOverriddenMeth: bool ->
DeclarationListInfo
/// Get the items for a declaration list in FSharpSymbol format
@@ -321,7 +321,7 @@ type public FSharpCheckFileResults =
///
/// Function that returns all entities from current and referenced assemblies.
///
- ///
+ ///
/// A switch to determine whether to generate an default implementation body for overridden method when completing.
///
member GetDeclarationListSymbols:
@@ -330,7 +330,7 @@ type public FSharpCheckFileResults =
lineText: string *
partialName: PartialLongName *
?getAllEntities: (unit -> AssemblySymbol list) *
- ?genBodyForOverridedMeth: bool ->
+ ?genBodyForOverriddenMeth: bool ->
FSharpSymbolUse list list
/// Compute a formatted tooltip for the given keywords
diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs
index b50f99eb751..2c583555cb3 100644
--- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs
+++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs
@@ -151,7 +151,7 @@ type internal FSharpCompletionProvider
document: Document,
caretPosition: int,
getAllSymbols: FSharpCheckFileResults -> AssemblySymbol array,
- genBodyForOverridedMeth: bool
+ genBodyForOverriddenMeth: bool
) =
cancellableTask {
@@ -191,7 +191,7 @@ type internal FSharpCompletionProvider
partialName,
getAllSymbols,
(completionContextPos, completionContext),
- genBodyForOverridedMeth
+ genBodyForOverriddenMeth
)
let results = List()
@@ -355,14 +355,14 @@ type internal FSharpCompletionProvider
else
Array.empty
- let genBodyForOverridedMeth = settings.IntelliSense.GenerateBodyForOverridedMethod
+ let genBodyForOverriddenMeth = settings.IntelliSense.GenerateBodyForOverriddenMethod
let! results =
FSharpCompletionProvider.ProvideCompletionsAsyncAux(
context.Document,
context.Position,
getAllSymbols,
- genBodyForOverridedMeth
+ genBodyForOverriddenMeth
)
context.AddItems results
diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
index be38600c42f..efc068386ca 100644
--- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
+++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
@@ -24,7 +24,7 @@ type IntelliSenseOptions =
ShowAfterCharIsDeleted: bool
IncludeSymbolsFromUnopenedNamespacesOrModules: bool
EnterKeySetting: EnterKeySetting
- GenerateBodyForOverridedMethod: bool
+ GenerateBodyForOverriddenMethod: bool
}
static member Default =
@@ -33,7 +33,7 @@ type IntelliSenseOptions =
ShowAfterCharIsDeleted = false
IncludeSymbolsFromUnopenedNamespacesOrModules = false
EnterKeySetting = EnterKeySetting.NeverNewline
- GenerateBodyForOverridedMethod = true
+ GenerateBodyForOverriddenMethod = true
}
[]
diff --git a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml
index 330729935a7..ecd097b2941 100644
--- a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml
+++ b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml
@@ -37,9 +37,9 @@
Content="{x:Static local:Strings.Show_all_symbols}"
IsChecked="{Binding IncludeSymbolsFromUnopenedNamespacesOrModules}" />
+ x:Name="generateBodyForOverriddenMethod"
+ Content="{x:Static local:Strings.Generate_Body_For_Overridden_Method}"
+ IsChecked="{Binding GenerateBodyForOverriddenMethod}" />
diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs
index 075abe4d083..b6087aa8952 100644
--- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs
+++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs
@@ -279,9 +279,9 @@ public static string Formatting {
///
/// 查找类似 Generate default implementation body for overrided method 的本地化字符串。
///
- public static string Generate_Body_For_Overrided_Method {
+ public static string Generate_Body_For_Overridden_Method {
get {
- return ResourceManager.GetString("Generate_Body_For_Overrided_Method", resourceCulture);
+ return ResourceManager.GetString("Generate_Body_For_Overridden_Method", resourceCulture);
}
}
diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx
index 88860d9ce66..00c8cb82360 100644
--- a/vsintegration/src/FSharp.UIResources/Strings.resx
+++ b/vsintegration/src/FSharp.UIResources/Strings.resx
@@ -312,7 +312,7 @@
By checking this you also opt-in for additional performance telemetry
-
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
\ No newline at end of file
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf
index bfb58172dfc..9d7aae398d5 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf
@@ -52,9 +52,9 @@
Formátování
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf
index 0cf08dd0c92..fc8fa182849 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf
@@ -52,9 +52,9 @@
Formatierung
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf
index 612bc3f1f2a..2d0d091cfad 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf
@@ -52,9 +52,9 @@
Formato
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf
index b54fc5f57bd..e1f1ecca5c1 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf
@@ -52,9 +52,9 @@
Mise en forme
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf
index 764c0ff6c32..816c3395e06 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf
@@ -52,9 +52,9 @@
Formattazione
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf
index 3eb804f79f5..5247c0cc870 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf
@@ -52,9 +52,9 @@
書式設定
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf
index 81f6784929f..421c91f4c38 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf
@@ -52,9 +52,9 @@
서식
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf
index 73858549bc6..9e31b9d72e6 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf
@@ -52,9 +52,9 @@
Formatowanie
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf
index 8dca5564d7d..28c59366359 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf
@@ -52,9 +52,9 @@
Formatação
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf
index 3a2466a4500..143cd4e4bed 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf
@@ -52,9 +52,9 @@
Форматирование
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf
index ceb4037ad29..cf9ba4b6834 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf
@@ -52,9 +52,9 @@
Biçimlendirme
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf
index 47f9185c5ba..2a43ae60eb2 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf
@@ -52,9 +52,9 @@
格式设置
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf
index d4fb7d576e8..9b1459d5e43 100644
--- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf
+++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf
@@ -52,9 +52,9 @@
格式化
-
- Generate default implementation body for overrided method
- Generate default implementation body for overrided method
+
+ Generate default implementation body for overridden method
+ Generate default implementation body for overridden method
From 7d8c6e251e0d4cb7af0430664978f9b6004e8876 Mon Sep 17 00:00:00 2001
From: ijklam <43789618+Tangent-90@users.noreply.github.com>
Date: Thu, 27 Feb 2025 07:21:37 +0800
Subject: [PATCH 3/6] update baseline
---
.../ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl | 2 +-
.../ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl | 4 ++--
.../ilverify_FSharp.Compiler.Service_Release_net9.0.bsl | 2 +-
...lverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl
index 4f429d04961..5a935c94627 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl
@@ -23,7 +23,7 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-802::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack.
[IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type.
-[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack.
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl
index 2ec0116a1af..769a714225a 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl
@@ -31,10 +31,10 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-802::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack.
[IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type.
-[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1423-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack.
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
index 48210dddd5c..69cf903c3b6 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
@@ -22,7 +22,7 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-846::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack.
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl
index 2df2cf0fbd9..fafefeaba97 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl
@@ -30,10 +30,10 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-846::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1423-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack.
From 2cfc9f4597b91706c7331e80f1a747e04787f683 Mon Sep 17 00:00:00 2001
From: ijklam <43789618+Tangent-90@users.noreply.github.com>
Date: Thu, 6 Mar 2025 20:48:12 +0800
Subject: [PATCH 4/6] fix typo; add tests
---
.../.FSharp.Compiler.Service/9.0.300.md | 4 +-
docs/release-notes/.VisualStudio/17.14.md | 4 +-
src/Compiler/Service/FSharpCheckerResults.fsi | 4 +-
.../CompletionProviderTests.fs | 73 +++++++++++++++++++
4 files changed, 79 insertions(+), 6 deletions(-)
diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
index 1c3450dca8c..8e78bdeb77a 100644
--- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
+++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
@@ -21,7 +21,7 @@
* Nullness warnings are issued for signature<>implementation conformance ([PR #18186](https://github.com/dotnet/fsharp/pull/18186))
* Symbols: Add FSharpAssembly.IsFSharp ([PR #18290](https://github.com/dotnet/fsharp/pull/18290))
* Type parameter constraint `null` in generic code will now automatically imply `not struct` ([Issue #18320](https://github.com/dotnet/fsharp/issues/18320), [PR #18323](https://github.com/dotnet/fsharp/pull/18323))
-* Add a switch to determine whether to generate an default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341)
+* Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341)
### Changed
@@ -32,7 +32,7 @@
* Added nullability annotations to `.Using` builder method for `async`, `task` and compiler-internal builders ([PR #18292](https://github.com/dotnet/fsharp/pull/18292))
* Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330))
* Warning for "useless null handling" works with piped syntax constructs now ([PR #18331](https://github.com/dotnet/fsharp/pull/18331))
-* Make indent in generated overriden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341))
+* Make indent in generated overridden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341))
### Breaking Changes
* Struct unions with overlapping fields now generate mappings needed for reading via reflection ([Issue #18121](https://github.com/dotnet/fsharp/issues/17797), [PR #18274](https://github.com/dotnet/fsharp/pull/17877))
diff --git a/docs/release-notes/.VisualStudio/17.14.md b/docs/release-notes/.VisualStudio/17.14.md
index 0bfaf98fb8b..db5d628bb0c 100644
--- a/docs/release-notes/.VisualStudio/17.14.md
+++ b/docs/release-notes/.VisualStudio/17.14.md
@@ -1,9 +1,9 @@
### Fixed
### Added
-* Add a switch to determine whether to generate an default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341)
+* Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341)
### Changed
-* Make indent in generated overriden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341))
+* Make indent in generated overridden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341))
### Breaking Changes
diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi
index c80371d2d27..cbc5ecc5f1b 100644
--- a/src/Compiler/Service/FSharpCheckerResults.fsi
+++ b/src/Compiler/Service/FSharpCheckerResults.fsi
@@ -291,7 +291,7 @@ type public FSharpCheckFileResults =
/// Completion context for a particular position computed in advance.
///
///
- /// A switch to determine whether to generate an default implementation body for overridden method when completing.
+ /// A switch to determine whether to generate a default implementation body for overridden method when completing.
///
member GetDeclarationListInfo:
parsedFileResults: FSharpParseFileResults option *
@@ -322,7 +322,7 @@ type public FSharpCheckFileResults =
/// Function that returns all entities from current and referenced assemblies.
///
///
- /// A switch to determine whether to generate an default implementation body for overridden method when completing.
+ /// A switch to determine whether to generate a default implementation body for overridden method when completing.
///
member GetDeclarationListSymbols:
parsedFileResults: FSharpParseFileResults option *
diff --git a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
index 94e8bb1c092..1dc9b5b167d 100644
--- a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
+++ b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
@@ -102,6 +102,39 @@ module CompletionProviderTests =
let VerifyCompletionListExactly (fileContents: string, marker: string, expected: string list) =
VerifyCompletionListExactlyWithOptions(fileContents, marker, expected, [||])
+ /// Verify completion code. Only verify the expected completion items
+ let VerifyCompletionCode (genBodyForOverriddenMeth, fileContents: string, marker: string, expected: Map) =
+ let getNameInCode (item : CompletionItem) =
+ match item.Properties.TryGetValue "NameInCode" with
+ | true, x -> x
+ | _ -> item.DisplayText
+
+ let caretPosition = fileContents.IndexOf(marker) + marker.Length
+
+ let document =
+ RoslynTestHelpers.CreateSolution(fileContents, extraFSharpProjectOtherOptions = [||])
+ |> RoslynTestHelpers.GetSingleDocument
+
+ let actual =
+ let task =
+ FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]), genBodyForOverriddenMeth)
+ |> CancellableTask.start CancellationToken.None
+
+ task.Result
+ |> Seq.toList
+ |> List.choose (fun x ->
+ if expected.ContainsKey x.DisplayText then
+ Some(x.DisplayText, getNameInCode x)
+ else None)
+ |> Map.ofList
+
+ if actual <> expected then
+ failwithf
+ "Expected:\n%s,\nbut was:\n%s\nactual with DisplayText:\n%s"
+ (String.Join("\n", expected.Values |> Seq.map (sprintf "\"%s\"")))
+ (String.Join("\n", actual.Values |> Seq.map (sprintf "\"%s\"")))
+ (String.Join("\n", actual |> Seq.map (fun (KeyValue(fst, snd)) -> sprintf "%s => %s" fst snd)))
+
let VerifyNoCompletionList (fileContents: string, marker: string) =
VerifyCompletionListExactly(fileContents, marker, [])
@@ -2095,3 +2128,43 @@ Ops.()
VerifyCompletionList(fileContents, "Ops.Foo.(", [], [ "|>>"; "(|>>)" ])
VerifyCompletionList(fileContents, "Ops.(", [], [ "|>>"; "(|>>)" ])
+
+ []
+ let ``Check code generation for completion to overridable slots`` () =
+ let fileContents =
+ """
+let _ =
+ { new System.IO.Stream() with
+ member x.
+ }
+"""
+
+ let nl = Environment.NewLine
+ let toCheckCompletionItems = [
+ "CanRead with get (): bool"
+ "Position with get (): int64 and set (value: int64)"
+ "ToString (): string"
+ ]
+
+ VerifyCompletionCode(
+ true,
+ fileContents,
+ "member x.",
+ List.zip toCheckCompletionItems [
+ $"CanRead{nl} with get (): bool = raise (System.NotImplementedException())"
+ $"Position{nl} with get (): int64 = raise (System.NotImplementedException()){nl} and set (value: int64) = raise (System.NotImplementedException())"
+ $"ToString (): string = {nl} base.ToString()"
+ ] |> Map.ofList
+ )
+
+ VerifyCompletionCode(
+ false,
+ fileContents,
+ "member x.",
+ List.zip toCheckCompletionItems [
+ $"CanRead{nl} with get (): bool = "
+ $"Position{nl} with get (): int64 = {nl} and set (value: int64) = "
+ $"ToString (): string = {nl} "
+ ] |> Map.ofList
+ )
+
From 2d5df05574a7b60704cdcfd2e70e3ac8e8d122a0 Mon Sep 17 00:00:00 2001
From: ijklam <43789618+Tangent-90@users.noreply.github.com>
Date: Thu, 6 Mar 2025 20:57:12 +0800
Subject: [PATCH 5/6] fmt
---
.../CompletionProviderTests.fs | 38 +++++++++++--------
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
index 1dc9b5b167d..4377253d1ad 100644
--- a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
+++ b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
@@ -104,7 +104,7 @@ module CompletionProviderTests =
/// Verify completion code. Only verify the expected completion items
let VerifyCompletionCode (genBodyForOverriddenMeth, fileContents: string, marker: string, expected: Map) =
- let getNameInCode (item : CompletionItem) =
+ let getNameInCode (item: CompletionItem) =
match item.Properties.TryGetValue "NameInCode" with
| true, x -> x
| _ -> item.DisplayText
@@ -125,7 +125,8 @@ module CompletionProviderTests =
|> List.choose (fun x ->
if expected.ContainsKey x.DisplayText then
Some(x.DisplayText, getNameInCode x)
- else None)
+ else
+ None)
|> Map.ofList
if actual <> expected then
@@ -2128,7 +2129,7 @@ Ops.()
VerifyCompletionList(fileContents, "Ops.Foo.(", [], [ "|>>"; "(|>>)" ])
VerifyCompletionList(fileContents, "Ops.(", [], [ "|>>"; "(|>>)" ])
-
+
[]
let ``Check code generation for completion to overridable slots`` () =
let fileContents =
@@ -2140,7 +2141,9 @@ let _ =
"""
let nl = Environment.NewLine
- let toCheckCompletionItems = [
+
+ let toCheckCompletionItems =
+ [
"CanRead with get (): bool"
"Position with get (): int64 and set (value: int64)"
"ToString (): string"
@@ -2150,21 +2153,26 @@ let _ =
true,
fileContents,
"member x.",
- List.zip toCheckCompletionItems [
- $"CanRead{nl} with get (): bool = raise (System.NotImplementedException())"
- $"Position{nl} with get (): int64 = raise (System.NotImplementedException()){nl} and set (value: int64) = raise (System.NotImplementedException())"
- $"ToString (): string = {nl} base.ToString()"
- ] |> Map.ofList
+ List.zip
+ toCheckCompletionItems
+ [
+ $"CanRead{nl} with get (): bool = raise (System.NotImplementedException())"
+ $"Position{nl} with get (): int64 = raise (System.NotImplementedException()){nl} and set (value: int64) = raise (System.NotImplementedException())"
+ $"ToString (): string = {nl} base.ToString()"
+ ]
+ |> Map.ofList
)
VerifyCompletionCode(
false,
fileContents,
"member x.",
- List.zip toCheckCompletionItems [
- $"CanRead{nl} with get (): bool = "
- $"Position{nl} with get (): int64 = {nl} and set (value: int64) = "
- $"ToString (): string = {nl} "
- ] |> Map.ofList
+ List.zip
+ toCheckCompletionItems
+ [
+ $"CanRead{nl} with get (): bool = "
+ $"Position{nl} with get (): int64 = {nl} and set (value: int64) = "
+ $"ToString (): string = {nl} "
+ ]
+ |> Map.ofList
)
-
From f6e019fb10ff99f9d7297cd17d6a540381cf60dc Mon Sep 17 00:00:00 2001
From: ijklam <43789618+Tangent-90@users.noreply.github.com>
Date: Thu, 13 Mar 2025 20:45:27 +0800
Subject: [PATCH 6/6] baseline
---
.../ilverify_FSharp.Compiler.Service_Release_net9.0.bsl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
index 853566a3c47..6a9770727aa 100644
--- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
+++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl
@@ -22,7 +22,7 @@
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack.
-[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack.
+[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack.
[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack.