Skip to content

Commit

Permalink
Fix spellings
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Sep 25, 2024
1 parent d4c7983 commit 470896c
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class MyRequestExpectationsTest < ExpectationsTestRunner
end
```

- (optional) The default behaviour of running tests is not always enough for every request. You may need to override
the base run and assert method to achieve the right behaviour. See `diagnostics_expectations_test.rb` for an
- (optional) The default behavior of running tests is not always enough for every request. You may need to override
the base run and assert method to achieve the right behavior. See `diagnostics_expectations_test.rb` for an
example

```ruby
Expand Down
2 changes: 1 addition & 1 deletion jekyll/add-ons.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The performance of automatic requests is critical for responsiveness as they are
- Avoid duplicate work where possible. If something can be computed once and memoized, like configurations, do it
- Do not mutate LSP state directly. Add-ons sometimes have access to important state such as document objects, which
should never be mutated directly, but instead through the mechanisms provided by the LSP specification - like text edits
- Do not overnotify users. It's generally annoying and diverts attention from the current task
- Do not over-notify users. It's generally annoying and diverts attention from the current task
- Show the right context at the right time. When adding visual features, think about **when** the information is
relevant for users to avoid polluting the editor

Expand Down
4 changes: 2 additions & 2 deletions jekyll/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ pathname.a
```

We do not recommend renaming methods, instance variables or local variables for the sole purpose of getting better
accuracy - readibility should always come first. For example:
accuracy - readability should always come first. For example:

```ruby
# It would not be a good idea to name every string "string" for the sake of getting better accuracy.
# Using descriptive names will outweight the benefits of the more accurate editor experience
# Using descriptive names will outweigh the benefits of the more accurate editor experience

# don't
string = something.other_thing
Expand Down
2 changes: 1 addition & 1 deletion jekyll/troubleshooting.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ For example, if you configure `BUNDLE_PATH` to point to `vendor/bundle` so that
directory as your project, `bundle install` will automatically pick that up and install them in the right place. But
`gem install` will not as it requires a different setting to achieve it.

You can apply your prefered installed locations for RubyGems by using the `~/.gemrc` file. In that file, you can decide
You can apply your preferred installed locations for RubyGems by using the `~/.gemrc` file. In that file, you can decide
to either install it with `--user-install` or select a specific installation directory with `--install-dir`.

