From 64bf650a234bff5cede04255e7579497b75845cb Mon Sep 17 00:00:00 2001 From: Artem Pyanykh Date: Thu, 7 Dec 2023 14:20:02 +0000 Subject: [PATCH] deps: Update fantomas and re-format --- .config/dotnet-tools.json | 4 +- Marksman/Ast.fs | 14 ++--- Marksman/CodeActions.fs | 2 +- Marksman/Compl.fs | 120 +++++++++++++++++++------------------- Marksman/Config.fs | 2 +- Marksman/Conn.fs | 12 ++-- Marksman/Cst.fs | 10 ++-- Marksman/Diag.fs | 20 +++---- Marksman/Doc.fs | 2 +- Marksman/Fatality.fs | 2 +- Marksman/Folder.fs | 12 ++-- Marksman/GitIgnore.fs | 2 +- Marksman/Index.fs | 4 +- Marksman/MMap.fs | 2 +- Marksman/Misc.fs | 4 +- Marksman/Names.fs | 2 +- Marksman/Parser.fs | 4 +- Marksman/Paths.fs | 4 +- Marksman/Program.fs | 3 +- Marksman/Refactor.fs | 24 ++++---- Marksman/Refs.fs | 32 +++++----- Marksman/Server.fs | 12 ++-- Marksman/State.fs | 2 +- Marksman/Syms.fs | 16 ++--- Marksman/Workspace.fs | 2 +- Tests/RefsTests.fs | 12 ++-- Tests/ServerTests.fs | 9 ++- fsharplint.json | 2 +- 28 files changed, 169 insertions(+), 167 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index d6f3062..5470b70 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,13 +3,13 @@ "isRoot": true, "tools": { "fantomas": { - "version": "5.0.0-beta-009", + "version": "6.2.3", "commands": [ "fantomas" ] }, "dotnet-fsharplint": { - "version": "0.21.2", + "version": "0.21.6", "commands": [ "dotnet-fsharplint" ] diff --git a/Marksman/Ast.fs b/Marksman/Ast.fs index 72c0b7b..8388146 100644 --- a/Marksman/Ast.fs +++ b/Marksman/Ast.fs @@ -53,13 +53,13 @@ type MdRef = member this.CompactFormat() = match this with - | Full (text, dest) -> $"[{text}][{dest}]" + | Full(text, dest) -> $"[{text}][{dest}]" | Collapsed dest -> $"[{dest}][]" | Shortcut dest -> $"[{dest}]" member this.Dest = match this with - | Full (_, dest) + | Full(_, dest) | Collapsed dest | Shortcut dest -> dest @@ -91,7 +91,7 @@ type Element = | Element.ML mdLink -> mdLink.CompactFormat() | Element.MR mdRef -> mdRef.CompactFormat() | Element.MLD mdLinkDef -> mdLinkDef.CompactFormat() - | Element.T (Tag tag) -> $"#{tag}" + | Element.T(Tag tag) -> $"#{tag}" module Element = let asHeading = @@ -143,13 +143,13 @@ module Element = None else Some(Syms.Sym.Ref(IntraRef(IntraSection <| Slug.ofString anchor))) - | Some (_, false), _ -> None - | Some (url, true), None -> + | Some(_, false), _ -> None + | Some(url, true), None -> if url.IsWhitespace() then None else Some(Syms.Sym.Ref(CrossRef(CrossDoc url))) - | Some (url, true), Some anchor -> + | Some(url, true), Some anchor -> if url.IsWhitespace() || anchor.IsWhitespace() then None else @@ -157,6 +157,6 @@ module Element = // The rest | Element.MR mdRef -> Some(Syms.Sym.Ref(IntraRef(IntraLinkDef mdRef.DestLabel))) | Element.MLD mdLinkDef -> Some(Syms.Sym.Def(Def.LinkDef(mdLinkDef.Label))) - | Element.T (Tag tag) -> Some(Syms.Sym.Tag(Syms.Tag tag)) + | Element.T(Tag tag) -> Some(Syms.Sym.Tag(Syms.Tag tag)) type Ast = { elements: Element[] } diff --git a/Marksman/CodeActions.fs b/Marksman/CodeActions.fs index 1fa96b5..2568895 100644 --- a/Marksman/CodeActions.fs +++ b/Marksman/CodeActions.fs @@ -132,7 +132,7 @@ let createMissingFile let! name = match doc.Structure |> Structure.Structure.tryFindSymbolForConcrete atPos with - | Some (Syms.Sym.Ref (Syms.CrossRef r)) -> Some r.Doc + | Some(Syms.Sym.Ref(Syms.CrossRef r)) -> Some r.Doc | _ -> None let! internPath = InternName.tryAsPath { name = name; src = doc.Id } diff --git a/Marksman/Compl.fs b/Marksman/Compl.fs index 50d5e42..5bd24df 100644 --- a/Marksman/Compl.fs +++ b/Marksman/Compl.fs @@ -33,12 +33,11 @@ type PartialElement = override this.ToString() = match this with - | PartialElement.WikiLink (dest, heading, range) -> + | PartialElement.WikiLink(dest, heading, range) -> $"WL {range}: dest={Node.fmtOptWiki dest}; heading={Node.fmtOptWiki heading}" - | PartialElement.InlineLink (text, path, anchor, range) -> + | PartialElement.InlineLink(text, path, anchor, range) -> $"IL {range}: text={Node.fmtOptText text}; path={Node.fmtOptUrl path}; anchor={Node.fmtOptUrl anchor}" - | PartialElement.ReferenceLink (label, range) -> - $"RL {range}: label={Node.fmtOptText label}" + | PartialElement.ReferenceLink(label, range) -> $"RL {range}: label={Node.fmtOptText label}" | TagOpening pos -> $"TO: cursorPos={pos}" module PartialElement = @@ -46,9 +45,9 @@ module PartialElement = let range = function - | PartialElement.WikiLink (_, _, range) - | PartialElement.InlineLink (_, _, _, range) - | PartialElement.ReferenceLink (_, range) -> range + | PartialElement.WikiLink(_, _, range) + | PartialElement.InlineLink(_, _, _, range) + | PartialElement.ReferenceLink(_, range) -> range | PartialElement.TagOpening cursorPos -> { Start = cursorPos; End = cursorPos } // empty range let linkInLine (line: Line) (pos: Position) : option = @@ -287,26 +286,25 @@ module Prompt = else match compl with // No completion - | E (H _) - | E (MLD _) - | E (YML _) -> None + | E(H _) + | E(MLD _) + | E(YML _) -> None // Wiki link - | E (WL { data = { doc = doc; heading = None } }) -> + | E(WL { data = { doc = doc; heading = None } }) -> Some(WikiDoc(Node.textOpt doc String.Empty)) - | E (WL { data = { doc = None; heading = Some heading } }) -> + | E(WL { data = { doc = None; heading = Some heading } }) -> Some(WikiHeadingInSrcDoc heading.text) - | E (WL { data = { doc = Some doc; heading = Some heading } }) -> + | E(WL { data = { doc = Some doc; heading = Some heading } }) -> if doc.range.ContainsInclusive(pos) then Some(WikiDoc doc.text) else Some(WikiHeadingInOtherDoc(doc.text, heading.text)) // Markdown link - | E (ML { data = MdLink.RF (_, label) }) - | E (ML { data = MdLink.RC label }) - | E (ML { data = MdLink.RS label }) -> Some(Reference label.text) - | E (ML { data = MdLink.IL (_, None, _); range = _range }) -> - Some(InlineDoc String.Empty) - | E (ML { data = MdLink.IL (_, Some url, _) }) -> + | E(ML { data = MdLink.RF(_, label) }) + | E(ML { data = MdLink.RC label }) + | E(ML { data = MdLink.RS label }) -> Some(Reference label.text) + | E(ML { data = MdLink.IL(_, None, _); range = _range }) -> Some(InlineDoc String.Empty) + | E(ML { data = MdLink.IL(_, Some url, _) }) -> match Url.ofUrlNode url with | { url = path; anchor = None } -> Some(InlineDoc(Node.textOpt path String.Empty)) | { url = None; anchor = Some anchor } -> Some(InlineAnchorInSrcDoc anchor.text) @@ -316,24 +314,24 @@ module Prompt = else Some(InlineAnchorInOtherDoc(path.text, anchor.text)) // Partial wiki link - | PE (PartialElement.WikiLink (doc, None, _)) -> + | PE(PartialElement.WikiLink(doc, None, _)) -> Some(WikiDoc(Node.textOpt doc String.Empty)) - | PE (PartialElement.WikiLink (None, heading, _)) -> + | PE(PartialElement.WikiLink(None, heading, _)) -> Some(WikiHeadingInSrcDoc(Node.textOpt heading String.Empty)) - | PE (PartialElement.WikiLink (Some dest, Some heading, _)) -> + | PE(PartialElement.WikiLink(Some dest, Some heading, _)) -> Some(WikiHeadingInOtherDoc(dest.text, heading.text)) // Partial markdown link - | PE (PartialElement.InlineLink (_, path, None, _)) -> + | PE(PartialElement.InlineLink(_, path, None, _)) -> Some(InlineDoc(Node.textOpt path String.Empty)) - | PE (PartialElement.InlineLink (_, None, anchor, _)) -> + | PE(PartialElement.InlineLink(_, None, anchor, _)) -> Some(InlineAnchorInSrcDoc(Node.textOpt anchor String.Empty)) - | PE (PartialElement.InlineLink (_, Some path, Some anchor, _)) -> + | PE(PartialElement.InlineLink(_, Some path, Some anchor, _)) -> Some(InlineAnchorInOtherDoc(path.text, anchor.text)) - | PE (PartialElement.ReferenceLink (label, _)) -> + | PE(PartialElement.ReferenceLink(label, _)) -> Some(Reference(Node.textOpt label String.Empty)) // Tags - | E (T { data = { name = name } }) -> Some(Tag name.text) - | PE (PartialElement.TagOpening _) -> Some(Tag String.Empty) + | E(T { data = { name = name } }) -> Some(Tag name.text) + | PE(PartialElement.TagOpening _) -> Some(Tag String.Empty) module CompletionHelpers = let wikiTargetLink (config: Config) (doc: Doc) : WikiDest = @@ -362,8 +360,8 @@ module Completions = let targetLink = CompletionHelpers.wikiTargetLink config doc match compl with - | E (WL { data = { doc = input; heading = heading }; range = range }) - | PE (PartialElement.WikiLink (input, heading, range)) -> + | E(WL { data = { doc = input; heading = heading }; range = range }) + | PE(PartialElement.WikiLink(input, heading, range)) -> let inputRange = input |> Option.map Node.range @@ -412,8 +410,8 @@ module Completions = (completionHeading: string) : option = match compl with - | E (WL { data = { doc = None; heading = Some input }; range = range }) - | PE (PartialElement.WikiLink (None, Some input, range)) -> + | E(WL { data = { doc = None; heading = Some input }; range = range }) + | PE(PartialElement.WikiLink(None, Some input, range)) -> let newText = WikiLink.render None @@ -438,9 +436,9 @@ module Completions = let label = $"{Doc.name doc} / {heading}" match compl with - | E (WL { data = { doc = Some destPart; heading = Some headingPart } - range = range }) - | PE (PartialElement.WikiLink (Some destPart, Some headingPart, range)) -> + | E(WL { data = { doc = Some destPart; heading = Some headingPart } + range = range }) + | PE(PartialElement.WikiLink(Some destPart, Some headingPart, range)) -> let targetLink = CompletionHelpers.wikiTargetLink config doc let newText = @@ -474,15 +472,15 @@ module Completions = let reference (pos: Position) (compl: Completable) (def: MdLinkDef) : option = let data = match compl with - | E (ML { data = MdLink.RF (_, label); range = range }) - | E (ML { data = MdLink.RC label; range = range }) - | E (ML { data = MdLink.RS label; range = range }) -> Some(Some label, range) - | PE (PartialElement.ReferenceLink (label, range)) -> Some(label, range) + | E(ML { data = MdLink.RF(_, label); range = range }) + | E(ML { data = MdLink.RC label; range = range }) + | E(ML { data = MdLink.RS label; range = range }) -> Some(Some label, range) + | PE(PartialElement.ReferenceLink(label, range)) -> Some(label, range) | _ -> None match data with | None -> None - | Some (label, range) -> + | Some(label, range) -> let labelRange = label |> Option.map Node.range @@ -514,13 +512,13 @@ module Completions = Some(Doc.name doc) |> Option.filter (fun x -> x <> targetPath) match compl with - | E (ML { data = MdLink.IL (_, None, _) }) -> + | E(ML { data = MdLink.IL(_, None, _) }) -> Some { CompletionItem.Create(targetPath) with Detail = detail TextEdit = Some(First { Range = Range.Mk(pos, pos); NewText = targetPathEncoded }) } - | E (ML { data = MdLink.IL (_, Some url, _) }) -> + | E(ML { data = MdLink.IL(_, Some url, _) }) -> match Url.ofUrlNode url with | { url = Some url } -> Some @@ -528,7 +526,7 @@ module Completions = Detail = detail TextEdit = Some(First { Range = url.range; NewText = targetPathEncoded }) } | _ -> None - | PE (PartialElement.InlineLink (Some _text, path, Some _anchor, _range)) -> + | PE(PartialElement.InlineLink(Some _text, path, Some _anchor, _range)) -> let range = path |> Option.map Node.range @@ -538,7 +536,7 @@ module Completions = { CompletionItem.Create(targetPath) with Detail = detail TextEdit = Some(First { Range = range; NewText = targetPathEncoded }) } - | PE (PartialElement.InlineLink (Some text, _path, None, range)) -> + | PE(PartialElement.InlineLink(Some text, _path, None, range)) -> let newText = MdLink.renderInline (Node.text text |> Some) (Some targetPathEncoded) None @@ -557,7 +555,7 @@ module Completions = let headingSlug = Slug.str completionHeading match compl with - | E (ML { data = MdLink.IL (_, Some url, _) }) -> + | E(ML { data = MdLink.IL(_, Some url, _) }) -> let url = Url.ofUrlNode url match url with @@ -569,7 +567,7 @@ module Completions = TextEdit = Some(First { Range = anchor.range; NewText = newText }) FilterText = Some newText } | _ -> None - | PE (PartialElement.InlineLink (Some text, None, Some _anchor, range)) -> + | PE(PartialElement.InlineLink(Some text, None, Some _anchor, range)) -> let newText = $"[{text.text}](#{headingSlug})" Some @@ -591,7 +589,7 @@ module Completions = Some(Doc.name targetDoc) |> Option.filter (fun x -> x <> targetPath) match compl with - | E (ML { data = MdLink.IL (_, Some url, _) }) -> + | E(ML { data = MdLink.IL(_, Some url, _) }) -> let url = Url.ofUrlNode url match url.url, url.anchor with @@ -606,7 +604,7 @@ module Completions = TextEdit = Some(First { Range = newRange; NewText = newText }) FilterText = Some filterText } | _, _ -> None - | PE (PartialElement.InlineLink (Some text, Some _path, Some _anchor, range)) -> + | PE(PartialElement.InlineLink(Some text, Some _path, Some _anchor, range)) -> let newText = $"[{text.text}]({targetPathEncoded}#{Slug.str targetHeading})" @@ -627,8 +625,8 @@ module Completions = : option = let range = match compl with - | E (T { data = { name = name } }) -> Some(Node.range name) - | PE (PartialElement.TagOpening _ as peTag) -> Some(PartialElement.range peTag) + | E(T { data = { name = name } }) -> Some(Node.range name) + | PE(PartialElement.TagOpening _ as peTag) -> Some(PartialElement.range peTag) | _ -> None match range with @@ -718,7 +716,8 @@ let findCompletableAtPos (doc: Doc) (pos: Position) : option = Doc.index doc |> Index.tags // Inclusive because we want to cover cases when the cursor is right after the tag's end - |> Array.tryFind (fun { data = { name = name } } -> (Node.range name).ContainsInclusive(pos)) + |> Array.tryFind (fun { data = { name = name } } -> + (Node.range name).ContainsInclusive(pos)) |> Option.map (T >> E) let partialElement () = PartialElement.inText (Doc.text doc) pos |> Option.map PE @@ -731,8 +730,7 @@ let findCompletableAtPos (doc: Doc) (pos: Position) : option = | Some _ as link -> link | _ -> match partialElement () with - | Some (PE (PartialElement.TagOpening _)) as tagOpening -> - tag () |> Option.orElse tagOpening + | Some(PE(PartialElement.TagOpening _)) as tagOpening -> tag () |> Option.orElse tagOpening | Some _ as partialElement -> partialElement | None -> tag () @@ -747,18 +745,18 @@ let findCandidatesForCompl match Prompt.ofCompletable pos compl with | None -> [||] - | Some (WikiDoc input) -> + | Some(WikiDoc input) -> let destPart = Some(InternName.mkUnchecked (Doc.id srcDoc) input) let cand = Candidates.findDocCandidates folder srcDoc destPart cand |> Seq.choose (Completions.wikiDoc config pos compl) - | Some (WikiHeadingInSrcDoc input) -> + | Some(WikiHeadingInSrcDoc input) -> let cand = Candidates.findHeadingCandidates folder srcDoc None input cand |> Seq.map snd |> Seq.choose (Completions.wikiHeadingInSrcDoc (config.ComplWikiStyle()) pos compl) - | Some (WikiHeadingInOtherDoc (destPart, headingPart)) -> + | Some(WikiHeadingInOtherDoc(destPart, headingPart)) -> let destPart = Some(InternName.mkUnchecked (Doc.id srcDoc) destPart) let cand = @@ -766,10 +764,10 @@ let findCandidatesForCompl cand |> Seq.choose (Completions.wikiHeadingInOtherDoc config pos compl) - | Some (Reference input) -> + | Some(Reference input) -> let cand = Candidates.findLinkDefCandidates folder srcDoc input cand |> Seq.choose (Completions.reference pos compl) - | Some (InlineDoc input) -> + | Some(InlineDoc input) -> let cand = match InternName.mkChecked (config.CoreMarkdownFileExtensions()) (Doc.id srcDoc) input @@ -779,13 +777,13 @@ let findCandidatesForCompl | Some destPart -> Candidates.findDocCandidates folder srcDoc (Some destPart) cand |> Seq.choose (Completions.inlineDoc pos compl) - | Some (InlineAnchorInSrcDoc input) -> + | Some(InlineAnchorInSrcDoc input) -> let cand = Candidates.findHeadingCandidates folder srcDoc None input cand |> Seq.map snd |> Seq.choose (Completions.inlineAnchorInSrcDoc pos compl) - | Some (InlineAnchorInOtherDoc (pathPart, anchorPart)) -> + | Some(InlineAnchorInOtherDoc(pathPart, anchorPart)) -> let cand = match InternName.mkChecked (config.CoreMarkdownFileExtensions()) (Doc.id srcDoc) pathPart @@ -795,7 +793,7 @@ let findCandidatesForCompl Candidates.findHeadingCandidates folder srcDoc (Some destPart) anchorPart cand |> Seq.choose (Completions.inlineAnchorInOtherDoc pos compl) - | Some (Tag input) -> + | Some(Tag input) -> let cand = Candidates.findTagCandidates folder srcDoc input cand |> Seq.choose (Completions.tag pos compl input) diff --git a/Marksman/Config.fs b/Marksman/Config.fs index 820db0b..bc681a5 100644 --- a/Marksman/Config.fs +++ b/Marksman/Config.fs @@ -76,7 +76,7 @@ let private getFromTable<'R> let private lookupAsOpt = function | Ok found -> Ok(Some found) - | Error (NotFound _) -> Ok None + | Error(NotFound _) -> Ok None | Error err -> Error err let private getFromTableOpt<'R> table revSeenPath remPath : Result, LookupError> = diff --git a/Marksman/Conn.fs b/Marksman/Conn.fs index e45c81c..107ce89 100644 --- a/Marksman/Conn.fs +++ b/Marksman/Conn.fs @@ -29,9 +29,9 @@ type Unresolved = member this.CompactFormat() = match this with - | Ref (scope, ref) -> $"{ref} @ {scope}" + | Ref(scope, ref) -> $"{ref} @ {scope}" | Scope FullyUnknown -> "FullyUnknown" - | Scope (InScope scope) -> $"{scope}" + | Scope(InScope scope) -> $"{scope}" type ConnDifference = { refsDifference: MMapDifference @@ -227,7 +227,7 @@ module Conn = let addUnresolvedRefToQueue = function - | Unresolved.Ref (scope, ref) -> toResolveSet <- Set.add (scope, ref) toResolveSet + | Unresolved.Ref(scope, ref) -> toResolveSet <- Set.add (scope, ref) toResolveSet | Unresolved.Scope _ -> () // Start by removing tags as they have little effect on the overall structure @@ -314,21 +314,21 @@ module Conn = toResolveSet <- Set.add (scope, ref) toResolveSet match ref with - | CrossRef (CrossSection (doc, _) as sectionRef) -> + | CrossRef(CrossSection(doc, _) as sectionRef) -> // When we get a cross-section ref we need to synthesize a CrossDoc ref // and record a dependency. This way composite links like [[A#B]] will be // properly invalidated when title "A" changes let docRef = CrossDoc doc toResolveSet <- Set.add (scope, CrossRef docRef) toResolveSet refDeps <- Graph.addEdge (scope, docRef) (scope, sectionRef) refDeps - | CrossRef (CrossDoc _) + | CrossRef(CrossDoc _) | IntraRef _ -> () | Sym.Def def -> defs <- MMap.add scope def defs match def with | Doc - | Header (1, _) -> + | Header(1, _) -> // Whenever a new title is added, links that were previously pointing at the Doc // or the other titles need to be invalidate let affectedDefs = diff --git a/Marksman/Cst.fs b/Marksman/Cst.fs index 776abb9..d59f1f8 100644 --- a/Marksman/Cst.fs +++ b/Marksman/Cst.fs @@ -160,12 +160,12 @@ module Url = module MdLink = let fmt (ml: MdLink) : string = match ml with - | MdLink.IL (label, url, title) -> + | MdLink.IL(label, url, title) -> let fmtLabel = Node.fmtText label let fmtUrl = Option.map Node.fmtUrl url |> Option.defaultValue "∅" let fmtTitle = Option.map Node.fmtText title |> Option.defaultValue "∅" $"IL: label={fmtLabel}; url={fmtUrl}; title={fmtTitle}" - | MdLink.RF (text, label) -> + | MdLink.RF(text, label) -> let fmtText = Node.fmtText text let fmtLabel = Node.fmtText label $"RF: text={fmtText}; label={fmtLabel}" @@ -178,7 +178,7 @@ module MdLink = let referenceLabel = function - | MdLink.RF (_, label) + | MdLink.RF(_, label) | MdLink.RC label | MdLink.RS label -> Some label | MdLink.IL _ -> None @@ -369,7 +369,7 @@ module Element = Ast.Element.WL { doc = doc; heading = heading } |> Some | ML { data = mdLink } -> match mdLink with - | MdLink.IL (text, url, _) -> + | MdLink.IL(text, url, _) -> let urlNode = url |>> Url.ofUrlNode let url = @@ -381,7 +381,7 @@ module Element = Ast.Element.ML { text = text.text; url = url; anchor = anchor } |> Some - | MdLink.RF (text, label) -> Ast.Element.MR(Ast.Full(text.text, label.text)) |> Some + | MdLink.RF(text, label) -> Ast.Element.MR(Ast.Full(text.text, label.text)) |> Some | MdLink.RC label -> Ast.Element.MR(Ast.Collapsed(label.text)) |> Some | MdLink.RS label -> Ast.Element.MR(Ast.Shortcut(label.text)) |> Some | MLD { data = mdDef } -> MdLinkDef.toAbstract mdDef |> Ast.Element.MLD |> Some diff --git a/Marksman/Diag.fs b/Marksman/Diag.fs index f2b9e27..5729d3f 100644 --- a/Marksman/Diag.fs +++ b/Marksman/Diag.fs @@ -68,7 +68,7 @@ let checkLink (folder: Folder) (doc: Doc) (linkEl: Element) : seq = // Inline shortcut links often are a part of regular text. // Raising diagnostics on them would be noisy. | ML { data = MdLink.RS _ } -> [] - | ML { data = MdLink.IL (_, url, _) } -> + | ML { data = MdLink.IL(_, url, _) } -> match url with | Some { data = url } -> // Inline links to docs that don't look like a markdown file should not @@ -102,24 +102,24 @@ let checkFolder (folder: Folder) : seq> = let destToHuman (ref: Dest) : string = match ref with | Dest.Doc { doc = doc } -> $"document {Doc.name doc}" - | Dest.Heading (docLink, { data = heading }) -> + | Dest.Heading(docLink, { data = heading }) -> $"heading {Heading.name heading} in the document {Doc.name (DocLink.doc docLink)}" - | Dest.LinkDef (_, { data = ld }) -> $"link definition {MdLinkDef.name ld}" - | Dest.Tag (doc, { data = tag }) -> $"tag {tag.name} in the document {Doc.name doc}" + | Dest.LinkDef(_, { data = ld }) -> $"link definition {MdLinkDef.name ld}" + | Dest.Tag(doc, { data = tag }) -> $"tag {tag.name} in the document {Doc.name doc}" let docToHuman (name: string) : string = $"document '{name}'" let refToHuman (ref: Syms.Ref) : string = match ref with - | Syms.CrossRef (Syms.CrossDoc docName) -> docToHuman docName - | Syms.CrossRef (Syms.CrossSection (docName, sectionName)) -> + | Syms.CrossRef(Syms.CrossDoc docName) -> docToHuman docName + | Syms.CrossRef(Syms.CrossSection(docName, sectionName)) -> $"heading '{Slug.toString sectionName}' in {docToHuman docName}" - | Syms.IntraRef (Syms.IntraSection heading) -> $"heading '{Slug.toString heading}'" - | Syms.IntraRef (Syms.IntraLinkDef ld) -> $"link definition with the label '{ld}'" + | Syms.IntraRef(Syms.IntraSection heading) -> $"heading '{Slug.toString heading}'" + | Syms.IntraRef(Syms.IntraLinkDef ld) -> $"link definition with the label '{ld}'" let diagToLsp (diag: Entry) : Lsp.Diagnostic = match diag with - | AmbiguousLink (el, ref, dests) -> + | AmbiguousLink(el, ref, dests) -> let severity = match el with | WL _ -> Lsp.DiagnosticSeverity.Error @@ -145,7 +145,7 @@ let diagToLsp (diag: Entry) : Lsp.Diagnostic = RelatedInformation = Some related Tags = None Data = None } - | BrokenLink (el, ref) -> + | BrokenLink(el, ref) -> let severity = match el with | WL _ -> Lsp.DiagnosticSeverity.Error diff --git a/Marksman/Doc.fs b/Marksman/Doc.fs index 2ee5cb2..d5972d3 100644 --- a/Marksman/Doc.fs +++ b/Marksman/Doc.fs @@ -165,7 +165,7 @@ module Doc = // so that the difference of symbols is consistent with what // Conn expects in terms of dependencies between symbols. match s with - | Syms.Sym.Ref (CrossRef (CrossSection (docName, _))) -> + | Syms.Sym.Ref(CrossRef(CrossSection(docName, _))) -> yield Syms.Sym.Ref(CrossRef(CrossDoc docName)) | _ -> () diff --git a/Marksman/Fatality.fs b/Marksman/Fatality.fs index 056a109..7517f65 100644 --- a/Marksman/Fatality.fs +++ b/Marksman/Fatality.fs @@ -7,7 +7,7 @@ open Marksman.State open Marksman.Workspace let abort (stateOpt: Option) (ex: exn) = - let marksmanAssembly = typeof.Assembly.GetName () + let marksmanAssembly = typeof.Assembly.GetName() let clientDebugOut ({ Name = name; Version = versionOpt }: ClientInfo) = eprintf $"Client: {name}" diff --git a/Marksman/Folder.fs b/Marksman/Folder.fs index f25e3fb..cdb2eac 100644 --- a/Marksman/Folder.fs +++ b/Marksman/Folder.fs @@ -168,7 +168,7 @@ module Oracle = : seq = match path with | ExactAbs rooted - | ExactRel (_, rooted) -> + | ExactRel(_, rooted) -> FolderData.tryFindDocByRelPath (RootedRelPath.relPathForced rooted) data |> Option.toList |> Seq.ofList @@ -207,7 +207,7 @@ module Oracle = let destStruct = Doc.structure destDoc match ref with - | Ref.CrossRef (CrossDoc _) -> + | Ref.CrossRef(CrossDoc _) -> let titles = Structure.symbols destStruct |> Seq.choose Sym.asDef @@ -215,13 +215,13 @@ module Oracle = |> Seq.toArray if Array.isEmpty titles then [| Doc |] else titles - | Ref.CrossRef (CrossSection (_, section)) - | Ref.IntraRef (IntraSection section) -> + | Ref.CrossRef(CrossSection(_, section)) + | Ref.IntraRef(IntraSection section) -> Structure.symbols destStruct |> Seq.choose Sym.asDef |> Seq.filter (Def.isHeaderWithId (Slug.toString section)) |> Seq.toArray - | Ref.IntraRef (IntraLinkDef label) -> + | Ref.IntraRef(IntraLinkDef label) -> Structure.symbols destStruct |> Seq.choose Sym.asDef |> Seq.filter (Def.isLinkDefWithLabel label) @@ -572,7 +572,7 @@ module Folder = Conn.Conn.mk (Oracle.oracle data lookup) (FolderData.syms data) { data = data; lookup = lookup; conn = conn } - | SingleFile ({ doc = existingDoc } as folder) -> + | SingleFile({ doc = existingDoc } as folder) -> if newDoc.Id <> existingDoc.Id then failwith $"Updating a singleton folder with an unrelated doc: folder={existingDoc.RootPath}; doc={newDoc.RootPath}" diff --git a/Marksman/GitIgnore.fs b/Marksman/GitIgnore.fs index 7fcdc96..3619d67 100644 --- a/Marksman/GitIgnore.fs +++ b/Marksman/GitIgnore.fs @@ -64,7 +64,7 @@ module GlobMatcher = match matcher.patterns |> Seq.map checkGlob |> Seq.tryFind Option.isSome with | None -> false - | Some (Some r) -> r + | Some(Some r) -> r | Some None -> failwith "Unreachable: GlobMatcher.ignores" let ignoresAny (matchers: seq) (path: string) : bool = diff --git a/Marksman/Index.fs b/Marksman/Index.fs index 9590836..14da94b 100644 --- a/Marksman/Index.fs +++ b/Marksman/Index.fs @@ -36,7 +36,7 @@ module Index = if not (headingsBySlug.ContainsKey(slug)) then headingsBySlug[slug] <- ResizeArray() - headingsBySlug[ slug ].Add(hn) + headingsBySlug[slug].Add(hn) if Heading.isTitle hn.data then titles.Add(hn) @@ -50,7 +50,7 @@ module Index = let headingsBySlug = seq { - for KeyValue (slug, headings) in headingsBySlug do + for KeyValue(slug, headings) in headingsBySlug do yield slug, headings |> List.ofSeq } |> Map.ofSeq diff --git a/Marksman/MMap.fs b/Marksman/MMap.fs index 5e657f9..9075bfa 100644 --- a/Marksman/MMap.fs +++ b/Marksman/MMap.fs @@ -90,7 +90,7 @@ module MMap = let toSeq (MMap m) = seq { - for KeyValue (k, vs) in m do + for KeyValue(k, vs) in m do for v in vs do yield (k, v) } diff --git a/Marksman/Misc.fs b/Marksman/Misc.fs index b801980..3f7193b 100644 --- a/Marksman/Misc.fs +++ b/Marksman/Misc.fs @@ -8,7 +8,7 @@ open System.Text.RegularExpressions open Ionide.LanguageServerProtocol.Types -let flip (f: 'a -> 'b -> 'c) : 'b -> 'a -> 'c = fun b a -> f a b +let flip (f: 'A -> 'B -> 'C) : 'B -> 'A -> 'C = fun b a -> f a b let lineEndings = [| "\r\n"; "\n" |] @@ -267,7 +267,7 @@ type Indented<'A> = | Indented of int * 'A override this.ToString() = - let (Indented (indent, inner)) = this + let (Indented(indent, inner)) = this let lines = seq { diff --git a/Marksman/Names.fs b/Marksman/Names.fs index 36ffc8a..4e72751 100644 --- a/Marksman/Names.fs +++ b/Marksman/Names.fs @@ -88,7 +88,7 @@ module InternPath = let toRel = function | ExactAbs rooted - | ExactRel (_, rooted) -> RootedRelPath.relPathForced rooted + | ExactRel(_, rooted) -> RootedRelPath.relPathForced rooted | Approx path -> path module InternName = diff --git a/Marksman/Parser.fs b/Marksman/Parser.fs index 30655d0..317f7b4 100644 --- a/Marksman/Parser.fs +++ b/Marksman/Parser.fs @@ -442,7 +442,7 @@ module Markdown = |> Array.fold processEl [] |> List.iter (fun (idx, _) -> scopeMap.Add(idx, text.EndRange().Start)) // Update header scopes - for KeyValue (headerIdx, scopeEnd) in scopeMap do + for KeyValue(headerIdx, scopeEnd) in scopeMap do match outputElements[headerIdx] with | H header -> let newScope = { Start = header.data.scope.Start; End = scopeEnd } @@ -453,7 +453,7 @@ module Markdown = let childMap = seq { - for KeyValue (parentId, childIds) in childMap do + for KeyValue(parentId, childIds) in childMap do let children = childIds.ToArray() |> Array.map (fun i -> outputElements[i]) diff --git a/Marksman/Paths.fs b/Marksman/Paths.fs index 35e9a57..da1e892 100644 --- a/Marksman/Paths.fs +++ b/Marksman/Paths.fs @@ -109,8 +109,8 @@ and LocalPath = member this.Raw: string = match this with - | Abs (AbsPath str) - | Rel (RelPath str) -> str + | Abs(AbsPath str) + | Rel(RelPath str) -> str module AbsPath = let isRawWinAbsPath str = String.length str >= 2 && Char.IsLetter(str[0]) && str[1] = ':' diff --git a/Marksman/Program.fs b/Marksman/Program.fs index 43b6d33..b91c836 100644 --- a/Marksman/Program.fs +++ b/Marksman/Program.fs @@ -23,8 +23,7 @@ let configureLogging (verbosity: int) : unit = | _ -> loggerConfig.MinimumLevel.Verbose() Log.Logger <- - loggerConfig - .WriteTo + loggerConfig.WriteTo .Console( outputTemplate = "[{Timestamp:HH:mm:ss} {Level:u3}] <{SourceContext}> {Message:lj}: {Properties:lj}{NewLine}{Exception}", diff --git a/Marksman/Refactor.fs b/Marksman/Refactor.fs index 5fd46d7..5469461 100644 --- a/Marksman/Refactor.fs +++ b/Marksman/Refactor.fs @@ -36,7 +36,7 @@ let groupByFirst pairs = Seq.groupBy fst pairs |> Seq.map (fun (key, value) -> key, Set.ofSeq (Seq.map snd value) |> Set.toSeq) -let groupByFirst2 (triples: seq<'a * 'b * 'c>) : seq<'a * seq<'b * 'c>> = +let groupByFirst2 (triples: seq<'A * 'B * 'C>) : seq<'A * seq<'B * 'C>> = let grouped = Seq.groupBy (fun (k, _, _) -> k) triples let takeUnique23 triples = triples |> Seq.map (fun (_, b, c) -> b, c) |> Seq.distinct @@ -95,16 +95,16 @@ let renameHeadingLink failwith $"Internal error: heading without a symbol: {srcHeading}") match targetDoc.Structure |> Structure.tryFindSymbolForConcrete targetEl with - | Some (Sym.Ref (CrossRef (CrossDoc docName))) -> + | Some(Sym.Ref(CrossRef(CrossDoc docName))) -> let linkKind = FileLinkKind.detect complStyle targetDoc.Id docName srcDoc linkKind = FileLinkKind.Title && Slug.equalStrings srcId docName - | Some (Sym.Ref (CrossRef (CrossSection (docName, sectionName)))) -> + | Some(Sym.Ref(CrossRef(CrossSection(docName, sectionName)))) -> if Element.isTitle srcHeading then let linkKind = FileLinkKind.detect complStyle targetDoc.Id docName srcDoc linkKind = FileLinkKind.Title && Slug.equalStrings srcId docName else Slug.ofString srcId = sectionName - | Some (Sym.Ref (IntraRef (IntraSection sectionName))) -> Slug.ofString srcId = sectionName + | Some(Sym.Ref(IntraRef(IntraSection sectionName))) -> Slug.ofString srcId = sectionName | _ -> false if shouldRename then @@ -115,7 +115,7 @@ let renameHeadingLink toEdit |> Option.map (fun node -> { Range = node.range; NewText = WikiEncoded.encodeAsString newTitle }) - | ML { data = MdLink.IL (_, url, _) } -> + | ML { data = MdLink.IL(_, url, _) } -> let docUrl = url |> Option.map Url.ofUrlNode let toEdit = @@ -159,7 +159,7 @@ let combineDocumentEdits (e1s: array) (e2s: array Map.tryFind doc |> Option.defaultValue [||] let combined = Array.append existing additionalEdits larger <- Map.add doc combined larger @@ -178,7 +178,7 @@ let rename : RenameResult = match Cst.elementAtPos pos (Doc.cst srcDoc) with | None -> Skip - | Some (ML link as el) -> + | Some(ML link as el) -> // Reference Links match MdLink.referenceLabel link.data with | None -> Skip @@ -198,7 +198,7 @@ let rename Edit workspaceEdit else Skip - | Some (MLD { data = def } as el) -> + | Some(MLD { data = def } as el) -> if not (isValidLabel newName) then Error $"Not a valid label name: {newName}" else if (MdLinkDef.label def).range.ContainsInclusive pos then @@ -213,7 +213,7 @@ let rename Edit workspaceEdit else Skip - | Some (H { data = heading } as el) -> + | Some(H { data = heading } as el) -> if not (isValidLabel newName) then Error $"Not a valid title: {newName}" else if heading.title.range.ContainsInclusive pos then @@ -245,16 +245,16 @@ let rename let renameRange (srcDoc: Doc) (pos: Position) : option = match Cst.elementAtPos pos (Doc.cst srcDoc) with | None -> None - | Some (ML link) -> + | Some(ML link) -> match MdLink.referenceLabel link.data with | None -> None | Some label -> if label.range.ContainsInclusive pos then Some label.range else None - | Some (MLD { data = def }) -> + | Some(MLD { data = def }) -> if (MdLinkDef.label def).range.ContainsInclusive pos then Some (MdLinkDef.label def).range else None - | Some (H { data = heading }) -> + | Some(H { data = heading }) -> if heading.title.range.ContainsInclusive pos then Some heading.title.range else diff --git a/Marksman/Refs.fs b/Marksman/Refs.fs index 693c551..1f10b48 100644 --- a/Marksman/Refs.fs +++ b/Marksman/Refs.fs @@ -120,9 +120,9 @@ module Dest = let doc: Dest -> Doc = function | Dest.Doc { doc = doc } - | Dest.LinkDef (doc, _) -> doc - | Dest.Heading (docLink, _) -> DocLink.doc docLink - | Dest.Tag (doc, _) -> doc + | Dest.LinkDef(doc, _) -> doc + | Dest.Heading(docLink, _) -> DocLink.doc docLink + | Dest.Tag(doc, _) -> doc let range: Dest -> Range = function @@ -130,16 +130,16 @@ module Dest = Doc.title doc |> Option.map (fun x -> x.range) |> Option.defaultWith (Doc.text doc).FullRange - | Dest.Heading (_, heading) -> heading.range - | Dest.LinkDef (_, linkDef) -> linkDef.range - | Dest.Tag (_, tag) -> tag.range + | Dest.Heading(_, heading) -> heading.range + | Dest.LinkDef(_, linkDef) -> linkDef.range + | Dest.Tag(_, tag) -> tag.range let scope: Dest -> Range = function | Dest.Doc { doc = doc } -> (Doc.text doc).FullRange() - | Dest.Heading (_, heading) -> heading.data.scope - | Dest.LinkDef (_, linkDef) -> linkDef.range - | Dest.Tag (_, tag) -> tag.range + | Dest.Heading(_, heading) -> heading.data.scope + | Dest.LinkDef(_, linkDef) -> linkDef.range + | Dest.Tag(_, tag) -> tag.range let uri (ref: Dest) : DocumentUri = doc ref |> Doc.uri @@ -147,18 +147,18 @@ module Dest = let detectFileLink complStyle srcDocId srcSym destDoc = match srcSym |> Sym.asRef with - | Some (CrossRef r) -> + | Some(CrossRef r) -> let kind = FileLinkKind.detect complStyle srcDocId r.Doc destDoc { link = r.Doc; kind = kind; doc = destDoc } | _ -> failwith $"Link kind cannot be determined for {srcSym} symbol" let detectDocLink complStyle srcDocId srcSym destDoc = match srcSym |> Sym.asRef with - | Some (CrossRef r) -> + | Some(CrossRef r) -> let kind = FileLinkKind.detect complStyle srcDocId r.Doc destDoc let fileLink = { link = r.Doc; kind = kind; doc = destDoc } Explicit fileLink - | Some (IntraRef (IntraSection _)) -> Implicit destDoc + | Some(IntraRef(IntraSection _)) -> Implicit destDoc | _ -> failwith $"Link kind cannot be determined for {srcSym} symbol" let private tryResolveSym (folder: Folder) (doc: Doc) (srcSym: Sym) : seq = @@ -179,7 +179,7 @@ module Dest = match destSym with | Sym.Def Doc -> Dest.Doc(detectFileLink destDoc) - | Sym.Def (Header _) -> + | Sym.Def(Header _) -> let docLink = detectDocLink destDoc yield! @@ -187,7 +187,7 @@ module Dest = |> Structure.findConcreteForSymbol destSym |> Seq.choose Cst.Element.asHeading |> Seq.map (fun node -> Dest.Heading(docLink, node)) - | Sym.Def (LinkDef _) -> + | Sym.Def(LinkDef _) -> yield! destDoc.Structure |> Structure.findConcreteForSymbol destSym @@ -243,7 +243,7 @@ module Dest = let defs, filter = match def with | LinkDef _ -> Seq.singleton def, konst true - | Header (level, _) when level > 1 -> Seq.singleton def, konst true + | Header(level, _) when level > 1 -> Seq.singleton def, konst true | Doc -> let headers = inDoc.Structure.Symbols @@ -251,7 +251,7 @@ module Dest = |> Seq.filter Def.isHeader Seq.append [ Def.Doc ] headers, Sym.isRefWithExplicitDoc - | Header (_, id) -> + | Header(_, id) -> let headers = inDoc.Structure.Symbols |> Seq.choose Sym.asDef diff --git a/Marksman/Server.fs b/Marksman/Server.fs index 5da4435..df490d0 100644 --- a/Marksman/Server.fs +++ b/Marksman/Server.fs @@ -84,7 +84,7 @@ module ServerUtil = let readWorkspace (userConfig: option) (roots: Map) : list = seq { - for KeyValue (name, root) in roots do + for KeyValue(name, root) in roots do match Folder.tryLoad userConfig name root with | Some folder -> yield folder | _ -> () @@ -624,7 +624,7 @@ type MarksmanServer(client: MarksmanClient) = let newState = match State.tryFindFolderAndDoc docPath state with - | Some (folder, doc) -> + | Some(folder, doc) -> let newDoc = Doc.applyLspChange (Folder.configuredMarkdownExts folder) par doc @@ -649,7 +649,7 @@ type MarksmanServer(client: MarksmanClient) = match State.tryFindFolderAndDoc path state with | None -> Mutation.empty - | Some (folder, doc) -> + | Some(folder, doc) -> let newState = match Folder.closeDoc (Doc.id doc) folder with | Some folder -> State.updateFolder folder state @@ -753,7 +753,7 @@ type MarksmanServer(client: MarksmanClient) = match State.tryFindFolderAndDoc uri state with | None -> () - | Some (folder, doc) -> + | Some(folder, doc) -> match Folder.withoutDoc (Doc.id doc) folder with | None -> newState <- State.removeFolder (Folder.id folder) newState | Some newFolder -> newState <- State.updateFolder newFolder newState @@ -873,7 +873,7 @@ type MarksmanServer(client: MarksmanClient) = let docUri = par.TextDocument.Uri |> UriWith.mkAbs match State.tryFindFolderAndDoc docUri state with - | Some (folder, curDoc) -> + | Some(folder, curDoc) -> let locs = match Cst.elementAtPos par.Position (Doc.cst curDoc) with | None -> @@ -941,7 +941,7 @@ type MarksmanServer(client: MarksmanClient) = match State.tryFindFolderAndDoc docPath state with | None -> Mutation.output (LspResult.success None) - | Some (folder, doc) -> + | Some(folder, doc) -> let config = Folder.configOrDefault folder let tocAction = diff --git a/Marksman/State.fs b/Marksman/State.fs index 0f41b40..bda976d 100644 --- a/Marksman/State.fs +++ b/Marksman/State.fs @@ -147,7 +147,7 @@ module State = let tryFindDoc (uri: UriWith) (state: State) : option = match tryFindFolderAndDoc uri state with | None -> None - | Some (_, doc) -> Some doc + | Some(_, doc) -> Some doc let updateFoldersFromLsp (added: WorkspaceFolder[]) diff --git a/Marksman/Syms.fs b/Marksman/Syms.fs index a2af77f..ed015f5 100644 --- a/Marksman/Syms.fs +++ b/Marksman/Syms.fs @@ -24,14 +24,14 @@ type CrossRef = override this.ToString() = match this with | CrossDoc doc -> $"[[{doc}]]" - | CrossSection (doc, section) -> $"[[{doc}#{Slug.toString section}]]" + | CrossSection(doc, section) -> $"[[{doc}#{Slug.toString section}]]" member this.AsString = this.ToString() member this.Doc = match this with | CrossDoc doc - | CrossSection (doc, _) -> doc + | CrossSection(doc, _) -> doc [] type Ref = @@ -58,8 +58,8 @@ module Ref = let trySection = function - | CrossRef (CrossSection (_, section)) - | IntraRef (IntraSection section) -> Some section + | CrossRef(CrossSection(_, section)) + | IntraRef(IntraSection section) -> Some section | _ -> None [] @@ -85,7 +85,7 @@ type Def = override this.ToString() = match this with | Doc -> "Doc" - | Header (l, h) -> $"H{l} {{{h}}}" + | Header(l, h) -> $"H{l} {{{h}}}" | LinkDef ld -> $"[{ld}]:" member this.AsString = this.ToString() @@ -98,7 +98,7 @@ module Def = let isTitle = function - | Def.Header (level, _) when level <= 1 -> true + | Def.Header(level, _) when level <= 1 -> true | _ -> false let isHeader = @@ -108,7 +108,7 @@ module Def = let isHeaderWithId id = function - | Def.Header (_, id') when id = id' -> true + | Def.Header(_, id') when id = id' -> true | _ -> false let isLinkDefWithLabel label = @@ -118,7 +118,7 @@ module Def = let asHeader = function - | Header (level, id) -> Some(level, id) + | Header(level, id) -> Some(level, id) | _ -> None [] diff --git a/Marksman/Workspace.fs b/Marksman/Workspace.fs index b3f22af..ddfd189 100644 --- a/Marksman/Workspace.fs +++ b/Marksman/Workspace.fs @@ -22,7 +22,7 @@ module Workspace = let folders (workspace: Workspace) : seq = seq { - for KeyValue (_, f) in workspace.folders do + for KeyValue(_, f) in workspace.folders do yield f } diff --git a/Tests/RefsTests.fs b/Tests/RefsTests.fs index 253f924..6a30f45 100644 --- a/Tests/RefsTests.fs +++ b/Tests/RefsTests.fs @@ -153,7 +153,8 @@ module FileLinkTests = let folder = FakeFolder.Mk( [ doc1; subDoc1; subSubDoc1; doc2; subDoc2 ], - { Config.Config.Default with complWikiStyle = Some Config.FilePathStem } + { Config.Config.Default with + complWikiStyle = Some Config.FilePathStem } ) let actual = @@ -505,7 +506,8 @@ module EncodingTests = let folder = FakeFolder.Mk( [ doc1; doc2; doc3 ], - { Config.Config.Default with complWikiStyle = Some Config.FilePathStem } + { Config.Config.Default with + complWikiStyle = Some Config.FilePathStem } ) let exts = (Folder.configOrDefault folder).CoreMarkdownFileExtensions() @@ -513,14 +515,14 @@ module EncodingTests = let simplifyDest (dest: Dest) : string = match dest with | Dest.Doc fileLink -> fileLink.doc |> Doc.name - | Dest.Heading (docLink, node) -> + | Dest.Heading(docLink, node) -> let doc = DocLink.doc docLink |> Doc.name let head = node.text $"{doc} / {head}" - | Dest.LinkDef (doc, node) -> + | Dest.LinkDef(doc, node) -> let defName = MdLinkDef.label node.data $"{Doc.name doc} / {defName}" - | Dest.Tag (doc, node) -> + | Dest.Tag(doc, node) -> let tag = node.text $"{Doc.name doc} / {tag}" diff --git a/Tests/ServerTests.fs b/Tests/ServerTests.fs index 4203c91..ab559ea 100644 --- a/Tests/ServerTests.fs +++ b/Tests/ServerTests.fs @@ -27,7 +27,8 @@ module ServerUtilTests = [] let textSync_NoConfigEmptyWS_PreferIncr () = let clientDesc = - { ClientDescription.empty with opts = { preferredTextSyncKind = Some Incremental } } + { ClientDescription.empty with + opts = { preferredTextSyncKind = Some Incremental } } let ws = Workspace.ofFolders None [] Assert.Equal(("clientOption", Incremental), ServerUtil.calcTextSync None ws clientDesc) @@ -35,7 +36,8 @@ module ServerUtilTests = [] let textSync_NoConfigNonEmptyWS_PreferIncr () = let clientDesc = - { ClientDescription.empty with opts = { preferredTextSyncKind = Some Incremental } } + { ClientDescription.empty with + opts = { preferredTextSyncKind = Some Incremental } } let folder = Folder.multiFile "test" (dummyRootPath [ "test" ] |> mkFolderId) Seq.empty None @@ -46,7 +48,8 @@ module ServerUtilTests = [] let textSync_NonEmptyWS_PreferIncrButConfigTakesPrecedence () = let clientDesc = - { ClientDescription.empty with opts = { preferredTextSyncKind = Some Incremental } } + { ClientDescription.empty with + opts = { preferredTextSyncKind = Some Incremental } } let folder = Folder.multiFile diff --git a/fsharplint.json b/fsharplint.json index 480016e..1bfe3d1 100644 --- a/fsharplint.json +++ b/fsharplint.json @@ -23,7 +23,7 @@ "patternMatchClauseIndentation": { "enabled": false }, "patternMatchExpressionIndentation": { "enabled": false }, "recursiveAsyncFunction": { "enabled": false }, - "redundantNewKeyword": { "enabled": true }, + "redundantNewKeyword": { "enabled": false }, "nestedStatements": { "enabled": false, "config": {