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

Extract dynamic reference marker #3298

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions lib/ruby-lsp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

module RubyLsp
VERSION = File.read(File.expand_path("../VERSION", __dir__)).strip
DYNAMIC_REFERENCE_MARKER = "<dynamic_reference>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is the best place to define this constant. I noticed that these listeners include Requests::Support::Common. Should we take this opportunity to create Listeners::Support::Common for functionality shared by our listeners?

end
3 changes: 1 addition & 2 deletions lib/ruby_lsp/listeners/code_lens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class CodeLens
String,
)
ACCESS_MODIFIERS = T.let([:public, :private, :protected], T::Array[Symbol])
SUPPORTED_TEST_LIBRARIES = T.let(["minitest", "test-unit"], T::Array[String])
DYNAMIC_REFERENCE_MARKER = T.let("<dynamic_reference>", String)
SUPPORTED_TEST_LIBRARIES = ["minitest", "test-unit"]

#: (ResponseBuilders::CollectionResponseBuilder[Interface::CodeLens] response_builder, GlobalState global_state, URI::Generic uri, Prism::Dispatcher dispatcher) -> void
def initialize(response_builder, global_state, uri, dispatcher)
Expand Down
2 changes: 0 additions & 2 deletions lib/ruby_lsp/listeners/spec_style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ class SpecStyle
extend T::Sig
include Requests::Support::Common

DYNAMIC_REFERENCE_MARKER = "<dynamic_reference>"

#: (response_builder: ResponseBuilders::TestCollection, global_state: GlobalState, dispatcher: Prism::Dispatcher, uri: URI::Generic) -> void
def initialize(response_builder, global_state, dispatcher, uri)
@response_builder = response_builder
Expand Down
1 change: 0 additions & 1 deletion lib/ruby_lsp/listeners/test_style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def handle_test_unit_groups(file_path, groups_and_examples)
include Requests::Support::Common

ACCESS_MODIFIERS = [:public, :private, :protected].freeze
DYNAMIC_REFERENCE_MARKER = "<dynamic_reference>"
BASE_COMMAND = T.let(
begin
Bundler.with_original_env { Bundler.default_lockfile }
Expand Down
Loading