diff --git a/.rubocop.yml b/.rubocop.yml index 11d6299cb6..7ce91d88ae 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,11 +16,10 @@ AllCops: - "sorbet/rbi/shims/**/*.rbi" Exclude: - "vendor/**/*" - - "vscode/**/*" + - "vscode/node_modules/**/*" - "features/**/*" - "test/fixtures/**/*" - "test/expectations/**/*" - - "jekyll/**/*" Layout/LeadingCommentSpace: AllowRBSInlineAnnotation: true @@ -39,6 +38,10 @@ RubyLsp/UseLanguageServerAliases: Exclude: - "test/**/*.rb" +RubyLsp/UseRegisterWithHandlerMethod: + Exclude: + - "jekyll/add-ons.markdown" # this cop doesn't apply to enhancements + Sorbet/FalseSigil: Enabled: false diff --git a/jekyll/Gemfile b/jekyll/Gemfile index c40e888406..eca4db0699 100644 --- a/jekyll/Gemfile +++ b/jekyll/Gemfile @@ -1,4 +1,3 @@ - # frozen_string_literal: true source "https://rubygems.org" diff --git a/jekyll/add-ons.markdown b/jekyll/add-ons.markdown index 7bb01c7c02..02d0e4035c 100644 --- a/jekyll/add-ons.markdown +++ b/jekyll/add-ons.markdown @@ -286,13 +286,13 @@ class MyIndexingEnhancement < RubyIndexer::Enhancement # Create the array of signatures that this method will accept. Every signatures is composed of a list of # parameters. The parameter classes represent each type of parameter signatures = [ - RubyIndexer::Entry::Signature.new([RubyIndexer::Entry::RequiredParameter.new(name: :a)]) + RubyIndexer::Entry::Signature.new([RubyIndexer::Entry::RequiredParameter.new(name: :a)]), ] @listener.add_method( "new_method", # Name of the method location, # Prism location for the node defining this method - signatures # Signatures available to invoke this method + signatures, # Signatures available to invoke this method ) end @@ -576,7 +576,7 @@ require "ruby_lsp/test_helper" class MyAddonTest < Minitest::Test def test_my_addon_works - source = <<~RUBY + source = <<~RUBY # Some test code that allows you to trigger your add-on's contribution class Foo def something @@ -595,9 +595,9 @@ class MyAddonTest < Minitest::Test }, position: { line: 3, - character: 5 - } - } + character: 5, + }, + }, ) # Pop the server's response to the definition request diff --git a/jekyll/vscode-extension.markdown b/jekyll/vscode-extension.markdown index 531adfc001..4da1319c10 100644 --- a/jekyll/vscode-extension.markdown +++ b/jekyll/vscode-extension.markdown @@ -317,7 +317,7 @@ repository is. Consider a project where the top level of the repository is a Rails application and a sub-directory called `frontend` contains a React application that implements the frontend layer. -``` +```txt my_project/ frontend/ Gemfile @@ -354,7 +354,7 @@ A possible configuration for the `super_awesome_project` would be this: Now consider a monorepo where both the client and the server are under sub-directories. -``` +```txt my_project/ client/ server/ diff --git a/vscode/.rubocop.yml b/vscode/.rubocop.yml new file mode 100644 index 0000000000..a1971be040 --- /dev/null +++ b/vscode/.rubocop.yml @@ -0,0 +1,4 @@ +inherit_from: ../.rubocop.yml + +Sorbet: + Enabled: false diff --git a/vscode/README.md b/vscode/README.md index 9ec7528581..b48a69856a 100644 --- a/vscode/README.md +++ b/vscode/README.md @@ -313,7 +313,7 @@ repository is. Consider a project where the top level of the repository is a Rails application and a sub-directory called `frontend` contains a React application that implements the frontend layer. -``` +```txt my_project/ frontend/ Gemfile @@ -350,7 +350,7 @@ A possible configuration for the `super_awesome_project` would be this: Now consider a monorepo where both the client and the server are under sub-directories. -``` +```txt my_project/ client/ server/ diff --git a/vscode/activation.rb b/vscode/activation.rb index 728508fb04..1a585b8c78 100644 --- a/vscode/activation.rb +++ b/vscode/activation.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + env = ENV.filter_map do |k, v| utf_8_value = v.dup.force_encoding(Encoding::UTF_8) "#{k}RUBY_LSP_VS#{utf_8_value}" if utf_8_value.valid_encoding? end env.unshift(RUBY_VERSION, Gem.path.join(","), !!defined?(RubyVM::YJIT)) -STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR#{env.join("RUBY_LSP_FS")}RUBY_LSP_ACTIVATION_SEPARATOR") +$stderr.print("RUBY_LSP_ACTIVATION_SEPARATOR#{env.join("RUBY_LSP_FS")}RUBY_LSP_ACTIVATION_SEPARATOR")