File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,11 @@ export default class BashServer {
180
180
return { contents : getMarkdownContent ( shellDocumentation ) }
181
181
}
182
182
} else {
183
+ const getCommentsAbove = ( uri : string , line : number ) : string => {
184
+ const comment = this . analyzer . commentsAbove ( uri , line )
185
+ return comment ? `\n\n${ comment } ` : ''
186
+ }
187
+
183
188
const symbolDocumentation = deduplicateSymbols ( {
184
189
symbols : this . analyzer . findSymbolsMatchingWord ( {
185
190
exactMatch : true ,
@@ -194,16 +199,15 @@ export default class BashServer {
194
199
? `${ symbolKindToDescription ( symbol . kind ) } defined in ${ path . relative (
195
200
currentUri ,
196
201
symbol . location . uri ,
197
- ) } \n\n ${ this . analyzer . commentsAbove (
202
+ ) } ${ getCommentsAbove (
198
203
symbol . location . uri ,
199
204
symbol . location . range . start . line ,
200
205
) } `
201
206
: `${ symbolKindToDescription ( symbol . kind ) } defined on line ${ symbol . location
202
- . range . start . line + 1 }
203
- \n\n${ this . analyzer . commentsAbove (
204
- params . textDocument . uri ,
205
- symbol . location . range . start . line ,
206
- ) } `,
207
+ . range . start . line + 1 } ${ getCommentsAbove (
208
+ params . textDocument . uri ,
209
+ symbol . location . range . start . line ,
210
+ ) } `,
207
211
)
208
212
209
213
if ( symbolDocumentation . length === 1 ) {
You can’t perform that action at this time.
0 commit comments