@@ -1085,10 +1085,7 @@ protected async Task HandleCommentHelpRequest(
1085
1085
var functionDefinitionAst = EditorSession . LanguageService . GetFunctionDefinitionAtLine (
1086
1086
scriptFile ,
1087
1087
expectedFunctionLine ) ;
1088
- var result = new CommentHelpRequestResult ( )
1089
- {
1090
- Content = new string [ ] { "" }
1091
- } ;
1088
+ var result = new CommentHelpRequestResult ( ) ;
1092
1089
1093
1090
if ( functionDefinitionAst != null )
1094
1091
{
@@ -1098,6 +1095,7 @@ protected async Task HandleCommentHelpRequest(
1098
1095
ruleSettings . Add ( "Enable" , true ) ;
1099
1096
ruleSettings . Add ( "BlockComment" , requestParams . BlockComment ) ;
1100
1097
ruleSettings . Add ( "VSCodeSnippetCorrection" , true ) ;
1098
+ ruleSettings . Add ( "Placement" , "before" ) ;
1101
1099
settings . Add ( "PSProvideCommentHelp" , ruleSettings ) ;
1102
1100
var pssaSettings = EditorSession . AnalysisService . GetPSSASettingsHashtable ( settings ) ;
1103
1101
@@ -1112,11 +1110,8 @@ protected async Task HandleCommentHelpRequest(
1112
1110
&& x . Correction . Edits [ 0 ] . StartLineNumber == expectedFunctionLine ;
1113
1111
} ) ;
1114
1112
1115
- if ( analysisResult != null )
1116
- {
1117
- // find the analysis result whose correction starts on
1118
- result . Content = analysisResult . Correction . Edits [ 0 ] . Text . Split ( '\n ' ) . Select ( x => x . Trim ( '\r ' ) ) . ToArray ( ) ;
1119
- }
1113
+ // find the analysis result whose correction starts on
1114
+ result . Content = analysisResult ? . Correction . Edits [ 0 ] . Text . Split ( '\n ' ) . Select ( x => x . Trim ( '\r ' ) ) . ToArray ( ) ;
1120
1115
}
1121
1116
1122
1117
await requestContext . SendResult ( result ) ;
0 commit comments