Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use field instead of variable for instance variable symbol kinds #2898

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/ruby_lsp/listeners/document_symbol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand All @@ -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,
)
Expand All @@ -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,
)
Expand Down
12 changes: 6 additions & 6 deletions test/expectations/document_symbol/ivar.exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"result": [
{
"name": "@a",
"kind": 13,
"kind": 8,
"range": {
"start": {
"line": 0,
Expand All @@ -27,7 +27,7 @@
},
{
"name": "@aa",
"kind": 13,
"kind": 8,
"range": {
"start": {
"line": 1,
Expand Down Expand Up @@ -76,7 +76,7 @@
"children": [
{
"name": "@b",
"kind": 13,
"kind": 8,
"range": {
"start": {
"line": 4,
Expand All @@ -101,7 +101,7 @@
},
{
"name": "@bb",
"kind": 13,
"kind": 8,
"range": {
"start": {
"line": 5,
Expand Down Expand Up @@ -150,7 +150,7 @@
"children": [
{
"name": "@c",
"kind": 13,
"kind": 8,
"range": {
"start": {
"line": 8,
Expand All @@ -175,7 +175,7 @@
},
{
"name": "@cc",
"kind": 13,
"kind": 8,
"range": {
"start": {
"line": 9,
Expand Down
Loading