aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/completion.odin2
-rw-r--r--src/server/hover.odin2
-rw-r--r--src/server/symbol.odin4
-rw-r--r--tests/completions_test.odin8
4 files changed, 8 insertions, 8 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin
index 4f36d6e..b06c67f 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -1658,7 +1658,7 @@ get_identifier_completion :: proc(
if symbol, ok := resolve_type_identifier(ast_context, ident^); ok {
if score, ok := common.fuzzy_match(matcher, ident.name); ok == 1 {
- construct_ident_symbol_info(&symbol, ident, ast_context.document_package)
+ construct_ident_symbol_info(&symbol, clean_ident(ident.name), ast_context.document_package)
append(results, CompletionResult{score = score * 1.7, symbol = symbol})
}
}
diff --git a/src/server/hover.odin b/src/server/hover.odin
index e76cf1f..af83d0b 100644
--- a/src/server/hover.odin
+++ b/src/server/hover.odin
@@ -433,7 +433,7 @@ get_hover_information :: proc(document: ^Document, position: common.Position) ->
}
if resolved, ok := resolve_type_identifier(&ast_context, ident); ok {
- construct_ident_symbol_info(&resolved, &ident, ast_context.document_package)
+ construct_ident_symbol_info(&resolved, ident.name, ast_context.document_package)
build_documentation(&ast_context, &resolved, false)
hover.contents = write_hover_content(&ast_context, resolved)
diff --git a/src/server/symbol.odin b/src/server/symbol.odin
index 3384d3b..7fab60c 100644
--- a/src/server/symbol.odin
+++ b/src/server/symbol.odin
@@ -875,10 +875,10 @@ construct_enum_field_symbol :: proc(symbol: ^Symbol, value: SymbolEnumValue, ind
}
// Adds name and type information to the symbol when it's for an identifier
-construct_ident_symbol_info :: proc(symbol: ^Symbol, ident: ^ast.Ident, document_pkg: string) {
+construct_ident_symbol_info :: proc(symbol: ^Symbol, ident: string, document_pkg: string) {
symbol.type_name = symbol.name
symbol.type_pkg = symbol.pkg
- symbol.name = clean_ident(ident.name)
+ symbol.name = ident
if symbol.type == .Variable {
symbol.pkg = document_pkg
}
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 0e2f287..b31f082 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -4460,7 +4460,7 @@ ast_completion_bit_set_on_struct :: proc(t: ^testing.T) {
}
@(test)
-ast_completions_handle_matching_basic_types :: proc(t: ^testing.T) {
+ast_completion_handle_matching_basic_types :: proc(t: ^testing.T) {
source := test.Source {
main = `package test
@@ -4479,7 +4479,7 @@ ast_completions_handle_matching_basic_types :: proc(t: ^testing.T) {
}
@(test)
-ast_completions_handle_matching_struct :: proc(t: ^testing.T) {
+ast_completion_handle_matching_struct :: proc(t: ^testing.T) {
source := test.Source {
main = `package test
@@ -4500,7 +4500,7 @@ ast_completions_handle_matching_struct :: proc(t: ^testing.T) {
}
@(test)
-ast_completions_handle_matching_append :: proc(t: ^testing.T) {
+ast_completion_handle_matching_append :: proc(t: ^testing.T) {
source := test.Source {
main = `package test
@@ -4517,7 +4517,7 @@ ast_completions_handle_matching_append :: proc(t: ^testing.T) {
}
@(test)
-ast_completions_handle_matching_dynamic_array_to_slice :: proc(t: ^testing.T) {
+ast_completion_handle_matching_dynamic_array_to_slice :: proc(t: ^testing.T) {
source := test.Source {
main = `package test