diff --git a/.vscode/settings.json b/.vscode/settings.json index bd975e647..dcba1403b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,16 +8,161 @@ //otherwise take a lot of time to load proj inside //the test directories "omnisharp.autoStart": false, - "FSharp.minimizeBackgroundParsing": true, "FSharp.trace.server": "off", "yaml.schemas": { "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json": ".github/workflows/*" }, "editor.inlayHints.enabled": "offUnlessPressed", - "FSharp.enableAdaptiveLspServer": true, "files.associations": { "*.*proj": "msbuild", "*.props": "msbuild", "*.targets": "msbuild" - } -} \ No newline at end of file + }, + "cSpell.words": [ + "abrv", + "Additionals", + "ancestorly", + "apos", + "Argu", + "aset", + "asyncaval", + "attachdebugger", + "autocompletions", + "aval", + "avals", + "baaaaaaaaaz", + "baaaaz", + "Backticked", + "BCL's", + "bimap", + "binlog", + "bitflags", + "bprintf", + "ccont", + "cdma", + "cexpr", + "Childs", + "classlib", + "Cloneable", + "cmap", + "codefix", + "colu", + "compilerlocation", + "compilertool", + "crefs", + "cset", + "cval", + "Debouncer", + "decompile", + "Decompiler", + "decompiling", + "Dont", + "dotm", + "dotnetaddproject", + "dotnetaddsln", + "dotnetnew", + "dotnetnewget", + "dotnetnewlist", + "dotnetnewrun", + "dotnetremoveproject", + "econt", + "ehrpd", + "enduser", + "eprintfn", + "evdo", + "Expecto", + "expl", + "failtest", + "Fantomas", + "fantomasignore", + "foldi", + "FSAC", + "fsautocomplete", + "Fsdn", + "Fsprojs", + "fsym", + "ftest", + "Funcs", + "GITSHA", + "gprs", + "Handleable", + "hsdpa", + "hspap", + "hsupa", + "iden", + "iface", + "ifaces", + "IFSAC", + "infinityf", + "Informations", + "inproc", + "insts", + "interoperating", + "ints", + "Ionide", + "iwlan", + "kprintf", + "langversion", + "linebreak", + "linebreaks", + "listheader", + "logfile", + "lpat", + "Msbuild", + "nanf", + "Neatherway", + "NETCORE", + "Newtonsoft", + "nlpos", + "nmax", + "normalised", + "nrnsa", + "nunit", + "objs", + "opentelemetry", + "otel", + "Otlp", + "Overriden", + "paket", + "parently", + "parms", + "Petricek", + "projs", + "promptable", + "ptest", + "quals", + "quickfix", + "Recalc", + "retn", + "Retrigger", + "revd", + "RPAREN", + "rpat", + "scdma", + "seealso", + "Sequentials", + "Serilog", + "Simplifiable", + "sketchfs", + "skiptest", + "Sourcelink", + "sourcelinked", + "SRTP", + "streamjsonrpc", + "subidx", + "Supertypes", + "Syms", + "Tablered", + "targetprofile", + "tbody", + "thead", + "threadpool", + "tracecontext", + "typeparamref", + "typesig", + "umts", + "whitespaces", + "xrtt", + "xunit" + ] +} diff --git a/paket.dependencies b/paket.dependencies index a604c2537..4de863338 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -53,7 +53,7 @@ nuget Expecto.Diff nuget YoloDev.Expecto.TestSdk nuget AltCover nuget GitHubActionsTestLogger -nuget Ionide.LanguageServerProtocol >= 0.4.16 +nuget Ionide.LanguageServerProtocol >= 0.4.18 nuget Microsoft.Extensions.Caching.Memory nuget OpenTelemetry.Api >= 1.3.2 nuget OpenTelemetry.Exporter.OpenTelemetryProtocol >= 1.3.2 # 1.4 bumps to 7.0 versions of System.Diagnostics libs, so can't use it diff --git a/paket.lock b/paket.lock index 05e091117..6b4bab215 100644 --- a/paket.lock +++ b/paket.lock @@ -130,7 +130,7 @@ NUGET System.Collections.Immutable (>= 5.0) System.Reflection.Metadata (>= 5.0) Ionide.KeepAChangelog.Tasks (0.1.8) - copy_local: true - Ionide.LanguageServerProtocol (0.4.17) + Ionide.LanguageServerProtocol (0.4.18) FSharp.Core (>= 6.0) Newtonsoft.Json (>= 13.0.1) StreamJsonRpc (>= 2.10.44) diff --git a/src/FsAutoComplete.Core/AbstractClassStubGenerator.fs b/src/FsAutoComplete.Core/AbstractClassStubGenerator.fs index ed67a2ed5..8db52d20b 100644 --- a/src/FsAutoComplete.Core/AbstractClassStubGenerator.fs +++ b/src/FsAutoComplete.Core/AbstractClassStubGenerator.fs @@ -13,7 +13,7 @@ type AbstractClassData = | ExplicitImpl of baseTy: SynType * members: SynMemberDefn list * - /// the place where the inherit expression is declared - the codefix should insert + /// the place where the inherit expression is declared - the code-fix should insert /// at an indent of .Start.Column, but insert a newline after .End inheritExpressionRange: Range diff --git a/src/FsAutoComplete.Core/AdaptiveExtensions.fsi b/src/FsAutoComplete.Core/AdaptiveExtensions.fsi index fcb00ced8..c5f7bf724 100644 --- a/src/FsAutoComplete.Core/AdaptiveExtensions.fsi +++ b/src/FsAutoComplete.Core/AdaptiveExtensions.fsi @@ -273,7 +273,7 @@ module AsyncAVal = val ofAVal: value: FSharp.Data.Adaptive.aval<'a> -> asyncaval<'a> /// - /// Returns a new async adaptive value that adaptively applies the mapping fun tion to the given + /// Returns a new async adaptive value that adaptively applies the mapping function to the given /// adaptive inputs. /// val map: @@ -282,13 +282,13 @@ module AsyncAVal = asyncaval<'b> /// - /// Returns a new async adaptive value that adaptively applies the mapping fun tion to the given + /// Returns a new async adaptive value that adaptively applies the mapping function to the given /// adaptive inputs. /// val mapAsync: mapping: ('a -> Async<'b>) -> input: asyncaval<'a> -> asyncaval<'b> /// - /// Returns a new async adaptive value that adaptively applies the mapping fun tion to the given + /// Returns a new async adaptive value that adaptively applies the mapping function to the given /// adaptive inputs. /// val mapSync: mapping: ('a -> System.Threading.CancellationToken -> 'b) -> input: asyncaval<'a> -> asyncaval<'b> diff --git a/src/FsAutoComplete.Core/CodeGeneration.fs b/src/FsAutoComplete.Core/CodeGeneration.fs index fa362cbc6..ec45756d4 100644 --- a/src/FsAutoComplete.Core/CodeGeneration.fs +++ b/src/FsAutoComplete.Core/CodeGeneration.fs @@ -134,7 +134,7 @@ module CodeGenerationUtils = { Writer: ColumnIndentedTextWriter /// Map generic types to specific instances for specialized interface implementation - TypeInstantations: Map + TypeInstantiations: Map /// Data for interface instantiation ArgInstantiations: (FSharpGenericParameter * FSharpType) seq /// Indentation inside method bodies @@ -162,7 +162,7 @@ module CodeGenerationUtils = let genericDefinition = typ.Instantiate(Seq.toList ctx.ArgInstantiations).Format(ctx.DisplayContext) - (genericDefinition, ctx.TypeInstantations) + (genericDefinition, ctx.TypeInstantiations) ||> Map.fold (fun s k v -> s.Replace(k, v)) let normalizeArgName (namesWithIndices: NamesWithIndices) nm = @@ -336,7 +336,7 @@ module CodeGenerationUtils = sprintf "(%s)" args), namesWithIndices - let preprocess (ctx: Context) (v: FSharpMemberOrFunctionOrValue) = + let preProcess (ctx: Context) (v: FSharpMemberOrFunctionOrValue) = let buildUsage argInfos = let parArgs, _ = getParamArgs argInfos ctx v @@ -394,10 +394,10 @@ module CodeGenerationUtils = match m with | MemberInfo.PropertyGetSet(getter, setter) -> - let (usage, modifiers, getterArgInfos, retType) = preprocess ctx getter + let (usage, modifiers, getterArgInfos, retType) = preProcess ctx getter let closeDeclaration = closeDeclaration retType let writeImplementation = writeImplementation ctx - let (_, _, setterArgInfos, _) = preprocess ctx setter + let (_, _, setterArgInfos, _) = preProcess ctx setter let writer = ctx.Writer writer.Write(memberPrefix getter) @@ -438,7 +438,7 @@ module CodeGenerationUtils = writer.Unindent ctx.Indentation | MemberInfo.Member v -> - let (usage, modifiers, argInfos, retType) = preprocess ctx v + let (usage, modifiers, argInfos, retType) = preProcess ctx v let closeDeclaration = closeDeclaration retType let writeImplementation = writeImplementation ctx let writer = ctx.Writer @@ -541,7 +541,7 @@ module CodeGenerationUtils = m.ImplementedAbstractSignatures <> null && m.ImplementedAbstractSignatures.Count = 0 with _ -> - true) // exceptions here trying to acces the member means we're safe + true) // exceptions here trying to access the member means we're safe // this member is not an override && not m.IsOverrideOrExplicitInterfaceImplementation @@ -713,7 +713,7 @@ module CodeGenerationUtils = let ctx = { Writer = writer - TypeInstantations = instantiations + TypeInstantiations = instantiations ArgInstantiations = Seq.empty Indentation = indentation ObjectIdent = objectIdent diff --git a/src/FsAutoComplete.Core/CodeGeneration.fsi b/src/FsAutoComplete.Core/CodeGeneration.fsi index ae2c477cb..2cf4ec5d8 100644 --- a/src/FsAutoComplete.Core/CodeGeneration.fsi +++ b/src/FsAutoComplete.Core/CodeGeneration.fsi @@ -62,7 +62,7 @@ module CodeGenerationUtils = { Writer: ColumnIndentedTextWriter /// Map generic types to specific instances for specialized interface implementation - TypeInstantations: Map + TypeInstantiations: Map /// Data for interface instantiation ArgInstantiations: (FSharpGenericParameter * FSharpType) seq /// Indentation inside method bodies diff --git a/src/FsAutoComplete.Core/Commands.fs b/src/FsAutoComplete.Core/Commands.fs index 3999f7091..0c2856a17 100644 --- a/src/FsAutoComplete.Core/Commands.fs +++ b/src/FsAutoComplete.Core/Commands.fs @@ -1104,7 +1104,7 @@ module Commands = // TODO: LSP technically does now know how to handle overlapping, nested and multiline ranges, but // as of 3 February 2021 there are no good examples of this that I've found, so we still do this - /// because LSP doesn't know how to handle overlapping/nested ranges, we have to dedupe them here + /// because LSP doesn't know how to handle overlapping/nested ranges, we have to de-dupe them here let scrubRanges (highlights: SemanticClassificationItem array) : SemanticClassificationItem array = let startToken = fun (m: SemanticClassificationItem) -> m.Range.StartLine, m.Range.StartColumn @@ -1139,14 +1139,14 @@ module Commands = - let analyzerHandler (file: string, content, pt, tast, symbols, getAllEnts) = + let analyzerHandler (file: string, content, pt, tast, symbols, getAllEntities) = let ctx: SDK.Context = { FileName = UMX.untag file Content = content ParseTree = pt TypedTree = tast Symbols = symbols - GetAllEntities = getAllEnts } + GetAllEntities = getAllEntities } let extractResultsFromAnalyzer (r: SDK.AnalysisResult) = match r.Output with diff --git a/src/FsAutoComplete.Core/CompilerServiceInterface.fs b/src/FsAutoComplete.Core/CompilerServiceInterface.fs index 8b1b3d1b3..b0a3a9bf4 100644 --- a/src/FsAutoComplete.Core/CompilerServiceInterface.fs +++ b/src/FsAutoComplete.Core/CompilerServiceInterface.fs @@ -336,7 +336,7 @@ type FSharpCompilerServiceChecker(hasAnalyzers, typecheckCacheSize, parallelRefe /// /// This is use primary for Autocompletions. The problem with trying to use TryGetRecentCheckResultsForFile is that it will return None /// if there isn't a GetHashCode that matches the SourceText passed in. This a problem particularly for Autocompletions because we'd have to wait for a typecheck - /// on every keystroke which can prove slow. For autocompletions, it's ok to rely on cached typechecks as files above generally don't change mid type. + /// on every keystroke which can prove slow. For autocompletions, it's ok to rely on cached type-checks as files above generally don't change mid type. /// /// The path of the file to get cached type check results for. /// Cached typecheck results diff --git a/src/FsAutoComplete.Core/CompilerServiceInterface.fsi b/src/FsAutoComplete.Core/CompilerServiceInterface.fsi index 4d1bbdb58..c5371f78e 100644 --- a/src/FsAutoComplete.Core/CompilerServiceInterface.fsi +++ b/src/FsAutoComplete.Core/CompilerServiceInterface.fsi @@ -60,7 +60,7 @@ type FSharpCompilerServiceChecker = /// /// This is use primary for Autocompletions. The problem with trying to use TryGetRecentCheckResultsForFile is that it will return None /// if there isn't a GetHashCode that matches the SourceText passed in. This a problem particularly for Autocompletions because we'd have to wait for a typecheck - /// on every keystroke which can prove slow. For autocompletions, it's ok to rely on cached typechecks as files above generally don't change mid type. + /// on every keystroke which can prove slow. For autocompletions, it's ok to rely on cached type-checks as files above generally don't change mid type. /// /// The path of the file to get cached type check results for. /// Cached typecheck results diff --git a/src/FsAutoComplete.Core/Debug.fs b/src/FsAutoComplete.Core/Debug.fs index c6aa1f6b2..aee09eaf5 100644 --- a/src/FsAutoComplete.Core/Debug.fs +++ b/src/FsAutoComplete.Core/Debug.fs @@ -23,12 +23,12 @@ module Debug = let measure name f = let sw = Stopwatch.StartNew() let r = f () - let ellapsed = sw.ElapsedMilliseconds + let elapsed = sw.ElapsedMilliseconds measureLogger.info ( - Log.setMessage ("{name} took {ellapsed} ms") + Log.setMessage ("{name} took {elapsed} ms") >> Log.addContextDestructured "name" name - >> Log.addContextDestructured "ellapsed" ellapsed + >> Log.addContextDestructured "elapsed" elapsed ) r @@ -37,12 +37,12 @@ module Debug = async { let sw = Stopwatch.StartNew() let! r = f - let ellapsed = sw.ElapsedMilliseconds + let elapsed = sw.ElapsedMilliseconds measureLogger.info ( - Log.setMessage ("{name} took {ellapsed} ms") + Log.setMessage ("{name} took {elapsed} ms") >> Log.addContextDestructured "name" name - >> Log.addContextDestructured "ellapsed" ellapsed + >> Log.addContextDestructured "elapsed" elapsed ) return r diff --git a/src/FsAutoComplete.Core/DocumentationFormatter.fs b/src/FsAutoComplete.Core/DocumentationFormatter.fs index a1788ebf8..6220d2cba 100644 --- a/src/FsAutoComplete.Core/DocumentationFormatter.fs +++ b/src/FsAutoComplete.Core/DocumentationFormatter.fs @@ -212,7 +212,7 @@ module DocumentationFormatter = with :? InvalidOperationException -> p.DisplayName, p.DisplayName.Length - let getUnioncaseSignature displayContext (unionCase: FSharpUnionCase) = + let getUnionCaseSignature displayContext (unionCase: FSharpUnionCase) = if unionCase.Fields.Count > 0 then let typeList = unionCase.Fields @@ -544,9 +544,9 @@ module DocumentationFormatter = let constraints = match v.FullTypeSafe with - | Some fulltype when fulltype.IsGenericParameter -> + | Some fullType when fullType.IsGenericParameter -> let formattedParam = - formatGenericParameter false displayContext fulltype.GenericParameter + formatGenericParameter false displayContext fullType.GenericParameter if String.IsNullOrWhiteSpace formattedParam then None @@ -615,7 +615,7 @@ module DocumentationFormatter = | _ when fse.IsInterface -> "interface" | _ -> "type" - let enumtip () = + let enumTip () = $" ={nl} |" ++ (fse.FSharpFields |> Seq.filter (fun f -> not f.IsCompilerGenerated) @@ -629,10 +629,10 @@ module DocumentationFormatter = | None -> field.Name) |> String.concat $"{nl} | ") - let uniontip () = + let unionTip () = $" ={nl} |" ++ (fse.UnionCases - |> Seq.map (getUnioncaseSignature displayContext) + |> Seq.map (getUnionCaseSignature displayContext) |> String.concat ($"{nl} | ")) let delegateTip () = @@ -643,7 +643,7 @@ module DocumentationFormatter = $" ={nl} delegate of{nl}{invokerSig}" let typeTip () = - let constrc = + let constructors = fse.MembersFunctionsAndValues |> Seq.filter (fun n -> n.IsConstructor && n.Accessibility.IsPublic) |> Seq.collect (fun f -> @@ -731,7 +731,7 @@ module DocumentationFormatter = ++ fst (formatShowDocumentationLink ne.DisplayName ne.XmlDocSig ne.Assembly.SimpleName)) |> Seq.toArray - { Constructors = constrc + { Constructors = constructors Fields = fields Functions = funcs Interfaces = interfaces @@ -770,9 +770,9 @@ module DocumentationFormatter = basicName if fse.IsFSharpUnion then - (typeDisplay + uniontip ()), typeTip () + (typeDisplay + unionTip ()), typeTip () elif fse.IsEnum then - (typeDisplay + enumtip ()), EntityInfo.Empty + (typeDisplay + enumTip ()), EntityInfo.Empty elif fse.IsDelegate then (typeDisplay + delegateTip ()), EntityInfo.Empty else @@ -921,7 +921,7 @@ module DocumentationFormatter = Some((signature, EntityInfo.Empty), footerForType symbol, cn) | SymbolUse.UnionCase uc -> - let signature = getUnioncaseSignature symbol.DisplayContext uc + let signature = getUnionCaseSignature symbol.DisplayContext uc Some((signature, EntityInfo.Empty), footerForType symbol, cn) | SymbolUse.ActivePatternCase apc -> @@ -991,7 +991,7 @@ module DocumentationFormatter = Some((signature, EntityInfo.Empty), footerForType' symbol, cn) | UnionCase uc -> - let signature = getUnioncaseSignature lastDisplayContext uc + let signature = getUnionCaseSignature lastDisplayContext uc Some((signature, EntityInfo.Empty), footerForType' symbol, cn) | ActivePatternCase apc -> diff --git a/src/FsAutoComplete.Core/FCSPatches.fs b/src/FsAutoComplete.Core/FCSPatches.fs index 564ddeac3..e45a8b334 100644 --- a/src/FsAutoComplete.Core/FCSPatches.fs +++ b/src/FsAutoComplete.Core/FCSPatches.fs @@ -317,7 +317,7 @@ type FSharpParseFileResults with ) /// Gets the ranges of all arguments, if they can be found, for a function application at the given position. - member scope.GetAllArgumentsForFunctionApplicationAtPostion pos = + member scope.GetAllArgumentsForFunctionApplicationAtPosition pos = SynExprAppLocationsImpl.getAllCurriedArgsAtPosition pos scope.ParseTree @@ -372,7 +372,7 @@ type FSharpParseFileResults with let rec walkBinding expr workingRange = match expr with - // This lets us dive into subexpressions that may contain the binding we're after + // This lets us dive into sub-expressions that may contain the binding we're after | SynExpr.Sequential(_, _, expr1, expr2, _) -> if Range.rangeContainsPos expr1.Range pos then walkBinding expr1 workingRange diff --git a/src/FsAutoComplete.Core/FileSystem.fs b/src/FsAutoComplete.Core/FileSystem.fs index c16e6a988..1185b8e6e 100644 --- a/src/FsAutoComplete.Core/FileSystem.fs +++ b/src/FsAutoComplete.Core/FileSystem.fs @@ -94,7 +94,7 @@ type IFSACSourceText = /// The local absolute path of the file whose contents this IFSACSourceText represents abstract member FileName: string /// The unwrapped local absolute path of the file whose contents this IFSACSourceText represents. - /// Should only be used when interoping with the Compiler/Serialization + /// Should only be used when interoperating with the Compiler/Serialization abstract member RawFileName: string /// Representation of the final position in this file abstract member LastFilePosition: Position diff --git a/src/FsAutoComplete.Core/FileSystem.fsi b/src/FsAutoComplete.Core/FileSystem.fsi index 19f842e79..3c62dfa57 100644 --- a/src/FsAutoComplete.Core/FileSystem.fsi +++ b/src/FsAutoComplete.Core/FileSystem.fsi @@ -51,7 +51,7 @@ type IFSACSourceText = /// The local absolute path of the file whose contents this IFSACSourceText represents abstract member FileName: string /// The unwrapped local absolute path of the file whose contents this IFSACSourceText represents. - /// Should only be used when interoping with the Compiler/Serialization + /// Should only be used when interoperating with the Compiler/Serialization abstract member RawFileName: string /// Representation of the final position in this file abstract member LastFilePosition: Position diff --git a/src/FsAutoComplete.Core/Fsdn.fs b/src/FsAutoComplete.Core/Fsdn.fs index 3a5a529ec..30108d1cf 100644 --- a/src/FsAutoComplete.Core/Fsdn.fs +++ b/src/FsAutoComplete.Core/Fsdn.fs @@ -13,7 +13,7 @@ type Response = class_name: string id: string |} |} |}[] |} -let query (querystr: string) = +let query (queryStr: string) = async { let exclusionList = @@ -38,7 +38,7 @@ let query (querystr: string) = "System.Reactive" ] let queryString = - [ "query", querystr + [ "query", queryStr "exclusion", (exclusionList |> String.concat "+") "respect_name_difference", "enabled" "greedy_matching", "enabled" @@ -67,9 +67,9 @@ let query (querystr: string) = let info2 = v.api.name //return a list of strings - let infonamespace = info2.``namespace`` - let infoclass = info2.class_name - let infomethod = info2.id + let infoNamespace = info2.``namespace`` + let infoClass = info2.class_name + let infoMethod = info2.id let removeGenerics (s: string) = if not (s.Contains("<")) then @@ -77,7 +77,7 @@ let query (querystr: string) = else s.Substring(0, s.IndexOf('<')) - let finalresp = infoclass + "." + (removeGenerics infomethod) - finalresp) + let finalResponse = infoClass + "." + (removeGenerics infoMethod) + finalResponse) |> Array.toList } diff --git a/src/FsAutoComplete.Core/FsprojEdit.fs b/src/FsAutoComplete.Core/FsprojEdit.fs index ace6ce959..2f9c619e6 100644 --- a/src/FsAutoComplete.Core/FsprojEdit.fs +++ b/src/FsAutoComplete.Core/FsprojEdit.fs @@ -16,20 +16,20 @@ module FsProjEditor = /// let private fileAlreadyIncludedViaCompileTag (doc: System.Xml.XmlDocument) (searchedFile: string) = - let inline sanitazeFile (file: string) = file.Replace("\\", "/") + let inline sanitizeFile (file: string) = file.Replace("\\", "/") - let searchedFile = sanitazeFile searchedFile + let searchedFile = sanitizeFile searchedFile // Take all the nodes doc.SelectNodes("//Compile[@Include]") |> Seq.cast // Find the node that match the file we want to remove - // Note: We sanitaze the file name path because it can changes depending on the OS + // Note: We sanitize the file name path because it can changes depending on the OS // and also on if the user used / or \ as the separator |> Seq.tryFind (fun node -> - let sanitazedInclude = node.Attributes.["Include"].InnerText |> sanitazeFile + let sanitizedInclude = node.Attributes.["Include"].InnerText |> sanitizeFile - sanitazedInclude = searchedFile) + sanitizedInclude = searchedFile) |> Option.isSome @@ -47,10 +47,10 @@ module FsProjEditor = node let moveFileUp (fsprojPath: string) (file: string) = - let xdoc = System.Xml.XmlDocument() - xdoc.Load fsprojPath + let xDoc = System.Xml.XmlDocument() + xDoc.Load fsprojPath let xpath = sprintf "//Compile[@Include='%s']/.." file - let itemGroup = xdoc.SelectSingleNode(xpath) + let itemGroup = xDoc.SelectSingleNode(xpath) let childXPath = sprintf "//Compile[@Include='%s']" file let node = itemGroup.SelectSingleNode(childXPath) let upNode = node.PreviousSibling @@ -60,13 +60,13 @@ module FsProjEditor = else itemGroup.RemoveChild node |> ignore itemGroup.InsertBefore(node, upNode) |> ignore - xdoc.Save fsprojPath + xDoc.Save fsprojPath let moveFileDown (fsprojPath: string) (file: string) = - let xdoc = System.Xml.XmlDocument() - xdoc.Load fsprojPath + let xDoc = System.Xml.XmlDocument() + xDoc.Load fsprojPath let xpath = sprintf "//Compile[@Include='%s']/.." file - let itemGroup = xdoc.SelectSingleNode(xpath) + let itemGroup = xDoc.SelectSingleNode(xpath) let childXPath = sprintf "//Compile[@Include='%s']" file let node = itemGroup.SelectSingleNode(childXPath) let downNode = node.NextSibling @@ -76,59 +76,59 @@ module FsProjEditor = else itemGroup.RemoveChild node |> ignore itemGroup.InsertAfter(node, downNode) |> ignore - xdoc.Save fsprojPath + xDoc.Save fsprojPath let addFileAbove (fsprojPath: string) (aboveFile: string) (newFileName: string) = - let xdoc = System.Xml.XmlDocument() - xdoc.Load fsprojPath + let xDoc = System.Xml.XmlDocument() + xDoc.Load fsprojPath - if fileAlreadyIncludedViaCompileTag xdoc newFileName then + if fileAlreadyIncludedViaCompileTag xDoc newFileName then Error "File already included in the project" else let xpath = sprintf "//Compile[@Include='%s']/.." aboveFile - let itemGroup = xdoc.SelectSingleNode(xpath) + let itemGroup = xDoc.SelectSingleNode(xpath) let childXPath = sprintf "//Compile[@Include='%s']" aboveFile let aboveNode = itemGroup.SelectSingleNode(childXPath) - let node = createNewCompileNode xdoc newFileName + let node = createNewCompileNode xDoc newFileName itemGroup.InsertBefore(node, aboveNode) |> ignore - xdoc.Save fsprojPath + xDoc.Save fsprojPath Ok() let addFileBelow (fsprojPath: string) (belowFile: string) (newFileName: string) = - let xdoc = System.Xml.XmlDocument() - xdoc.Load fsprojPath + let xDoc = System.Xml.XmlDocument() + xDoc.Load fsprojPath - if fileAlreadyIncludedViaCompileTag xdoc newFileName then + if fileAlreadyIncludedViaCompileTag xDoc newFileName then Error "File already included in the project" else let xpath = sprintf "//Compile[@Include='%s']/.." belowFile - let itemGroup = xdoc.SelectSingleNode(xpath) + let itemGroup = xDoc.SelectSingleNode(xpath) let childXPath = sprintf "//Compile[@Include='%s']" belowFile let aboveNode = itemGroup.SelectSingleNode(childXPath) - let node = createNewCompileNode xdoc newFileName + let node = createNewCompileNode xDoc newFileName itemGroup.InsertAfter(node, aboveNode) |> ignore - xdoc.Save fsprojPath + xDoc.Save fsprojPath Ok() let renameFile (fsprojPath: string) (oldFileName: string) (newFileName: string) = - let xdoc = System.Xml.XmlDocument() - xdoc.Load fsprojPath + let xDoc = System.Xml.XmlDocument() + xDoc.Load fsprojPath let xpath = sprintf "//Compile[@Include='%s']" oldFileName - let node = xdoc.SelectSingleNode(xpath) + let node = xDoc.SelectSingleNode(xpath) node.Attributes["Include"].InnerText <- newFileName - xdoc.Save fsprojPath + xDoc.Save fsprojPath let addFile (fsprojPath: string) (newFileName: string) = - let xdoc = System.Xml.XmlDocument() - xdoc.Load fsprojPath + let xDoc = System.Xml.XmlDocument() + xDoc.Load fsprojPath - if fileAlreadyIncludedViaCompileTag xdoc newFileName then + if fileAlreadyIncludedViaCompileTag xDoc newFileName then Error "File already included in the project" else - let newNode = createNewCompileNode xdoc newFileName + let newNode = createNewCompileNode xDoc newFileName let compileItemGroups = - xdoc.SelectNodes("//Compile/.. | //None/.. | //EmbeddedResource/.. | //Content/..") + xDoc.SelectNodes("//Compile/.. | //None/.. | //EmbeddedResource/.. | //Content/..") let hasExistingCompileElement = compileItemGroups.Count > 0 @@ -140,12 +140,12 @@ module FsProjEditor = firstCompileItemGroup.InsertBefore(newNode, x) |> ignore else - let itemGroup = xdoc.CreateElement("ItemGroup") + let itemGroup = xDoc.CreateElement("ItemGroup") itemGroup.AppendChild(newNode) |> ignore - let projectNode = xdoc.SelectSingleNode("//Project") + let projectNode = xDoc.SelectSingleNode("//Project") projectNode.AppendChild(itemGroup) |> ignore - xdoc.Save fsprojPath + xDoc.Save fsprojPath Ok() let addExistingFile (fsprojPath: string) (existingFile: string) = @@ -155,25 +155,25 @@ module FsProjEditor = addFile fsprojPath relativePath let removeFile (fsprojPath: string) (fileToRemove: string) = - let xdoc = System.Xml.XmlDocument() - xdoc.Load fsprojPath - let sanitazedFileToRemove = fileToRemove.Replace("\\", "/") + let xDoc = System.Xml.XmlDocument() + xDoc.Load fsprojPath + let sanitizedFileToRemove = fileToRemove.Replace("\\", "/") let nodeToRemoveOpt = // Take all the nodes - xdoc.SelectNodes("//Compile[@Include]") + xDoc.SelectNodes("//Compile[@Include]") |> Seq.cast // Find the node that match the file we want to remove - // Note: We sanitaze the file name path because it can changes depending on the OS + // Note: We sanitize the file name path because it can changes depending on the OS // and also on if the user used / or \ as the separator |> Seq.tryFind (fun node -> - let sanitazedInclude = node.Attributes.["Include"].InnerText.Replace("\\", "/") - sanitazedInclude = sanitazedFileToRemove) + let sanitizedInclude = node.Attributes.["Include"].InnerText.Replace("\\", "/") + sanitizedInclude = sanitizedFileToRemove) match nodeToRemoveOpt with | Some nodeToRemove -> nodeToRemove.ParentNode.RemoveChild(nodeToRemove) |> ignore - xdoc.Save fsprojPath + xDoc.Save fsprojPath | None -> // Node not found, do nothing diff --git a/src/FsAutoComplete.Core/InlayHints.fs b/src/FsAutoComplete.Core/InlayHints.fs index e61614dfd..a46756f6f 100644 --- a/src/FsAutoComplete.Core/InlayHints.fs +++ b/src/FsAutoComplete.Core/InlayHints.fs @@ -231,9 +231,9 @@ module private ShouldCreate = /// Boundary checks: /// * word boundary (-> upper case letter) - /// `"bar" |> isPostifxOf "fooBar"` + /// `"bar" |> isPostfixOf "fooBar"` /// * `.` boundary (-> property access) - /// `"bar" |> isPostifxOf "data.bar"` + /// `"bar" |> isPostfixOf "data.bar"` /// /// Doesn't consider capitalization, except for word boundary at start of postfix: /// * `bar` postfix of `fooBar` @@ -397,8 +397,8 @@ type MissingExplicitType with | _ -> () |] member x.TypeAndEdits(ty: FSharpType, displayContext: FSharpDisplayContext) = - let (ty, tyForAnntotation) = x.FormatType(ty, displayContext) - let edits = x.CreateEdits(tyForAnntotation) + let (ty, tyForAnnotation) = x.FormatType(ty, displayContext) + let edits = x.CreateEdits(tyForAnnotation) (ty, edits) /// Note: No validation of `mfv`! @@ -978,7 +978,7 @@ let provideHints // reliably create hints, so skip it logger.info ( Log.setMessage - "Parameter hints for {memberName} may fail because the number of parameters in the defintion ({memberParameters}) doesn't match the number of argument locations ({providedParameters})" + "Parameter hints for {memberName} may fail because the number of parameters in the definition ({memberParameters}) doesn't match the number of argument locations ({providedParameters})" >> Log.addContext "memberName" $"{methodOrConstructor.DeclaringEntity @@ -990,7 +990,7 @@ let provideHints // iterate over the _provided_ parameters, because otherwise we might index into optional parameters // from the method's definition that the user didn't have to provide. - // thought/note: what about `paramarray` parameters? + // thought/note: what about `param array` parameters? tupledParamInfos.ArgumentLocations |> Array.iteri (fun idx paramLocationInfo -> if parameters.Length <= idx then diff --git a/src/FsAutoComplete.Core/Lexer.fs b/src/FsAutoComplete.Core/Lexer.fs index 96817bb7f..e7fd16497 100644 --- a/src/FsAutoComplete.Core/Lexer.fs +++ b/src/FsAutoComplete.Core/Lexer.fs @@ -117,11 +117,11 @@ module Lexer = // Each of them has FullMatchedLength = 3. So, we take the first GREATER and skip the other two). // // Generic type parameters: we convert QUOTE + IDENT tokens into single IDENT token, altering its LeftColumn - // and FullMathedLength (for "'type" which is tokenized as (QUOTE, left=2) + (IDENT, left=3, length=4) + // and FullMethodLength (for "'type" which is tokenized as (QUOTE, left=2) + (IDENT, left=3, length=4) // we'll get (IDENT, left=2, length=5). // // Statically resolved type parameters: we convert INFIX_AT_HAT_OP + IDENT tokens into single IDENT token, altering its LeftColumn - // and FullMathedLength (for "^type" which is tokenized as (INFIX_AT_HAT_OP, left=2) + (IDENT, left=3, length=4) + // and FullMethodLength (for "^type" which is tokenized as (INFIX_AT_HAT_OP, left=2) + (IDENT, left=3, length=4) // we'll get (IDENT, left=2, length=5). let private fixTokens lineStr (tokens: FSharpTokenInfo list) = tokens diff --git a/src/FsAutoComplete.Core/ParseAndCheckResults.fs b/src/FsAutoComplete.Core/ParseAndCheckResults.fs index 3efd8b93f..feae26dfc 100644 --- a/src/FsAutoComplete.Core/ParseAndCheckResults.fs +++ b/src/FsAutoComplete.Core/ParseAndCheckResults.fs @@ -97,10 +97,10 @@ type ParseAndCheckResults let decompile assembly externalSym = match Decompiler.tryFindExternalDeclaration checkResults (assembly, externalSym) with | Ok extDec -> ResultOrString.Ok(FindDeclarationResult.ExternalDeclaration extDec) - | Error(Decompiler.FindExternalDeclarationError.ReferenceHasNoFileName assy) -> - ResultOrString.Error(sprintf "External declaration assembly '%s' missing file name" assy.SimpleName) - | Error(Decompiler.FindExternalDeclarationError.ReferenceNotFound assy) -> - ResultOrString.Error(sprintf "External declaration assembly '%s' not found" assy) + | Error(Decompiler.FindExternalDeclarationError.ReferenceHasNoFileName asm) -> + ResultOrString.Error(sprintf "External declaration assembly '%s' missing file name" asm.SimpleName) + | Error(Decompiler.FindExternalDeclarationError.ReferenceNotFound asm) -> + ResultOrString.Error(sprintf "External declaration assembly '%s' not found" asm) | Error(Decompiler.FindExternalDeclarationError.DecompileError(Decompiler.Exception(symbol, file, exn))) -> Error( sprintf "Error while decompiling symbol '%A' in file '%s': %s\n%s" symbol file exn.Message exn.StackTrace @@ -118,8 +118,8 @@ type ParseAndCheckResults | FindDeclExternalSymbol.Event(typeName, name) -> None | FindDeclExternalSymbol.Property(typeName, name) -> None - // attempts to manually discover symbol use and externalsymbol information for a range that doesn't exist in a local file - // bugfix/workaround for FCS returning invalid declfound for f# members. + // attempts to manually discover symbol use and external symbol information for a range that doesn't exist in a local file + // bugfix/workaround for FCS returning invalid decl found for f# members. let tryRecoverExternalSymbolForNonexistentDecl (rangeInNonexistentFile: FSharp.Compiler.Text.Range) : ResultOrString * string> = @@ -137,7 +137,7 @@ type ParseAndCheckResults match symbolUse with | None -> ResultOrString.Error( - sprintf "Range for nonexistent file found, no symboluse found: %s" rangeInNonexistentFile.FileName + sprintf "Range for nonexistent file found, no symbol use found: %s" rangeInNonexistentFile.FileName ) | Some sym -> match sym.Symbol.Assembly.FileName with @@ -169,7 +169,7 @@ type ParseAndCheckResults // decl in same file // necessary to get decl in untitled file (-> `File.Exists range.FileName` is false) logger.info ( - Log.setMessage "Got a declresult of {range} in same file" + Log.setMessage "Got a declResult of {range} in same file" >> Log.addContextDestructured "range" range ) @@ -178,7 +178,7 @@ type ParseAndCheckResults let rangeStr = range.ToString() logger.info ( - Log.setMessage "Got a declresult of {range} that supposedly exists" + Log.setMessage "Got a declResult of {range} that supposedly exists" >> Log.addContextDestructured "range" rangeStr ) @@ -187,7 +187,7 @@ type ParseAndCheckResults let range = rangeInNonexistentFile.ToString() logger.warn ( - Log.setMessage "Got a declresult of {range} that doesn't exist" + Log.setMessage "Got a declResult of {range} that doesn't exist" >> Log.addContextDestructured "range" range ) @@ -276,10 +276,10 @@ type ParseAndCheckResults let decompile assembly externalSym = match Decompiler.tryFindExternalDeclaration checkResults (assembly, externalSym) with | Ok extDec -> ResultOrString.Ok(FindDeclarationResult.ExternalDeclaration extDec) - | Error(Decompiler.FindExternalDeclarationError.ReferenceHasNoFileName assy) -> - ResultOrString.Error(sprintf "External declaration assembly '%s' missing file name" assy.SimpleName) - | Error(Decompiler.FindExternalDeclarationError.ReferenceNotFound assy) -> - ResultOrString.Error(sprintf "External declaration assembly '%s' not found" assy) + | Error(Decompiler.FindExternalDeclarationError.ReferenceHasNoFileName asm) -> + ResultOrString.Error(sprintf "External declaration assembly '%s' missing file name" asm.SimpleName) + | Error(Decompiler.FindExternalDeclarationError.ReferenceNotFound asm) -> + ResultOrString.Error(sprintf "External declaration assembly '%s' not found" asm) | Error(Decompiler.FindExternalDeclarationError.DecompileError(Decompiler.Exception(symbol, file, exn))) -> Error( sprintf @@ -508,13 +508,13 @@ type ParseAndCheckResults checkResults.GetSymbolUsesAtLocation(pos.Line, colu, lineStr, identIsland) member x.TryGetSymbolUseAndUsages (pos: Position) (lineStr: LineStr) = - let symboluse = x.TryGetSymbolUse pos lineStr + let symbolUse = x.TryGetSymbolUse pos lineStr - match symboluse with + match symbolUse with | None -> ResultOrString.Error "No symbol information found" - | Some symboluse -> - let symboluses = checkResults.GetUsesOfSymbolInFile symboluse.Symbol - Ok(symboluse, symboluses) + | Some symbolUse -> + let symbolUses = checkResults.GetUsesOfSymbolInFile symbolUse.Symbol + Ok(symbolUse, symbolUses) member __.TryGetSignatureData (pos: Position) (lineStr: LineStr) = match Lexer.findLongIdents (pos.Column, lineStr) with @@ -523,18 +523,18 @@ type ParseAndCheckResults let identIsland = Array.toList identIsland - let symboluse = + let symbolUse = checkResults.GetSymbolUseAtLocation(pos.Line, colu, lineStr, identIsland) - match symboluse with + match symbolUse with | None -> ResultOrString.Error "No symbol information found" - | Some symboluse -> - let fsym = symboluse.Symbol + | Some symbolUse -> + let fsym = symbolUse.Symbol match fsym with | :? FSharpMemberOrFunctionOrValue as symbol -> let typ = - symbol.ReturnParameter.Type.Format(symboluse.DisplayContext.WithPrefixGenericParameters()) + symbol.ReturnParameter.Type.Format(symbolUse.DisplayContext.WithPrefixGenericParameters()) if symbol.IsPropertyGetterMethod then Ok(typ, [], []) @@ -542,7 +542,7 @@ type ParseAndCheckResults let parms = symbol.CurriedParameterGroups |> Seq.map ( - Seq.map (fun p -> p.DisplayName, p.Type.Format(symboluse.DisplayContext.WithPrefixGenericParameters())) + Seq.map (fun p -> p.DisplayName, p.Type.Format(symbolUse.DisplayContext.WithPrefixGenericParameters())) >> Seq.toList ) |> Seq.toList @@ -556,7 +556,7 @@ type ParseAndCheckResults Ok(typ, [ [ ("unit", "unit") ] ], []) | _ -> Ok(typ, parms, generics) | :? FSharpField as symbol -> - let typ = symbol.FieldType.Format symboluse.DisplayContext + let typ = symbol.FieldType.Format symbolUse.DisplayContext Ok(typ, [], []) | _ -> ResultOrString.Error "Not a member, function or value" diff --git a/src/FsAutoComplete.Core/SignatureFormatter.fs b/src/FsAutoComplete.Core/SignatureFormatter.fs index cd0dfe201..6892610ca 100644 --- a/src/FsAutoComplete.Core/SignatureFormatter.fs +++ b/src/FsAutoComplete.Core/SignatureFormatter.fs @@ -58,7 +58,7 @@ module SignatureFormatter = sprintf "struct (%s)" refTupleStr else refTupleStr - elif typ.IsGenericParameter then // no longer need to differentiate between STRP and normal generic parameter types + elif typ.IsGenericParameter then // no longer need to differentiate between SRTP and normal generic parameter types "'" + typ.GenericParameter.Name elif typ.HasTypeDefinition && typ.GenericArguments.Count > 0 then let typeDef = typ.TypeDefinition @@ -162,12 +162,12 @@ module SignatureFormatter = sb.ToString() - let getUnioncaseSignature (displayContext: FSharpDisplayContext) (unionCase: FSharpUnionCase) = + let getUnionCaseSignature (displayContext: FSharpDisplayContext) (unionCase: FSharpUnionCase) = if unionCase.Fields.Count > 0 then let typeList = unionCase.Fields |> Seq.map (fun unionField -> - if unionField.Name.StartsWith "Item" then //TODO: Some better way of dettecting default names for the union cases' fields + if unionField.Name.StartsWith "Item" then //TODO: Some better way of detecting default names for the union cases' fields formatFSharpType displayContext unionField.FieldType else unionField.Name + ":" ++ (formatFSharpType displayContext unionField.FieldType)) @@ -205,7 +205,7 @@ module SignatureFormatter = | _ -> "" let modifier = - //F# types are prefixed with new, should non F# types be too for consistancy? + //F# types are prefixed with new, should non F# types be too for consistency? if func.IsConstructor then match func.EnclosingEntitySafe with | Some ent -> @@ -523,9 +523,9 @@ module SignatureFormatter = let constraints = match v.FullTypeSafe with - | Some fulltype when fulltype.IsGenericParameter -> + | Some fullType when fullType.IsGenericParameter -> let formattedParam = - formatGenericParameter false displayContext fulltype.GenericParameter + formatGenericParameter false displayContext fullType.GenericParameter if String.IsNullOrWhiteSpace formattedParam then None @@ -581,7 +581,7 @@ module SignatureFormatter = | _ when fse.IsInterface -> "interface" | _ -> "type" - let enumtip () = + let enumTip () = $" ={nl} |" ++ (fse.FSharpFields |> Seq.filter (fun f -> not f.IsCompilerGenerated) @@ -591,10 +591,10 @@ module SignatureFormatter = | None -> field.Name) |> String.concat $"{nl} | ") - let uniontip () = + let unionTip () = $" ={nl} |" ++ (fse.UnionCases - |> Seq.map (getUnioncaseSignature displayContext) + |> Seq.map (getUnionCaseSignature displayContext) |> String.concat $"{nl} | ") let delegateTip () = @@ -605,7 +605,7 @@ module SignatureFormatter = $" ={nl} delegate of{nl}{invokerSig}" let typeTip () = - let constrc = + let constructors = fse.MembersFunctionsAndValues |> Seq.filter (fun n -> n.IsConstructor && n.Accessibility.IsPublic) |> fun v -> @@ -658,7 +658,7 @@ module SignatureFormatter = let res = - [ yield constrc + [ yield constructors if not fse.IsFSharpModule then yield! fields @@ -702,13 +702,13 @@ module SignatureFormatter = else basicName - if fse.IsFSharpUnion then typeDisplay + uniontip () - elif fse.IsEnum then typeDisplay + enumtip () + if fse.IsFSharpUnion then typeDisplay + unionTip () + elif fse.IsEnum then typeDisplay + enumTip () elif fse.IsDelegate then typeDisplay + delegateTip () else typeDisplay + typeTip () let footerForType (entity: FSharpSymbolUse) = - let formatFooter (fullName, assyName) = $"Full name: %s{fullName}{nl}Assembly: %s{assyName}" + let formatFooter (fullName, asmName) = $"Full name: %s{fullName}{nl}Assembly: %s{asmName}" let valFooterData = try @@ -728,7 +728,7 @@ module SignatureFormatter = valFooterData |> Option.map formatFooter |> Option.defaultValue "" - ///Returns formated symbol signature and footer that can be used to enhance standard FCS' text tooltips + ///Returns formatted symbol signature and footer that can be used to enhance standard FCS' text tooltips let getTooltipDetailsFromSymbolUse (symbol: FSharpSymbolUse) = match symbol with | SymbolUse.Entity(fse, _) -> @@ -781,7 +781,7 @@ module SignatureFormatter = Some(signature, footerForType symbol) | SymbolUse.UnionCase uc -> - let signature = getUnioncaseSignature symbol.DisplayContext uc + let signature = getUnionCaseSignature symbol.DisplayContext uc Some(signature, footerForType symbol) | SymbolUse.ActivePatternCase apc -> diff --git a/src/FsAutoComplete.Core/SignatureFormatter.fsi b/src/FsAutoComplete.Core/SignatureFormatter.fsi index 071ba05d8..b69eb24cb 100644 --- a/src/FsAutoComplete.Core/SignatureFormatter.fsi +++ b/src/FsAutoComplete.Core/SignatureFormatter.fsi @@ -25,7 +25,7 @@ module SignatureFormatter = param: FSharpGenericParameter -> string - val getUnioncaseSignature: displayContext: FSharpDisplayContext -> unionCase: FSharpUnionCase -> string + val getUnionCaseSignature: displayContext: FSharpDisplayContext -> unionCase: FSharpUnionCase -> string val getFuncSignatureWithIdent: displayContext: FSharpDisplayContext -> func: FSharpMemberOrFunctionOrValue -> ident: int -> string @@ -44,5 +44,5 @@ module SignatureFormatter = val getAPCaseSignature: displayContext: FSharpDisplayContext -> apc: FSharpActivePatternCase -> string val getEntitySignature: displayContext: FSharpDisplayContext -> fse: FSharpEntity -> string val footerForType: entity: FSharpSymbolUse -> string - ///Returns formated symbol signature and footer that can be used to enhance standard FCS' text tooltips + ///Returns formatted symbol signature and footer that can be used to enhance standard FCS' text tooltips val getTooltipDetailsFromSymbolUse: symbol: FSharpSymbolUse -> (string * string) option diff --git a/src/FsAutoComplete.Core/SignatureHelp.fs b/src/FsAutoComplete.Core/SignatureHelp.fs index 07feebad4..95dca906d 100644 --- a/src/FsAutoComplete.Core/SignatureHelp.fs +++ b/src/FsAutoComplete.Core/SignatureHelp.fs @@ -17,7 +17,7 @@ type SignatureHelpKind = type SignatureHelpInfo = { - /// all potential overloads of the member at the position where signaturehelp was invoked + /// all potential overloads of the member at the position where signature help was invoked Methods: MethodGroupItem[] /// if present, the index of the method we think is the current one (will never be outside the bounds of the Methods array) ActiveOverload: int option diff --git a/src/FsAutoComplete.Core/TestAdapter.fs b/src/FsAutoComplete.Core/TestAdapter.fs index 3b7a07f4c..fdd944567 100644 --- a/src/FsAutoComplete.Core/TestAdapter.fs +++ b/src/FsAutoComplete.Core/TestAdapter.fs @@ -216,25 +216,25 @@ let getExpectoTests (ast: ParsedInput) : TestAdapterEntry list = visitExpr parent trueBranch falseBranchOpt |> Option.iter (visitExpr parent) | SynExpr.LetOrUse(bindings = bindings; body = body) -> - visitBindindgs parent bindings + visitBindings parent bindings visitExpr parent body | SynExpr.Record(_, _, fields, _) -> fields |> List.choose (fun (SynExprRecordField(expr = expr)) -> expr) |> List.iter (visitExpr parent) | SynExpr.MatchLambda(_, _, clauses, _, _) -> visitMatches parent clauses - | SynExpr.ObjExpr(bindings = bindings) -> visitBindindgs parent bindings + | SynExpr.ObjExpr(bindings = bindings) -> visitBindings parent bindings | _ -> () and visitBinding prefix (SynBinding(expr = body)) = visitExpr prefix body - and visitBindindgs prefix s = s |> List.iter (visitBinding prefix) + and visitBindings prefix s = s |> List.iter (visitBinding prefix) and visitMatch prefix (SynMatchClause(resultExpr = expr)) = visitExpr prefix expr and visitMatches prefix s = s |> List.iter (visitMatch prefix) let rec visitDeclarations prefix decls = for declaration in decls do match declaration with - | SynModuleDecl.Let(_, bindings, _) -> visitBindindgs prefix bindings + | SynModuleDecl.Let(_, bindings, _) -> visitBindings prefix bindings | SynModuleDecl.NestedModule(decls = decls) -> visitDeclarations prefix decls | _ -> () diff --git a/src/FsAutoComplete.Core/TipFormatter.fs b/src/FsAutoComplete.Core/TipFormatter.fs index ffc2bfeb3..296440bcd 100644 --- a/src/FsAutoComplete.Core/TipFormatter.fs +++ b/src/FsAutoComplete.Core/TipFormatter.fs @@ -145,7 +145,7 @@ module private Format = // otherwise it will create an infinity loop text else - // Should not happend but like that we are sure to handle all possible cases + // Should not happened but like that we are sure to handle all possible cases text | _ -> text @@ -164,7 +164,7 @@ module private Format = // We need to trim the end of the text because the // user write XML comments with a space between the '///' - // and the '' tag. Then it mess up identifation of new lines + // and the '' tag. Then it mess up identification of new lines // at the end of the code snippet. // Example: // /// @@ -403,7 +403,7 @@ module private Format = // CaseC of the or section // // The original comments is for `System.Uri("")` - // By making the assumption that an 'or' section is always single line this allows us the detact the "" section + // By making the assumption that an 'or' section is always single line this allows us to detect the "" section // orText is on a single line, we just add quotation syntax if lastParagraphStartIndex = -1 then @@ -427,7 +427,7 @@ module private Format = /// If an 'or' block is found between 2 elements then we remove it as we can't generate a valid markdown for it /// /// For example, Some text -or- another text cannot be converted into a multiline string - /// and so we prefer to remove the 'or' block instead of having some weird markdown artefacts + /// and so we prefer to remove the 'or' block instead of having some weird markdown artifacts /// /// For now, we only consider text between to be invalid /// We can add more in the future if needed, but I want to keep this as minimal as possible to avoid capturing false positive @@ -644,7 +644,7 @@ module private Format = " | " + header) |> String.concat "" - let seprator = + let separator = columnHeaders |> List.mapi (fun index _ -> if index = 0 then "| ---" @@ -669,7 +669,7 @@ module private Format = Environment.NewLine + columnHeadersText + Environment.NewLine - + seprator + + separator + Environment.NewLine + itemsText) |> Some } @@ -728,7 +728,7 @@ type private XmlDocMember(doc: XmlDocument, indentationSize: int, columnOffset: | _ -> let content = // Normale the EOL - // This make it easier to work with line splittig + // This make it easier to work with line splitting node.InnerXml.Replace("\r\n", "\n") |> Format.applyAll content.Split('\n') @@ -857,7 +857,7 @@ let rec private readXmlDoc (reader: XmlReader) (indentationSize: int) (acc: Map< let acc' = match reader.Read() with | false -> indentationSize, None - // Assembly is the first node in the XML and is at least always indended by 1 "tab" + // Assembly is the first node in the XML and is at least always intended by 1 "tab" // So we used it as a reference to detect the tabs sizes // This is needed because `netstandard.xml` use 2 spaces tabs // Where when building a C# classlib, the xml file use 4 spaces size for example diff --git a/src/FsAutoComplete.Core/TypedAstPatterns.fs b/src/FsAutoComplete.Core/TypedAstPatterns.fs index a787c07f0..2959e1921 100644 --- a/src/FsAutoComplete.Core/TypedAstPatterns.fs +++ b/src/FsAutoComplete.Core/TypedAstPatterns.fs @@ -28,7 +28,7 @@ module SymbolUse = |> Option.toList |> List.map (fun fullName -> if ent.GenericParameters.Count > 0 && fullName.Length > 2 then - fullName.[0 .. fullName.Length - 3] //Get name without sufix specifing number of generic arguments (for example `'2`) + fullName.[0 .. fullName.Length - 3] //Get name without suffix specifying number of generic arguments (for example `'2`) else fullName) @@ -272,7 +272,7 @@ module SymbolPatterns = |> Option.toList |> List.map (fun fullName -> if ent.GenericParameters.Count > 0 && fullName.Length > 2 then - fullName.[0 .. fullName.Length - 3] //Get name without sufix specifing number of generic arguments (for example `'2`) + fullName.[0 .. fullName.Length - 3] //Get name without suffix specifying number of generic arguments (for example `'2`) else fullName) @@ -301,7 +301,7 @@ module SymbolPatterns = |> Option.toList |> List.map (fun fullName -> if ent.GenericParameters.Count > 0 && fullName.Length > 2 then - fullName.[0 .. fullName.Length - 3] //Get name without sufix specifing number of generic arguments (for example `'2`) + fullName.[0 .. fullName.Length - 3] //Get name without suffix specifying number of generic arguments (for example `'2`) else fullName) diff --git a/src/FsAutoComplete.Core/TypedAstUtils.fs b/src/FsAutoComplete.Core/TypedAstUtils.fs index ec5dc2b35..86d417302 100644 --- a/src/FsAutoComplete.Core/TypedAstUtils.fs +++ b/src/FsAutoComplete.Core/TypedAstUtils.fs @@ -145,7 +145,7 @@ module TypedAstExtensionHelpers = loop x 0 - //TODO: Do we need to unannotate like above? + //TODO: Do we need to un-annotate like above? member x.AllBaseTypes = let rec allBaseTypes (entity: FSharpEntity) = [ match entity.TryFullName with @@ -228,7 +228,7 @@ module TypedAstExtensionHelpers = type FSharpSymbol with /// - /// If this member is a type abbeviation (type Foo = Bar<string> for example), + /// If this member is a type abbreviation (type Foo = Bar<string> for example), /// resolves the underlying type. Otherwise returns this type. /// member this.GetAbbreviatedParent() = diff --git a/src/FsAutoComplete.Core/TypedAstUtils.fsi b/src/FsAutoComplete.Core/TypedAstUtils.fsi index 4c3b5a82e..c8d2d5d00 100644 --- a/src/FsAutoComplete.Core/TypedAstUtils.fsi +++ b/src/FsAutoComplete.Core/TypedAstUtils.fsi @@ -46,7 +46,7 @@ module TypedAstExtensionHelpers = type FSharpSymbol with /// - /// If this member is a type abbeviation (type Foo = Bar<string> for example), + /// If this member is a type abbreviation (type Foo = Bar<string> for example), /// resolves the underlying type. Otherwise returns this type. /// member GetAbbreviatedParent: unit -> FSharpSymbol diff --git a/src/FsAutoComplete.Core/Utils.fs b/src/FsAutoComplete.Core/Utils.fs index b3fbe2663..e49e7196d 100644 --- a/src/FsAutoComplete.Core/Utils.fs +++ b/src/FsAutoComplete.Core/Utils.fs @@ -371,13 +371,13 @@ module Array = if areEqual array [||] then () else - let arrlen, revlen = array.Length - 1, array.Length / 2 - 1 + let arrLen, revLen = array.Length - 1, array.Length / 2 - 1 - for idx in 0..revlen do + for idx in 0..revLen do let t1 = array.[idx] - let t2 = array.[arrlen - idx] + let t2 = array.[arrLen - idx] array.[idx] <- t2 - array.[arrlen - idx] <- t1 + array.[arrLen - idx] <- t1 let splitAt (n: int) (xs: 'a[]) : 'a[] * 'a[] = match xs with diff --git a/src/FsAutoComplete.Logging/FsOpenTelemetry.fs b/src/FsAutoComplete.Logging/FsOpenTelemetry.fs index 52b7f6d93..b10b300d7 100644 --- a/src/FsAutoComplete.Logging/FsOpenTelemetry.fs +++ b/src/FsAutoComplete.Logging/FsOpenTelemetry.fs @@ -461,7 +461,6 @@ module private SemanticHelpers = [] type ActivityExtensions = - [] /// /// Add or update the Activity baggage with the input key and value. @@ -481,13 +480,13 @@ type ActivityExtensions = /// The baggage key name /// The baggage value mapped to the input key /// for convenient chaining. + [] static member inline SetBaggageSafe(span: Activity, key: string, value: string) = if not (isNull span) then span.AddBaggage(key, value) else span - [] /// /// Add object to the list. /// @@ -496,10 +495,10 @@ type ActivityExtensions = /// The activity to add the baggage to /// object of to add to the attached events list. /// for convenient chaining. + [] static member inline AddEventSafe(span: Activity, e: ActivityEvent) = if Funcs.isNotNull span then span.AddEvent(e) else span - [] /// /// Add or update the Activity tag with the input key and value. /// @@ -515,6 +514,7 @@ type ActivityExtensions = /// The tag key name /// The tag value mapped to the input key /// for convenient chaining. + [] static member inline SetTagSafe(span: Activity, key, value: obj) = if Funcs.isNotNull span then span.SetTag(key, value) diff --git a/src/FsAutoComplete/CodeFixes/AddTypeToIndeterminateValue.fs b/src/FsAutoComplete/CodeFixes/AddTypeToIndeterminateValue.fs index 5e8b15ee8..b2c63ab7c 100644 --- a/src/FsAutoComplete/CodeFixes/AddTypeToIndeterminateValue.fs +++ b/src/FsAutoComplete/CodeFixes/AddTypeToIndeterminateValue.fs @@ -11,7 +11,7 @@ open FSharp.UMX let title = "Add explicit type annotation" -/// fix inderminate type errors by adding an explicit type to a value +/// fix indeterminate type errors by adding an explicit type to a value let fix (getParseResultsForFile: GetParseResultsForFile) (getProjectOptionsForFile: GetProjectOptionsForFile) diff --git a/src/FsAutoComplete/CodeFixes/AddTypeToIndeterminateValue.fsi b/src/FsAutoComplete/CodeFixes/AddTypeToIndeterminateValue.fsi index 7a5de8311..c065834bd 100644 --- a/src/FsAutoComplete/CodeFixes/AddTypeToIndeterminateValue.fsi +++ b/src/FsAutoComplete/CodeFixes/AddTypeToIndeterminateValue.fsi @@ -11,7 +11,7 @@ open FSharp.UMX val title: string -/// fix inderminate type errors by adding an explicit type to a value +/// fix indeterminate type errors by adding an explicit type to a value val fix: getParseResultsForFile: GetParseResultsForFile -> getProjectOptionsForFile: GetProjectOptionsForFile -> diff --git a/src/FsAutoComplete/CodeFixes/GenerateUnionCases.fs b/src/FsAutoComplete/CodeFixes/GenerateUnionCases.fs index 82fd6a162..f4707a5db 100644 --- a/src/FsAutoComplete/CodeFixes/GenerateUnionCases.fs +++ b/src/FsAutoComplete/CodeFixes/GenerateUnionCases.fs @@ -29,7 +29,7 @@ let fix let! caseLine = lines.GetLine(nextLine) |> Result.ofOption (fun _ -> "No case line") - let caseCol = caseLine.IndexOf('|') + 3 // Find column of first case in patern matching + let caseCol = caseLine.IndexOf('|') + 3 // Find column of first case in pattern matching let casePos = { Line = nextLine.Line - 1 diff --git a/src/FsAutoComplete/CodeFixes/RemoveUnusedBinding.fs b/src/FsAutoComplete/CodeFixes/RemoveUnusedBinding.fs index 6203346af..e49101efb 100644 --- a/src/FsAutoComplete/CodeFixes/RemoveUnusedBinding.fs +++ b/src/FsAutoComplete/CodeFixes/RemoveUnusedBinding.fs @@ -16,7 +16,7 @@ let posBetween (range: Range) tester = Position.posGeq tester range.Start // positions on this one are flipped to simulate Pos.posLte, because that doesn't exist && Position.posGeq range.End tester -type private ReplacmentRangeResult = +type private ReplacementRangeResult = | FullBinding of bindingRange: Range | Pattern of patternRange: Range diff --git a/src/FsAutoComplete/CommandResponse.fs b/src/FsAutoComplete/CommandResponse.fs index 5d37eb21a..592fe4a7d 100644 --- a/src/FsAutoComplete/CommandResponse.fs +++ b/src/FsAutoComplete/CommandResponse.fs @@ -320,7 +320,7 @@ module CommandResponse = type HighlightingResponse = { Highlights: HighlightingRange[] } - type PieplineHint = + type PipelineHint = { Line: int Types: string[] PrecedingNonPipeExprLine: int option } @@ -364,9 +364,9 @@ module CommandResponse = let mapItemResponse (p: Ionide.ProjInfo.ProjectViewerItem) : ProjectResponseItem = match p with - | Ionide.ProjInfo.ProjectViewerItem.Compile(fullpath, extraInfo) -> + | Ionide.ProjInfo.ProjectViewerItem.Compile(fullPath, extraInfo) -> { ProjectResponseItem.Name = "Compile" - ProjectResponseItem.FilePath = fullpath + ProjectResponseItem.FilePath = fullPath ProjectResponseItem.VirtualPath = extraInfo.Link ProjectResponseItem.Metadata = Map.empty } diff --git a/src/FsAutoComplete/CommandResponse.fsi b/src/FsAutoComplete/CommandResponse.fsi index 46fbb9a07..b28384d18 100644 --- a/src/FsAutoComplete/CommandResponse.fsi +++ b/src/FsAutoComplete/CommandResponse.fsi @@ -207,7 +207,7 @@ module CommandResponse = type HighlightingResponse = { Highlights: HighlightingRange[] } - type PieplineHint = + type PipelineHint = { Line: int Types: string[] PrecedingNonPipeExprLine: int option } diff --git a/src/FsAutoComplete/LspHelpers.fs b/src/FsAutoComplete/LspHelpers.fs index 2f0e4308a..02e15d63c 100644 --- a/src/FsAutoComplete/LspHelpers.fs +++ b/src/FsAutoComplete/LspHelpers.fs @@ -347,7 +347,7 @@ module Workspace = let countProjectsInSln (sln: WorkspacePeekFoundSolution) = sln.Items |> List.map foldFsproj |> List.sumBy List.length -module SigantureData = +module SignatureData = let formatSignature typ parms : string = let formatType = function @@ -420,7 +420,7 @@ module Structure = let toFoldingRange (item: Structure.ScopeRange) : FoldingRange = let kind = scopeToKind item.Scope - // map the collapserange to the foldingRange + // map the collapseRange to the foldingRange let lsp = fcsRangeToLsp item.CollapseRange { StartCharacter = Some lsp.Start.Character @@ -561,7 +561,7 @@ type WorkspacePeekRequest = Deep: int ExcludedDirs: string array } -type DocumentationForSymbolReuqest = { XmlSig: string; Assembly: string } +type DocumentationForSymbolRequest = { XmlSig: string; Assembly: string } type HighlightingRequest = { TextDocument: TextDocumentIdentifier } diff --git a/src/FsAutoComplete/LspHelpers.fsi b/src/FsAutoComplete/LspHelpers.fsi index 94d8d84cd..adeceb83b 100644 --- a/src/FsAutoComplete/LspHelpers.fsi +++ b/src/FsAutoComplete/LspHelpers.fsi @@ -105,7 +105,7 @@ module Workspace = val countProjectsInSln: sln: WorkspacePeekFoundSolution -> int -module SigantureData = +module SignatureData = val formatSignature: typ: string -> parms: ('a * string) list list -> string module Structure = @@ -197,7 +197,7 @@ type WorkspacePeekRequest = Deep: int ExcludedDirs: string array } -type DocumentationForSymbolReuqest = { XmlSig: string; Assembly: string } +type DocumentationForSymbolRequest = { XmlSig: string; Assembly: string } type HighlightingRequest = { TextDocument: TextDocumentIdentifier } diff --git a/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs b/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs index f030ea810..170cff38f 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs @@ -258,8 +258,8 @@ type AdaptiveFSharpLspServer [] caller: string ) = logger.info ( - Log.setMessage $"{caller} request: {{parms}}" - >> Log.addContextDestructured "parms" argValue + Log.setMessage $"{caller} request: {{params}}" + >> Log.addContextDestructured "params" argValue ) Helpers.notImplemented<'u> @@ -270,8 +270,8 @@ type AdaptiveFSharpLspServer [] caller: string ) = logger.info ( - Log.setMessage $"{caller} request: {{parms}}" - >> Log.addContextDestructured "parms" argValue + Log.setMessage $"{caller} request: {{params}}" + >> Log.addContextDestructured "params" argValue ) Helpers.ignoreNotification @@ -295,7 +295,7 @@ type AdaptiveFSharpLspServer |> Option.defaultValue FSharpConfig.Default logger.info ( - Log.setMessage "Intialization options {items}" + Log.setMessage "Initialization options {items}" >> Log.addContextDestructured "items" c ) @@ -408,8 +408,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentDidOpen Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentDidOpen Request: {params}" + >> Log.addContextDestructured "params" p ) let doc = p.TextDocument @@ -436,8 +436,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentDidClose Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentDidClose Request: {params}" + >> Log.addContextDestructured "params" p ) let doc = p.TextDocument @@ -463,8 +463,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentDidChange Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentDidChange Request: {params}" + >> Log.addContextDestructured "params" p ) let doc = p.TextDocument @@ -492,8 +492,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentDidSave Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentDidSave Request: {params}" + >> Log.addContextDestructured "params" p ) let doc = p.TextDocument @@ -504,8 +504,8 @@ type AdaptiveFSharpLspServer do! lspClient.CodeLensRefresh() logger.info ( - Log.setMessage "TextDocumentDidSave Request Finished: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentDidSave Request Finished: {params}" + >> Log.addContextDestructured "params" p ) return () @@ -528,8 +528,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentCompletion Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentCompletion Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -763,8 +763,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "CompletionItemResolve Request: {parms}" - >> Log.addContextDestructured "parms" ci + Log.setMessage "CompletionItemResolve Request: {params}" + >> Log.addContextDestructured "params" ci ) return! @@ -799,8 +799,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentSignatureHelp Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentSignatureHelp Request: {params}" + >> Log.addContextDestructured "params" p ) @@ -850,8 +850,8 @@ type AdaptiveFSharpLspServer trace |> Tracing.recordException e logger.error ( - Log.setMessage "TextDocumentSignatureHelp Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentSignatureHelp Request: {params}" + >> Log.addContextDestructured "params" p >> Log.addExn e ) @@ -865,8 +865,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentHover Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentHover Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -877,8 +877,8 @@ type AdaptiveFSharpLspServer match tyRes.TryGetToolTipEnhanced pos lineStr with | Ok(Some tooltipResult) -> logger.info ( - Log.setMessage "TryGetToolTipEnhanced : {parms}" - >> Log.addContextDestructured "parms" tooltipResult + Log.setMessage "TryGetToolTipEnhanced : {params}" + >> Log.addContextDestructured "params" tooltipResult ) let formatCommentStyle = @@ -958,8 +958,8 @@ type AdaptiveFSharpLspServer override x.TextDocumentPrepareRename p = asyncResult { logger.info ( - Log.setMessage "TextDocumentOnPrepareRename Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentOnPrepareRename Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -981,8 +981,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentRename Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentRename Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -1054,8 +1054,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentDefinition Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentDefinition Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -1084,8 +1084,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentTypeDefinition Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentTypeDefinition Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -1114,8 +1114,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentReferences Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentReferences Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -1150,8 +1150,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentDocumentHighlight Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentDocumentHighlight Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -1192,8 +1192,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentImplementation Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentImplementation Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -1202,8 +1202,8 @@ type AdaptiveFSharpLspServer and! tyRes = state.GetOpenFileTypeCheckResults filePath |> AsyncResult.ofStringErr logger.info ( - Log.setMessage "TextDocumentImplementation Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentImplementation Request: {params}" + >> Log.addContextDestructured "params" p ) let getProjectOptions file = state.GetProjectOptionsForFile file |> AsyncResult.bimap id failwith //? Should we fail here? @@ -1254,8 +1254,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentDocumentSymbol Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentDocumentSymbol Request: {params}" + >> Log.addContextDestructured "params" p ) let fn = p.TextDocument.GetFilePath() |> Utils.normalizePath @@ -1289,8 +1289,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "WorkspaceSymbol Request: {parms}" - >> Log.addContextDestructured "parms" symbolRequest + Log.setMessage "WorkspaceSymbol Request: {params}" + >> Log.addContextDestructured "params" symbolRequest ) let glyphToSymbolKind = state.GlyphToSymbolKind @@ -1332,8 +1332,8 @@ type AdaptiveFSharpLspServer let action () = logger.info ( - Log.setMessage "TextDocumentFormatting Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentFormatting Request: {params}" + >> Log.addContextDestructured "params" p ) let tryGetFileCheckerOptionsWithLines file = state.GetOpenFileSource file @@ -1374,8 +1374,8 @@ type AdaptiveFSharpLspServer let action () = logger.info ( - Log.setMessage "TextDocumentRangeFormatting Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentRangeFormatting Request: {params}" + >> Log.addContextDestructured "params" p ) let range = @@ -1424,8 +1424,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentCodeAction Request: {parms}" - >> Log.addContextDestructured "parms" codeActionParams + Log.setMessage "TextDocumentCodeAction Request: {params}" + >> Log.addContextDestructured "params" codeActionParams ) let (fixes: Async[]>) = @@ -1497,8 +1497,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentCodeLens Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentCodeLens Request: {params}" + >> Log.addContextDestructured "params" p ) let fn = p.TextDocument.GetFilePath() |> Utils.normalizePath @@ -1531,8 +1531,8 @@ type AdaptiveFSharpLspServer override __.CodeLensResolve(p: CodeLens) = // JB:TODO see how to reuse existing code logger.info ( - Log.setMessage "CodeLensResolve Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "CodeLensResolve Request: {params}" + >> Log.addContextDestructured "params" p ) let handler (f) (arg: CodeLens) : Async> = @@ -1622,7 +1622,7 @@ type AdaptiveFSharpLspServer return { p with Command = None } |> Some |> success | CoreResponse.Res(typ, parms, _) -> - let formatted = SigantureData.formatSignature typ parms + let formatted = SignatureData.formatSignature typ parms let cmd = { Title = formatted @@ -1687,8 +1687,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "WorkspaceDidChangeWatchedFiles Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "WorkspaceDidChangeWatchedFiles Request: {params}" + >> Log.addContextDestructured "params" p ) for c in p.Changes do @@ -1711,8 +1711,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "WorkspaceDidChangeConfiguration Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "WorkspaceDidChangeConfiguration Request: {params}" + >> Log.addContextDestructured "params" p ) let dto = p.Settings |> Server.deserialize @@ -1740,8 +1740,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentFoldingRange Request: {parms}" - >> Log.addContextDestructured "parms" rangeP + Log.setMessage "TextDocumentFoldingRange Request: {params}" + >> Log.addContextDestructured "params" rangeP ) let file = rangeP.TextDocument.GetFilePath() |> Utils.normalizePath @@ -1774,8 +1774,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentSelectionRange Request: {parms}" - >> Log.addContextDestructured "parms" selectionRangeP + Log.setMessage "TextDocumentSelectionRange Request: {params}" + >> Log.addContextDestructured "params" selectionRangeP ) let rec mkSelectionRanges = @@ -1820,8 +1820,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentSemanticTokensFull request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentSemanticTokensFull request: {params}" + >> Log.addContextDestructured "params" p ) let fn = p.TextDocument.GetFilePath() |> Utils.normalizePath @@ -1848,8 +1848,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentSemanticTokensRange request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentSemanticTokensRange request: {params}" + >> Log.addContextDestructured "params" p ) let fn = p.TextDocument.GetFilePath() |> Utils.normalizePath @@ -1874,8 +1874,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentInlayHint Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentInlayHint Request: {params}" + >> Log.addContextDestructured "params" p ) let filePath = p.TextDocument.GetFilePath() |> Utils.normalizePath @@ -1979,8 +1979,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "TextDocumentInlineValue Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "TextDocumentInlineValue Request: {params}" + >> Log.addContextDestructured "params" p ) let filePath = p.TextDocument.GetFilePath() |> Utils.normalizePath @@ -1995,9 +1995,9 @@ type AdaptiveFSharpLspServer let hints = pipelineHints - |> Array.map (fun (pos, linehints) -> + |> Array.map (fun (pos, lineHints) -> { InlineValueText.Range = fcsPosToProtocolRange pos - Text = linehints } + Text = lineHints } |> InlineValue.InlineValueText) |> Some @@ -2061,8 +2061,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "CallHierarchyIncomingCalls Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "CallHierarchyIncomingCalls Request: {params}" + >> Log.addContextDestructured "params" p ) let filePath = Path.FileUriToLocalPath p.Item.Uri |> Utils.normalizePath @@ -2144,8 +2144,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "CallHierarchyPrepareParams Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "CallHierarchyPrepareParams Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = @@ -2216,8 +2216,8 @@ type AdaptiveFSharpLspServer override x.FSharpLiterateRequest(p: FSharpLiterateRequest) = logger.info ( - Log.setMessage "FSharpLiterateRequest Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpLiterateRequest Request: {params}" + >> Log.addContextDestructured "params" p ) Helpers.notImplemented @@ -2230,8 +2230,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpSignature Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpSignature Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -2263,8 +2263,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpSignatureData Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpSignatureData Request: {params}" + >> Log.addContextDestructured "params" p ) let pos = @@ -2301,8 +2301,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpDocumentationGenerator Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpDocumentationGenerator Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -2354,14 +2354,14 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpLineLense Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpLineLense Request: {params}" + >> Log.addContextDestructured "params" p ) let fn = p.Project.GetFilePath() |> Utils.normalizePath match! state.GetDeclarations fn with - | None -> return! LspResult.internalError $"No declerations found for {fn}" + | None -> return! LspResult.internalError $"No declarations found for {fn}" | Some decls -> let decls = decls |> Array.map (fun d -> d, fn) @@ -2386,8 +2386,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpWorkspaceLoad Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpWorkspaceLoad Request: {params}" + >> Log.addContextDestructured "params" p ) let projs = @@ -2421,8 +2421,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpWorkspacePeek Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpWorkspacePeek Request: {params}" + >> Log.addContextDestructured "params" p ) let res = @@ -2457,8 +2457,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpProject Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpProject Request: {params}" + >> Log.addContextDestructured "params" p ) let paths = state.WorkspacePaths @@ -2493,8 +2493,8 @@ type AdaptiveFSharpLspServer override __.FSharpFsdn(p: FsdnRequest) = logger.info ( - Log.setMessage "FSharpFsdn Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpFsdn Request: {params}" + >> Log.addContextDestructured "params" p ) // Hasn't been online for a long time Helpers.notImplemented @@ -2506,8 +2506,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpDotnetNewList Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpDotnetNewList Request: {params}" + >> Log.addContextDestructured "params" p ) match! Commands.DotnetNewList() |> AsyncResult.ofCoreResponse with @@ -2533,8 +2533,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpDotnetNewRun Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpDotnetNewRun Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -2562,8 +2562,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpDotnetAddProject Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpDotnetAddProject Request: {params}" + >> Log.addContextDestructured "params" p ) if p.Target <> p.Reference then @@ -2592,8 +2592,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpDotnetRemoveProject Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpDotnetRemoveProject Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -2621,8 +2621,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpDotnetSlnAdd Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpDotnetSlnAdd Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -2650,8 +2650,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpHelp Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpHelp Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -2681,8 +2681,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpDocumentation Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpDocumentation Request: {params}" + >> Log.addContextDestructured "params" p ) let (filePath, pos) = getFilePathAndPosition p @@ -2716,15 +2716,15 @@ type AdaptiveFSharpLspServer return! returnException e } - override x.FSharpDocumentationSymbol(p: DocumentationForSymbolReuqest) = + override x.FSharpDocumentationSymbol(p: DocumentationForSymbolRequest) = asyncResult { - let tags = [ "DocumentationForSymbolReuqest", box p ] + let tags = [ "DocumentationForSymbolRequest", box p ] use trace = fsacActivitySource.StartActivityForType(thisType, tags = tags) try logger.info ( - Log.setMessage "FSharpDocumentationSymbol Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpDocumentationSymbol Request: {params}" + >> Log.addContextDestructured "params" p ) let! tyRes = @@ -2768,8 +2768,8 @@ type AdaptiveFSharpLspServer use trace = fsacActivitySource.StartActivityForType(thisType) logger.info ( - Log.setMessage "LoadAnalyzers Request: {parms}" - >> Log.addContextDestructured "parms" path + Log.setMessage "LoadAnalyzers Request: {params}" + >> Log.addContextDestructured "params" path ) try @@ -2790,8 +2790,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FSharpPipelineHints Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FSharpPipelineHints Request: {params}" + >> Log.addContextDestructured "params" p ) let filePath = p.TextDocument.GetFilePath() |> Utils.normalizePath @@ -2823,8 +2823,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FsProjMoveFileUp Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FsProjMoveFileUp Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -2853,8 +2853,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FsProjMoveFileDown Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FsProjMoveFileDown Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -2883,8 +2883,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FsProjAddFileAbove Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FsProjAddFileAbove Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -2912,8 +2912,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FsProjAddFileBelow Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FsProjAddFileBelow Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -2941,8 +2941,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FsProjRenameFile Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FsProjRenameFile Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -2971,8 +2971,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FsProjAddFile Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FsProjAddFile Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -3000,8 +3000,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FsProjRemoveFile Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FsProjRemoveFile Request: {params}" + >> Log.addContextDestructured "params" p ) let fullPath = Path.Combine(Path.GetDirectoryName p.FsProj, p.FileVirtualPath) @@ -3035,8 +3035,8 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "FsProjAddExistingFile Request: {parms}" - >> Log.addContextDestructured "parms" p + Log.setMessage "FsProjAddExistingFile Request: {params}" + >> Log.addContextDestructured "params" p ) do! @@ -3059,7 +3059,7 @@ type AdaptiveFSharpLspServer override x.Dispose() = disposables.Dispose() - member this.WorkDoneProgessCancel(token: ProgressToken) : Async = + member this.WorkDoneProgressCancel(token: ProgressToken) : Async = async { let tags = [ "ProgressToken", box token ] @@ -3067,15 +3067,15 @@ type AdaptiveFSharpLspServer try logger.info ( - Log.setMessage "WorkDoneProgessCancel Request: {parms}" - >> Log.addContextDestructured "parms" token + Log.setMessage "WorkDoneProgressCancel Request: {params}" + >> Log.addContextDestructured "params" token ) with e -> trace |> Tracing.recordException e logger.error ( - Log.setMessage "WorkDoneProgessCancel Request Errored {p}" + Log.setMessage "WorkDoneProgressCancel Request Errored {p}" >> Log.addContextDestructured "token" token >> Log.addExn e ) diff --git a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs index 073dd82d3..11c2daa98 100644 --- a/src/FsAutoComplete/LspServers/AdaptiveServerState.fs +++ b/src/FsAutoComplete/LspServers/AdaptiveServerState.fs @@ -1050,15 +1050,15 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac |> Async.map (Result.ofOption (fun () -> $"Could not read file: {file}")) do - let fileshimChanges = openFilesWithChanges |> AMap.mapA (fun _ v -> v) + let fileShimChanges = openFilesWithChanges |> AMap.mapA (fun _ v -> v) // let cachedFileContents = cachedFileContents |> cmap.mapA (fun _ v -> v) let filesystemShim file = - // GetLastWriteTimeShim gets called _alot_ and when we do checks on save we use Async.Parallel for type checking. + // GetLastWriteTimeShim gets called _a lot_ and when we do checks on save we use Async.Parallel for type checking. // Adaptive uses lots of locks under the covers, so many threads can get blocked waiting for data. // flattening openFilesWithChanges makes this check a lot quicker as it's not needing to recalculate each value. - fileshimChanges |> AMap.force |> HashMap.tryFind file + fileShimChanges |> AMap.force |> HashMap.tryFind file FSharp.Compiler.IO.FileSystemAutoOpens.FileSystem <- FileSystem(FSharp.Compiler.IO.FileSystemAutoOpens.FileSystem, filesystemShim) @@ -1117,11 +1117,11 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac let! projs = asyncOption { let! cts = tryGetOpenFileToken filePath - use lcts = CancellationTokenSource.CreateLinkedTokenSource(ctok, cts.Token) + use linkedCts = CancellationTokenSource.CreateLinkedTokenSource(ctok, cts.Token) let! opts = checker.GetProjectOptionsFromScript(filePath, file.Source, tfmConfig) - |> Async.withCancellation lcts.Token + |> Async.withCancellation linkedCts.Token opts |> scriptFileProjectOptions.Trigger @@ -1234,9 +1234,9 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac let autoCompleteNamespaces = autoCompleteItems - |> AMap.choose (fun name (d, pos, fn, getline, ast) -> + |> AMap.choose (fun name (d, pos, fn, getLine, ast) -> - Commands.calculateNamespaceInsert (fun () -> Some ast) d pos getline) + Commands.calculateNamespaceInsert (fun () -> Some ast) d pos getLine) let getAutoCompleteNamespacesByDeclName name = autoCompleteNamespaces |> AMap.tryFind name @@ -1373,11 +1373,11 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac asyncOption { let! opts = selectProject projectOptions let! cts = tryGetOpenFileToken file - use lcts = CancellationTokenSource.CreateLinkedTokenSource(ctok, cts.Token) + use linkedCts = CancellationTokenSource.CreateLinkedTokenSource(ctok, cts.Token) return! parseAndCheckFile checker info opts.FSharpProjectOptions true - |> Async.withCancellation lcts.Token + |> Async.withCancellation linkedCts.Token } }) @@ -1964,7 +1964,7 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac if isFileOpen filePath |> AVal.force then return () else - // We want to try to use the file system's datetime if available + // We want to try to use the file system's DateTime if available let file = VolatileFile.Create(sourceTextFactory.Create(filePath, text), version) updateOpenFiles file diff --git a/src/FsAutoComplete/LspServers/Common.fs b/src/FsAutoComplete/LspServers/Common.fs index b0dc991d9..cc256a613 100644 --- a/src/FsAutoComplete/LspServers/Common.fs +++ b/src/FsAutoComplete/LspServers/Common.fs @@ -213,7 +213,7 @@ module Helpers = Some { ResolveProvider = Some true TriggerCharacters = Some([| '.'; ''' |]) - AllCommitCharacters = None //TODO: what chars shoudl commit completions? + AllCommitCharacters = None //TODO: what chars should commit completions? CompletionItem = None } CodeLensProvider = Some { CodeLensOptions.ResolveProvider = Some true } CodeActionProvider = diff --git a/src/FsAutoComplete/LspServers/FSharpLspClient.fs b/src/FsAutoComplete/LspServers/FSharpLspClient.fs index ccfbc89fe..8c3634843 100644 --- a/src/FsAutoComplete/LspServers/FSharpLspClient.fs +++ b/src/FsAutoComplete/LspServers/FSharpLspClient.fs @@ -314,7 +314,7 @@ type ProgressListener(lspClient: FSharpLspClient, traceNamespace: string array) interface IAsyncDisposable with member this.DisposeAsync() : ValueTask = - // was getting a compile error for the statemachine in CI to `task` + // was getting a compile error for the state machine in CI to `task` async { if not isDisposed then isDisposed <- true diff --git a/src/FsAutoComplete/LspServers/IFSharpLspServer.fs b/src/FsAutoComplete/LspServers/IFSharpLspServer.fs index a48045c77..33cddc31b 100644 --- a/src/FsAutoComplete/LspServers/IFSharpLspServer.fs +++ b/src/FsAutoComplete/LspServers/IFSharpLspServer.fs @@ -34,7 +34,7 @@ type IFSharpLspServer = abstract FSharpDotnetSlnAdd: DotnetProjectRequest -> Async> abstract FSharpHelp: TextDocumentPositionParams -> Async> abstract FSharpDocumentation: TextDocumentPositionParams -> Async> - abstract FSharpDocumentationSymbol: DocumentationForSymbolReuqest -> Async> + abstract FSharpDocumentationSymbol: DocumentationForSymbolRequest -> Async> abstract FSharpLiterateRequest: FSharpLiterateRequest -> Async> abstract LoadAnalyzers: obj -> Async> abstract FSharpPipelineHints: FSharpPipelineHintRequest -> Async>