Skip to content

Commit

Permalink
Fix spellings
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Oct 16, 2024
1 parent 779f81e commit 495d94e
Show file tree
Hide file tree
Showing 21 changed files with 114 additions and 28 deletions.
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
2 changes: 1 addition & 1 deletion jekyll/contributing.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The [ruby-lsp repository](https://github.com/Shopify/ruby-lsp) contains three su

- the **language server** (`ruby-lsp`), which exists at the top level of the repository. Most features are implemented here since everything implemented in the server is available to all editors
- the **VS Code extension**, which exists under the `vscode` directory. Any custom VS Code features are implemented here
- the **documentation** website, which exists under the `jekyll` directory. All user facing documentation for both the Ruby LSP and the Rails addon is contained here
- the **documentation** website, which exists under the `jekyll` directory. All user facing documentation for both the Ruby LSP and the Rails add-on is contained here

This contributing guide is split by each component.

Expand Down
4 changes: 2 additions & 2 deletions jekyll/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,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 lib/ruby_indexer/lib/ruby_indexer/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,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
10 changes: 5 additions & 5 deletions lib/ruby_indexer/lib/ruby_indexer/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,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 @@ -974,10 +974,10 @@ 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
# 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
# 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
sig { params(name: String, nesting: T::Array[String]).returns(String) }
def build_non_redundant_full_name(name, nesting)
# If there's no nesting, then we can just return the name as is
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 @@ -209,7 +209,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 @@ -100,7 +100,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 @@ -46,7 +46,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 Down Expand Up @@ -82,7 +82,7 @@ def load_addons(global_state, outgoing_queue, include_project_addons: true)
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 @@ -121,7 +121,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 @@ -302,7 +302,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_message(
"RuboCop configuration error: #{e.message}. Formatting will not be available.",
type: Constant::MessageType::ERROR,
Expand Down
86 changes: 86 additions & 0 deletions project-words
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
activestorage
autocorrect
autoloaded
autorun
bigdecimal
bindir
binread
Bizt
Bizw
bufnr
byteslice
codepoint
codepoints
concats
copen
Corge
dont
eglot
Eglot
eruby
EXTGLOB
FIXEDENCODING
Floo
fnmatch
fooo
hostedtoolcache
importmap
indexables
ipairs
Itest
ivar
Jaro
Kaigi
klass
kwargs
linearization
linearizes
linearizing
lockfiles
lspconfig
Lstart
metaprogramming
mkpath
multibyte
nargs
nodoc
noreturn
nvim
qtlzwssomeking
quickfixes
quxx
quux
rdbg
realpath
reparsing
requireds
rhtml
rindex
rjson
rmtree
rubyfmt
rubylibdir
rubylibprefix
setqflist
shadowenv
shellwords
snode
somethi
spoom
Spoom
streerc
stringio
strscan
subexpression
supertypes
suppo
unaliased
unindexed
unparser
unresolve
Vinicius
Winkler
XQRK
yarp
YARP
YJIT
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/fixtures/prism
Submodule prism updated 104 files
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 @@ -714,7 +714,7 @@ def version

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 @@ -249,7 +249,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 495d94e

Please sign in to comment.