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 26346c6b264..5f722b11a12 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -26,6 +26,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 a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) + ### Changed @@ -35,6 +37,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 overridden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341)) * Adjust caller info attribute error message range ([PR #18388](https://github.com/dotnet/fsharp/pull/18388)) ### Breaking Changes diff --git a/docs/release-notes/.VisualStudio/17.14.md b/docs/release-notes/.VisualStudio/17.14.md new file mode 100644 index 00000000000..db5d628bb0c --- /dev/null +++ b/docs/release-notes/.VisualStudio/17.14.md @@ -0,0 +1,9 @@ +### Fixed + +### Added +* 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 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.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 771ab536ff8..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) spacesBeforeOverrideKeyword hasThis isStatic = + 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)) @@ -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 genBodyForOverriddenMeth 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,10 @@ type internal TypeCheckInfo + newlineIndent + "with " + getterWithBody + + (if String.IsNullOrEmpty keywordAnd then + String.Empty + else + newlineIndent) + keywordAnd + setterWithBody @@ -1721,7 +1722,8 @@ type internal TypeCheckInfo filterCtors, resolveOverloads, completionContextAtPos: (pos * CompletionContext option) option, - getAllSymbols: unit -> AssemblySymbol list + getAllSymbols: unit -> AssemblySymbol list, + genBodyForOverriddenMeth ) : (CompletionItem list * DisplayEnv * CompletionContext option * range) option = let loc = @@ -1957,8 +1959,22 @@ 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 + genBodyForOverriddenMeth // Other completions | cc -> @@ -2025,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) = + member _.GetDeclarations + ( + parseResultsOpt, + line, + lineStr, + partialName, + completionContextAtPos, + getAllEntities, + genBodyForOverriddenMeth + ) = let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName DiagnosticsScope.Protect @@ -2044,7 +2069,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, completionContextAtPos, - getAllEntities + getAllEntities, + genBodyForOverriddenMeth ) match declItemsOpt with @@ -2085,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) = + member _.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, getAllEntities, genBodyForOverriddenMeth) = let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName DiagnosticsScope.Protect @@ -2104,7 +2130,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - getAllEntities + getAllEntities, + genBodyForOverriddenMeth ) match declItemsOpt with @@ -2285,7 +2312,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2347,7 +2375,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.No, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2393,7 +2422,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.No, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2434,7 +2464,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.No, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2470,7 +2501,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2618,7 +2650,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2647,7 +2680,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -3348,20 +3382,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, + ?genBodyForOverriddenMeth + ) = let getAllEntities = defaultArg getAllEntities (fun () -> []) + let genBodyForOverriddenMeth = defaultArg genBodyForOverriddenMeth 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, + genBodyForOverriddenMeth + ) - member _.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, ?getAllEntities) = + member _.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, ?getAllEntities, ?genBodyForOverriddenMeth) = let getAllEntities = defaultArg getAllEntities (fun () -> []) + let genBodyForOverriddenMeth = defaultArg genBodyForOverriddenMeth 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, genBodyForOverriddenMeth) member _.GetKeywordTooltip(names: string list) = ToolTipText.ToolTipText diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index 607232f3c92..cbc5ecc5f1b 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 a 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) * + ?genBodyForOverriddenMeth: 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 a 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) * + ?genBodyForOverriddenMeth: 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/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index ad200989d8c..4af8105d488 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-805::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 c23aae09751..b1d1c8b57d8 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-805::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 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. 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 356b98ede2b..1e77ef2af8b 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-849::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. diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index f43c53b2c0e..2c583555cb3 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, + genBodyForOverriddenMeth: bool ) = cancellableTask { @@ -189,7 +190,8 @@ type internal FSharpCompletionProvider line, partialName, getAllSymbols, - (completionContextPos, completionContext) + (completionContextPos, completionContext), + genBodyForOverriddenMeth ) let results = List() @@ -353,7 +355,15 @@ type internal FSharpCompletionProvider else Array.empty - let! results = FSharpCompletionProvider.ProvideCompletionsAsyncAux(context.Document, context.Position, getAllSymbols) + let genBodyForOverriddenMeth = settings.IntelliSense.GenerateBodyForOverriddenMethod + + let! results = + FSharpCompletionProvider.ProvideCompletionsAsyncAux( + context.Document, + context.Position, + getAllSymbols, + genBodyForOverriddenMeth + ) context.AddItems results diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index ef67e6482ba..efc068386ca 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 + GenerateBodyForOverriddenMethod: bool } static member Default = @@ -32,6 +33,7 @@ type IntelliSenseOptions = ShowAfterCharIsDeleted = false IncludeSymbolsFromUnopenedNamespacesOrModules = false EnterKeySetting = EnterKeySetting.NeverNewline + GenerateBodyForOverriddenMethod = true } [] diff --git a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml index dbb7b6bb8fc..ecd097b2941 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..b6087aa8952 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_Overridden_Method { + get { + return ResourceManager.GetString("Generate_Body_For_Overridden_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..00c8cb82360 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 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 0c938e3f447..9d7aae398d5 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 overridden method + Generate default implementation body for overridden 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..fc8fa182849 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 overridden method + Generate default implementation body for overridden 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..2d0d091cfad 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 overridden method + Generate default implementation body for overridden 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..e1f1ecca5c1 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 overridden method + Generate default implementation body for overridden 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..816c3395e06 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 overridden method + Generate default implementation body for overridden 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..5247c0cc870 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 overridden method + Generate default implementation body for overridden 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..421c91f4c38 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 overridden method + Generate default implementation body for overridden 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..9e31b9d72e6 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 overridden method + Generate default implementation body for overridden 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..28c59366359 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 overridden method + Generate default implementation body for overridden 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..143cd4e4bed 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 overridden method + Generate default implementation body for overridden 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..cf9ba4b6834 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 overridden method + Generate default implementation body for overridden 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..2a43ae60eb2 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 overridden method + Generate default implementation body for overridden 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..9b1459d5e43 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 overridden method + Generate default implementation body for overridden method + + Inline Hints 內嵌提示 diff --git a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs index d8e92581f10..4377253d1ad 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 @@ -102,6 +102,40 @@ 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 +2129,50 @@ 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 + ) 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