Skip to content

Commit

Permalink
Fix: Show one comment only when there are multiple comments for the s…
Browse files Browse the repository at this point in the history
…ame variable
  • Loading branch information
WilsonZiweiWang committed Jan 3, 2024
1 parent 0058e21 commit 1b8a61a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/connectionHandlers/onHover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function getGlobalSymbolComments (uri: string, word: string): string | null {
})

if (commentsToShow.length > 0) {
return `${commentsToShow.map((item) => item.comments.map(comment => comment.slice(1)).join('\n') + `\n\nSource: ${item.uri.replace('file://', '')} \`L: ${item.line + 1}\``).join('\n___\n')}`
return `${commentsToShow[0].comments.map(comment => comment.slice(1)).join('\n') + `\n\nSource: ${commentsToShow[0].uri.replace('file://', '')} \`L: ${commentsToShow[0].line + 1}\``}`
}
}
}
Expand Down

0 comments on commit 1b8a61a

Please sign in to comment.