diff --git a/lib/ruby_lsp/listeners/document_symbol.rb b/lib/ruby_lsp/listeners/document_symbol.rb index fa590de15..6e08c532e 100644 --- a/lib/ruby_lsp/listeners/document_symbol.rb +++ b/lib/ruby_lsp/listeners/document_symbol.rb @@ -266,7 +266,7 @@ def on_class_variable_write_node_enter(node) def on_instance_variable_write_node_enter(node) create_document_symbol( name: node.name.to_s, - kind: Constant::SymbolKind::VARIABLE, + kind: Constant::SymbolKind::FIELD, range_location: node.name_loc, selection_range_location: node.name_loc, ) @@ -276,7 +276,7 @@ def on_instance_variable_write_node_enter(node) def on_instance_variable_operator_write_node_enter(node) create_document_symbol( name: node.name.to_s, - kind: Constant::SymbolKind::VARIABLE, + kind: Constant::SymbolKind::FIELD, range_location: node.name_loc, selection_range_location: node.name_loc, ) @@ -286,7 +286,7 @@ def on_instance_variable_operator_write_node_enter(node) def on_instance_variable_or_write_node_enter(node) create_document_symbol( name: node.name.to_s, - kind: Constant::SymbolKind::VARIABLE, + kind: Constant::SymbolKind::FIELD, range_location: node.name_loc, selection_range_location: node.name_loc, ) @@ -296,7 +296,7 @@ def on_instance_variable_or_write_node_enter(node) def on_instance_variable_and_write_node_enter(node) create_document_symbol( name: node.name.to_s, - kind: Constant::SymbolKind::VARIABLE, + kind: Constant::SymbolKind::FIELD, range_location: node.name_loc, selection_range_location: node.name_loc, ) diff --git a/test/expectations/document_symbol/ivar.exp.json b/test/expectations/document_symbol/ivar.exp.json index 1907348ec..a711de0c0 100644 --- a/test/expectations/document_symbol/ivar.exp.json +++ b/test/expectations/document_symbol/ivar.exp.json @@ -2,7 +2,7 @@ "result": [ { "name": "@a", - "kind": 13, + "kind": 8, "range": { "start": { "line": 0, @@ -27,7 +27,7 @@ }, { "name": "@aa", - "kind": 13, + "kind": 8, "range": { "start": { "line": 1, @@ -76,7 +76,7 @@ "children": [ { "name": "@b", - "kind": 13, + "kind": 8, "range": { "start": { "line": 4, @@ -101,7 +101,7 @@ }, { "name": "@bb", - "kind": 13, + "kind": 8, "range": { "start": { "line": 5, @@ -150,7 +150,7 @@ "children": [ { "name": "@c", - "kind": 13, + "kind": 8, "range": { "start": { "line": 8, @@ -175,7 +175,7 @@ }, { "name": "@cc", - "kind": 13, + "kind": 8, "range": { "start": { "line": 9,