Skip to content

Commit 05db354

Browse files
committed
Use RBS type alias for LSP reporter (#3629)
### Motivation This will allow addons to reference those aliasing types without adding shims. ### Implementation <!-- How did you implement your changes? Explain your solution, design decisions, things reviewers should watch out for. --> ### Automated Tests <!-- We hope you added unit tests as part of your changes, just state that you have. If you haven't, state why. --> ### Manual Tests <!-- Explain how we can test these changes in our own instance of VS Code. Provide the step by step instructions. -->
1 parent 75fc7df commit 05db354

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

lib/ruby_lsp/test_reporters/lsp_reporter.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ module RubyLsp
1212
class LspReporter
1313
include Singleton
1414

15+
# https://code.visualstudio.com/api/references/vscode-api#Position
16+
#: type position = { line: Integer, character: Integer }
17+
18+
# https://code.visualstudio.com/api/references/vscode-api#Range
19+
#: type range = { start: position, end: position }
20+
21+
# https://code.visualstudio.com/api/references/vscode-api#BranchCoverage
22+
#: type branch_coverage = { executed: Integer, label: String, location: range }
23+
24+
# https://code.visualstudio.com/api/references/vscode-api#StatementCoverage
25+
#: type statement_coverage = { executed: Integer, location: position, branches: Array[branch_coverage] }
26+
1527
#: bool
1628
attr_reader :invoked_shutdown
1729

@@ -125,7 +137,7 @@ def uri_and_line_for(method_object)
125137
# ["Foo", :bar, 6, 21, 6, 65] => 0
126138
# }
127139
# }
128-
#: -> Hash[String, StatementCoverage]
140+
#: -> Hash[String, statement_coverage]
129141
def gather_coverage_results
130142
# Ignore coverage results inside dependencies
131143
bundle_path = Bundler.bundle_path.to_s

sorbet/rbi/shims/test_reporter.rbi

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)