aboutsummaryrefslogtreecommitdiff
path: root/src/server/analysis.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2025-06-27 21:48:40 +0200
committerGitHub <noreply@github.com>2025-06-27 21:48:40 +0200
commit4eae668a145df223c6cfc7b8929cdd49d436756d (patch)
tree107fb0d242639754162e1028e61d18f8dc6bb782 /src/server/analysis.odin
parent863ad953c7ce368c001e15339a0785e1aca0bdc5 (diff)
parent9bbb4b4450b5310a68aa4497a3125674452037d7 (diff)
Merge pull request #678 from BradLewis/feat/proc-hover-comments
Add proc comments to hover information
Diffstat (limited to 'src/server/analysis.odin')
-rw-r--r--src/server/analysis.odin9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index c485a43..b43dce7 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1559,6 +1559,7 @@ internal_resolve_type_identifier :: proc(ast_context: ^AstContext, node: ast.Ide
}
return_symbol.doc = get_doc(global.docs, ast_context.allocator)
+ return_symbol.comment = get_comment(global.comment)
return return_symbol, ok
} else {
@@ -3764,6 +3765,7 @@ concatenate_raw_symbol_information :: proc(ast_context: ^AstContext, symbol: Sym
symbol.name,
symbol.signature,
symbol.type,
+ symbol.comment,
is_completion,
)
}
@@ -3774,6 +3776,7 @@ concatenate_raw_string_information :: proc(
name: string,
signature: string,
type: SymbolType,
+ comment: string,
is_completion: bool,
) -> string {
pkg := path.base(pkg, false, context.temp_allocator)
@@ -3782,6 +3785,12 @@ concatenate_raw_string_information :: proc(
return fmt.tprintf("%v: package", name)
} else if type == .Keyword && is_completion {
return name
+ } else if type == .Function {
+ if comment != "" {
+ return fmt.tprintf("%v\n%v.%v: %v", comment, pkg, name, signature)
+ }
+ return fmt.tprintf("%v.%v: %v", pkg, name, signature)
+
} else {
if signature != "" {
return fmt.tprintf("%v.%v: %v", pkg, name, signature)