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(
1091
1091
{
1092
1092
// todo create a semantic marker api that take only string
1093
1093
var analysisResults = await EditorSession . AnalysisService . GetSemanticMarkersAsync (
1094
- scriptFile ,
1094
+ functionDefinitionAst . Extent . Text ,
1095
1095
AnalysisService . GetCommentHelpRuleSettings (
1096
1096
true ,
1097
1097
false ,
1098
1098
requestParams . BlockComment ,
1099
1099
true ,
1100
1100
"before" ) ) ;
1101
1101
1102
- var analysisResult = analysisResults ? . FirstOrDefault ( x =>
1103
- {
1104
- return x . Correction != null
1105
- && x . Correction . Edits [ 0 ] . StartLineNumber == expectedFunctionLine ;
1106
- } ) ;
1107
-
1108
1102
// 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 ( ) ;
1110
1111
}
1111
1112
1112
1113
await requestContext . SendResult ( result ) ;
You can’t perform that action at this time.
0 commit comments