Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb946161

Browse files
vasily-kirichenkoKevinRansom
authored andcommitted
fixed: XmlDocReader constructor raises exception in case of malformed XML Doc, which causes no Quick Info at all (dotnet#2507)
1 parentfd3752d commitb946161

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

‎vsintegration/src/FSharp.LanguageService/XmlDocumentation.fs‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,18 @@ module internal XmlDocumentation =
153153
collector.Add(Literals.dot)
154154
collector.Add(tagClass parts.[parts.Length-1])
155155

156-
typeXmlDocReader(s: string)=
157-
letdoc= XElement.Parse(ProcessXml(s))
156+
typeXmlDocReaderprivate(doc: XElement)=
157+
158158
lettryFindParameter name=
159159
doc.Descendants(XName.op_Implicit"param")
160160
|> Seq.tryFind(fun el->
161161
match el.Attribute(XName.op_Implicit"name")with
162162
|null->false
163163
| attr-> attr.Value= name)
164164

165+
static memberTryCreate(xml:string)=
166+
try Some(XmlDocReader(XElement.Parse(ProcessXml xml)))with_-> None
167+
165168
member__.CollectSummary(collector:ITaggedTextCollector)=
166169
match Seq.tryHead(doc.Descendants(XName.op_Implicit"summary"))with
167170
| None->()
@@ -279,12 +282,13 @@ module internal XmlDocumentation =
279282

280283
interface IDocumentationBuilderwith
281284
/// Append the given processed XML formatted into the string builder
282-
overridethis.AppendDocumentationFromProcessedXML(appendTo,processedXml,showExceptions,showParameters,paramName)=
283-
letxmlDocReader= XmlDocReader(processedXml)
284-
if paramName.IsSomethen
285-
xmlDocReader.CollectParameter(appendTo, paramName.Value)
286-
else
287-
AppendMemberData(appendTo, xmlDocReader, showExceptions,showParameters)
285+
overridethis.AppendDocumentationFromProcessedXML(appendTo,processedXml,showExceptions,showParameters,paramName)=
286+
match XmlDocReader.TryCreate processedXmlwith
287+
| Some xmlDocReader->
288+
match paramNamewith
289+
| Some paramName-> xmlDocReader.CollectParameter(appendTo, paramName)
290+
| None-> AppendMemberData(appendTo, xmlDocReader, showExceptions,showParameters)
291+
| None->()
288292

289293
/// Append Xml documentation contents into the StringBuilder
290294
overridethis.AppendDocumentation

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp