Skip to content

Commit f79cbcd

Browse files
committed
Apply patch from /run fantomas
1 parent 5c8f7e3 commit f79cbcd

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

src/Compiler/Driver/XmlDocFileWriter.fsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ module XmlDocWriter =
1616

1717
/// Writes the XmlDocSig property of each element (field, union case, etc)
1818
/// of the specified compilation unit to an XML document in a new text file.
19-
val WriteXmlDocFile: g: TcGlobals * infoReader: InfoReader * assemblyName: string * generatedCcu: CcuThunk * xmlFile: string -> unit
19+
val WriteXmlDocFile:
20+
g: TcGlobals * infoReader: InfoReader * assemblyName: string * generatedCcu: CcuThunk * xmlFile: string -> unit

src/Compiler/Symbols/XmlDocInheritance.fs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,21 @@ let private extractInheritDocDirectives (doc: XDocument) =
3030

3131
let crefName = XName.op_Implicit "cref" |> Operators.nonNull
3232
let pathName = XName.op_Implicit "path" |> Operators.nonNull
33-
33+
3434
doc.Descendants(inheritDocName)
3535
|> Seq.map (fun elem ->
3636
let crefAttr = elem.Attribute(crefName)
3737
let pathAttr = elem.Attribute(pathName)
3838

3939
{
40-
Cref = match crefAttr with null -> None | attr -> Some attr.Value
41-
Path = match pathAttr with null -> None | attr -> Some attr.Value
40+
Cref =
41+
match crefAttr with
42+
| null -> None
43+
| attr -> Some attr.Value
44+
Path =
45+
match pathAttr with
46+
| null -> None
47+
| attr -> Some attr.Value
4248
Element = elem
4349
})
4450
|> List.ofSeq

src/Compiler/Symbols/XmlDocInheritance.fsi

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ open FSharp.Compiler.Xml
1313
/// Takes an optional ModuleOrNamespaceType for accessing the current compilation's typed content
1414
/// Takes an optional implicit target cref for resolving <inheritdoc/> without cref attribute
1515
/// Takes a set of visited signatures to prevent cycles
16-
val expandInheritDoc: infoReaderOpt: InfoReader option -> ccuOpt: CcuThunk option -> currentModuleTypeOpt: ModuleOrNamespaceType option -> implicitTargetCrefOpt: string option -> m: range -> visited: Set<string> -> doc: XmlDoc -> XmlDoc
16+
val expandInheritDoc:
17+
infoReaderOpt: InfoReader option ->
18+
ccuOpt: CcuThunk option ->
19+
currentModuleTypeOpt: ModuleOrNamespaceType option ->
20+
implicitTargetCrefOpt: string option ->
21+
m: range ->
22+
visited: Set<string> ->
23+
doc: XmlDoc ->
24+
XmlDoc

src/Compiler/Symbols/XmlDocSigParser.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module XmlDocSigParser =
4545
match m.Success, kindStr with
4646
| true, ("M" | "P" | "E") ->
4747
let parts = m.Groups["entity"].Value.Split('.')
48+
4849
if parts.Length < 2 then
4950
ParsedDocCommentId.None
5051
else
@@ -68,8 +69,7 @@ module XmlDocSigParser =
6869
| _ -> DocCommentIdKind.Unknown
6970

7071
// Handle constructor name conversion (#ctor in doc comments, .ctor in F#)
71-
let finalMemberName =
72-
if memberOrVal = "#ctor" then ".ctor" else memberOrVal
72+
let finalMemberName = if memberOrVal = "#ctor" then ".ctor" else memberOrVal
7373

7474
ParsedDocCommentId.Member(entityPath, finalMemberName, genericParametersCount, kind)
7575

@@ -79,6 +79,7 @@ module XmlDocSigParser =
7979

8080
| true, "F" ->
8181
let parts = m.Groups["entity"].Value.Split('.')
82+
8283
if parts.Length < 2 then
8384
ParsedDocCommentId.None
8485
else

vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,7 @@ type FSharpCrossLanguageSymbolNavigationService() =
969969

970970
| ParsedDocCommentId.Member(typePath, memberName, genericArity, kind) ->
971971
// Convert constructor name format (.ctor in parser, ``.ctor`` needed for F# lookup)
972-
let memberOrValName =
973-
if memberName = ".ctor" then "``.ctor``" else memberName
972+
let memberOrValName = if memberName = ".ctor" then "``.ctor``" else memberName
974973

975974
let symbolMemberType =
976975
match kind with

0 commit comments

Comments
 (0)