Skip to content

Commit a644b42

Browse files
authored
Use RubyLsp alias for Interface (#64)
1 parent 1864733 commit a644b42

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

lib/ruby_lsp/ruby_lsp_rspec/document_symbol.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def on_call_node_enter(node)
2323

2424
@response_builder.last.children << RubyLsp::Interface::DocumentSymbol.new(
2525
name: name,
26-
kind: LanguageServer::Protocol::Constant::SymbolKind::METHOD,
26+
kind: RubyLsp::Constant::SymbolKind::METHOD,
2727
selection_range: range_from_node(node),
2828
range: range_from_node(node),
2929
)
@@ -36,7 +36,7 @@ def on_call_node_enter(node)
3636

3737
symbol = RubyLsp::Interface::DocumentSymbol.new(
3838
name: name,
39-
kind: LanguageServer::Protocol::Constant::SymbolKind::MODULE,
39+
kind: RubyLsp::Constant::SymbolKind::MODULE,
4040
selection_range: range_from_node(node),
4141
range: range_from_node(node),
4242
children: [],

spec/document_symbol_spec.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ def test_baz; end
6161
expect(response.count).to eq(1)
6262
foo = response[0]
6363
expect(foo.name).to eq("Foo")
64-
expect(foo.kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
64+
expect(foo.kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
6565
expect(foo.children.count).to eq(5)
6666

6767
expect(foo.children[0].name).to eq("when something")
68-
expect(foo.children[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
68+
expect(foo.children[0].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
6969
expect(foo.children[0].children.count).to eq(1)
7070
expect(foo.children[0].children[0].name).to eq("does something")
71-
expect(foo.children[0].children[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::METHOD)
71+
expect(foo.children[0].children[0].kind).to eq(RubyLsp::Constant::SymbolKind::METHOD)
7272

7373
foo_bar = foo.children[1]
7474
expect(foo_bar.name).to eq("Foo::Bar")
@@ -113,12 +113,12 @@ def test_baz; end
113113
expect(response.count).to eq(1)
114114
shared = response[0]
115115
expect(shared.name).to eq("simple shared examples")
116-
expect(shared.kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
116+
expect(shared.kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
117117
expect(shared.children.count).to eq(1)
118118

119119
example = shared.children[0]
120120
expect(example.name).to eq("does something")
121-
expect(example.kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::METHOD)
121+
expect(example.kind).to eq(RubyLsp::Constant::SymbolKind::METHOD)
122122
end
123123
end
124124

@@ -146,12 +146,12 @@ def test_baz; end
146146
expect(response.count).to eq(1)
147147
shared = response[0]
148148
expect(shared.name).to eq(":symbol_shared_examples")
149-
expect(shared.kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
149+
expect(shared.kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
150150
expect(shared.children.count).to eq(1)
151151

152152
child = shared.children[0]
153153
expect(child.name).to eq("does something in symbol")
154-
expect(child.kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::METHOD)
154+
expect(child.kind).to eq(RubyLsp::Constant::SymbolKind::METHOD)
155155
end
156156
end
157157

@@ -181,12 +181,12 @@ def test_baz; end
181181
expect(response.count).to eq(1)
182182
shared = response[0]
183183
expect(shared.name).to eq("shared example with parameter")
184-
expect(shared.kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
184+
expect(shared.kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
185185
expect(shared.children.count).to eq(1)
186186

187187
child1 = shared.children[0]
188188
expect(child1.name).to eq("uses the given parameter")
189-
expect(child1.kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::METHOD)
189+
expect(child1.kind).to eq(RubyLsp::Constant::SymbolKind::METHOD)
190190
end
191191
end
192192

@@ -219,7 +219,7 @@ def shared_method
219219

220220
expect(response.count).to eq(1)
221221
expect(response[0].name).to eq("simple shared_context")
222-
expect(response[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
222+
expect(response[0].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
223223
expect(response[0].children.count).to eq(2)
224224
end
225225
end
@@ -253,7 +253,7 @@ def shared_method
253253

254254
expect(response.count).to eq(1)
255255
expect(response[0].name).to eq(":symbol_shared_context")
256-
expect(response[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
256+
expect(response[0].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
257257
expect(response[0].children.count).to eq(2)
258258
end
259259
end
@@ -287,7 +287,7 @@ def shared_method
287287

288288
expect(response.count).to eq(1)
289289
expect(response[0].name).to eq("simple shared_examples_for")
290-
expect(response[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
290+
expect(response[0].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
291291
expect(response[0].children.count).to eq(2)
292292
end
293293
end
@@ -321,7 +321,7 @@ def shared_method
321321

322322
expect(response.count).to eq(1)
323323
expect(response[0].name).to eq(":symbol_shared_examples_for")
324-
expect(response[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
324+
expect(response[0].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
325325
expect(response[0].children.count).to eq(2)
326326
end
327327
end
@@ -350,10 +350,10 @@ def shared_method
350350

351351
expect(response.count).to eq(2)
352352
expect(response[0].name).to eq("shared examples")
353-
expect(response[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
353+
expect(response[0].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
354354

355355
expect(response[1].name).to eq("something")
356-
expect(response[1].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
356+
expect(response[1].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
357357
end
358358
end
359359

@@ -381,10 +381,10 @@ def shared_method
381381

382382
expect(response.count).to eq(2)
383383
expect(response[0].name).to eq("shared context")
384-
expect(response[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
384+
expect(response[0].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
385385

386386
expect(response[1].name).to eq("something")
387-
expect(response[1].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
387+
expect(response[1].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
388388
end
389389
end
390390

@@ -412,10 +412,10 @@ def shared_method
412412

413413
expect(response.count).to eq(2)
414414
expect(response[0].name).to eq("shared examples for")
415-
expect(response[0].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
415+
expect(response[0].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
416416

417417
expect(response[1].name).to eq("something")
418-
expect(response[1].kind).to eq(LanguageServer::Protocol::Constant::SymbolKind::MODULE)
418+
expect(response[1].kind).to eq(RubyLsp::Constant::SymbolKind::MODULE)
419419
end
420420
end
421421
end

0 commit comments

Comments
 (0)