File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
src/PowerShellEditorServices.Protocol/Server Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -1091,22 +1091,23 @@ protected async Task HandleCommentHelpRequest(
10911091 {
10921092 // todo create a semantic marker api that take only string
10931093 var analysisResults = await EditorSession . AnalysisService . GetSemanticMarkersAsync (
1094- scriptFile ,
1094+ functionDefinitionAst . Extent . Text ,
10951095 AnalysisService . GetCommentHelpRuleSettings (
10961096 true ,
10971097 false ,
10981098 requestParams . BlockComment ,
10991099 true ,
11001100 "before" ) ) ;
11011101
1102- var analysisResult = analysisResults ? . FirstOrDefault ( x =>
1103- {
1104- return x . Correction != null
1105- && x . Correction . Edits [ 0 ] . StartLineNumber == expectedFunctionLine ;
1106- } ) ;
1107-
11081102 // find the analysis result whose correction starts on
1109- result . Content = analysisResult ? . Correction . Edits [ 0 ] . Text . Split ( '\n ' ) . Select ( x => x . Trim ( '\r ' ) ) . ToArray ( ) ;
1103+ result . Content = analysisResults ?
1104+ . FirstOrDefault ( ) ?
1105+ . Correction ?
1106+ . Edits [ 0 ]
1107+ . Text
1108+ . Split ( '\n ' )
1109+ . Select ( x => x . Trim ( '\r ' ) )
1110+ . ToArray ( ) ;
11101111 }
11111112
11121113 await requestContext . SendResult ( result ) ;
You can’t perform that action at this time.
0 commit comments