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

Remove Sorbet sigs from docs #1998

Merged
merged 2 commits into from
May 1, 2024
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
22 changes: 0 additions & 22 deletions ADDONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,15 @@ require "ruby_lsp/addon"
module RubyLsp
module MyGem
class Addon < ::RubyLsp::Addon
extend T::Sig

# Performs any activation that needs to happen once when the language server is booted
sig { override.params(message_queue: Thread::Queue).void }
def activate(message_queue)
end

# Performs any cleanup when shutting down the server, like terminating a subprocess
sig { override.void }
def deactivate
end

# Returns the name of the addon
sig { override.returns(String) }
def name
"Ruby LSP My Gem"
end
Expand Down Expand Up @@ -136,40 +131,25 @@ following listener implementation.
module RubyLsp
module MyGem
class Addon < ::RubyLsp::Addon
extend T::Sig

sig { override.params(message_queue: Thread::Queue).void }
def activate(message_queue)
@message_queue = message_queue
@config = SomeConfiguration.new
end

sig { override.void }
def deactivate
end

sig { override.returns(String) }
def name
"Ruby LSP My Gem"
end

sig do
override.params(
response_builder: ResponseBuilders::Hover,
nesting: T::Array[String],
index: RubyIndexer::Index,
dispatcher: Prism::Dispatcher,
).void
end
def create_hover_listener(response_builder, nesting, index, dispatcher)
# Use the listener factory methods to instantiate listeners with parameters sent by the LSP combined with any
# pre-computed information in the addon. These factory methods are invoked on every request
Hover.new(client, response_builder, @config, dispatcher)
end

class Hover
extend T::Sig

# The Requests::Support::Common module provides some helper methods you may find helpful.
include Requests::Support::Common

Expand All @@ -180,7 +160,6 @@ module RubyLsp
# to this object, which will then build the Ruby LSP's response.
# Additionally, listeners are instantiated with a message_queue to push notifications (not used in this example).
# See "Sending notifications to the client" for more information.
sig { params(client: RailsClient, response_builder: ResponseBuilders::Hover, config: SomeConfiguration, dispatcher: Prism::Dispatcher).void }
def initialize(client, response_builder, config, dispatcher)
super(dispatcher)

Expand All @@ -195,7 +174,6 @@ module RubyLsp

# Listeners must define methods for each event they registered with the dispatcher. In this case, we have to
# define `on_constant_read_node_enter` to specify what this listener should do every time we find a constant
sig { params(node: Prism::ConstantReadNode).void }
def on_constant_read_node_enter(node)
# Certain builders are made available to listeners to build LSP responses. The classes under `RubyLsp::ResponseBuilders`
# are used to build responses conforming to the LSP Specification.
Expand Down
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ To add a new expectations test runner for a new request handler:
- Add a new file under `test/requests/MY_REQUEST_expectations_test.rb`

```ruby
# frozen_string_literal: true

require "test_helper"
require "expectations/expectations_test_runner"

Expand All @@ -84,8 +82,6 @@ the base run and assert method to achieve the right behaviour. See `diagnostics_
example

```ruby
# frozen_string_literal: true

require "test_helper"
require "expectations/expectations_test_runner"

Expand Down
1 change: 0 additions & 1 deletion vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ Create a `Gemfile` for development tools inside that directory.

```ruby
# the/directory/Gemfile
# frozen_string_literal: true

source "https://rubygems.org"

Expand Down
Loading