```yaml
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_indexer/lib/ruby_indexer/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def matches?(arguments)
(positionals.empty? && forwarding_arguments.any?) ||
(
# Check if positional arguments match. This includes required, optional, rest arguments. We also need to
# verify if there's a trailing forwading argument, like `def foo(a, ...); end`
# verify if there's a trailing forwarding argument, like `def foo(a, ...); end`
positional_arguments_match?(positionals, forwarding_arguments, keyword_args, min_pos, max_pos) &&
# If the positional arguments match, we move on to checking keyword, optional keyword and keyword rest
# arguments. If there's a forward argument, then it will always match. If the method accepts a keyword rest
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_indexer/lib/ruby_indexer/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def linearize_superclass( # rubocop:disable Metrics/ParameterLists
singleton_levels
)
# Find the first class entry that has a parent class. Notice that if the developer makes a mistake and inherits
# from two diffent classes in different files, we simply ignore it
# from two different classes in different files, we simply ignore it
superclass = T.cast(
if singleton_levels > 0
self[attached_class_name]&.find { |n| n.is_a?(Entry::Class) && n.parent_class }
Expand Down Expand Up @@ -972,7 +972,7 @@ def inherited_constant_completion_candidates(name, nesting)
[]
end

# Removes redudancy from a constant reference's full name. For example, if we find a reference to `A::B::Foo` inside
# Removes redundancy from a constant reference's full name. For example, if we find a reference to `A::B::Foo` inside
# of the ["A", "B"] nesting, then we should not concatenate the nesting with the name or else we'll end up with
# `A::B::A::B::Foo`. This method will remove any redundant parts from the final name based on the reference and the
# nesting
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_indexer/test/classes_and_modules_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class self::Bar
assert_entry("self::Bar", Entry::Class, "/fake/path/foo.rb:0-0:1-3")
end

def test_dynamically_namespaced_class_doesnt_affect_other_classes
def test_dynamically_namespaced_class_does_not_affect_other_classes
index(<<~RUBY)
class Foo
class self::Bar
Expand Down Expand Up @@ -143,7 +143,7 @@ module self::Bar
assert_entry("self::Bar", Entry::Module, "/fake/path/foo.rb:0-0:1-3")
end

def test_dynamically_namespaced_module_doesnt_affect_other_modules
def test_dynamically_namespaced_module_does_not_affect_other_modules
index(<<~RUBY)
module Foo
class self::Bar
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_indexer/test/index_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ class Bar
assert_equal(14, entry.location.start_line)
end

def test_resolving_inherited_alised_namespace
def test_resolving_inherited_aliased_namespace
index(<<~RUBY)
module Bar
TARGET = 123
Expand Down Expand Up @@ -1490,7 +1490,7 @@ class Foo
assert_kind_of(Entry::UnresolvedMethodAlias, entry)
end

def test_unresolable_method_aliases
def test_unresolvable_method_aliases
index(<<~RUBY)
class Foo
alias bar baz
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_indexer/test/instance_variables_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def something.bar
end
RUBY

# If the surrounding method is beind defined on any dynamic value that isn't `self`, then we attribute the
# If the surrounding method is behind defined on any dynamic value that isn't `self`, then we attribute the
# instance variable to the wrong owner since there's no way to understand that statically
entry = T.must(@index["@a"]&.first)
owner = T.must(entry.owner)
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_indexer/test/rbs_indexer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_attaches_correct_owner_to_singleton_methods
end

def test_location_and_name_location_are_the_same
# NOTE: RBS does not store the name location for classes, modules or methods. This behaviour is not exactly what
# NOTE: RBS does not store the name location for classes, modules or methods. This behavior is not exactly what
# we would like, but for now we assign the same location to both

entries = @index["Array"]
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_lsp/addon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class << self
sig { returns(T::Array[T.class_of(Addon)]) }
attr_reader :addon_classes

# Automatically track and instantiate addon classes
# Automatically track and instantiate add-on classes
sig { params(child_class: T.class_of(Addon)).void }
def inherited(child_class)
addon_classes << child_class
Expand All @@ -65,7 +65,7 @@ def load_addons(global_state, outgoing_queue)
e
end

# Instantiate all discovered addon classes
# Instantiate all discovered add-on classes
self.addons = addon_classes.map(&:new)
self.file_watcher_addons = addons.select { |addon| addon.respond_to?(:workspace_did_change_watched_files) }

Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_lsp/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def ==(other)
sig { abstract.returns(LanguageId) }
def language_id; end

# TODO: remove this method once all nonpositional requests have been migrated to the listener pattern
# TODO: remove this method once all non-positional requests have been migrated to the listener pattern
sig do
type_parameters(:T)
.params(
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_lsp/requests/code_action_resolve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def refactor_variable
return Error::InvalidTargetRange if closest_node.is_a?(Prism::MissingNode)

closest_node_loc = closest_node.location
# If the parent expression is a single line block, then we have to extract it inside of the oneline block
# If the parent expression is a single line block, then we have to extract it inside of the one-line block
if parent_statements.is_a?(Prism::BlockNode) &&
parent_statements.location.start_line == parent_statements.location.end_line

Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_lsp/requests/completion_resolve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def perform

# Based on the spec https://microsoft.github.io/language-server-protocol/specification#textDocument_completion,
# a completion resolve request must always return the original completion item without modifying ANY fields
# other than detail and documentation (NOT labelDetails). If we modify anything, the completion behaviour might
# other than detail and documentation (NOT labelDetails). If we modify anything, the completion behavior might
# be broken.
#
# For example, forgetting to return the `insertText` included in the original item will make the editor use the
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_lsp/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def run_initialized
@global_state.register_formatter("rubocop", Requests::Support::RuboCopFormatter.new)
rescue RuboCop::Error => e
# The user may have provided unknown config switches in .rubocop or
# is trying to load a non-existant config file.
# is trying to load a non-existent config file.
send_message(Notification.window_show_error(
"RuboCop configuration error: #{e.message}. Formatting will not be available.",
))
Expand Down
2 changes: 1 addition & 1 deletion test/erb_document_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_erb_document_handles_windows_newlines
assert_equal(" \r\nbar ", document.parse_result.source.source)
end

def test_erb_syntax_error_doesnt_cause_crash
def test_erb_syntax_error_does_not_cause_crash
[
"<%=",
"<%",
Expand Down
2 changes: 1 addition & 1 deletion test/global_state_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_applying_auto_formatter_with_rubocop_as_transitive_dependency_without_c
assert_equal("none", state.formatter)
end

def test_applying_auto_formatter_with_rubocop_as_transitive_dependency_and_sytax_tree
def test_applying_auto_formatter_with_rubocop_as_transitive_dependency_and_syntax_tree
state = GlobalState.new

stub_direct_dependencies("syntax_tree" => "1.2.3")
Expand Down
2 changes: 1 addition & 1 deletion test/requests/semantic_highlighting_expectations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Post
{ delta_line: 1, delta_start_char: 2, length: 13, token_type: 13, token_modifiers: 0 },
decoded_response[1],
)
# This is the token modified by the addon
# This is the token modified by the add-on
assert_equal(
{ delta_line: 1, delta_start_char: 2, length: 13, token_type: 15, token_modifiers: 1 },
decoded_response[2],
Expand Down
2 changes: 1 addition & 1 deletion test/server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def deactivate; end

Class.new(RubyLsp::Addon) do
def activate(global_state, outgoing_queue)
# simulates failed addon activation
# simulates failed add-on activation
raise "boom"
end

Expand Down
2 changes: 1 addition & 1 deletion test/type_inferrer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class User
assert_equal("Admin::User", @type_inferrer.infer_receiver_type(node_context).name)
end

def test_infer_forwading_super_receiver
def test_infer_forwarding_super_receiver
node_context = index_and_locate(<<~RUBY, { line: 2, character: 4 })
class Foo < Bar
def initialize
Expand Down

0 comments on commit 470896c

Please sign in to comment.