Skip to content

Commit

Permalink
Fix an error when using built-in LSP
Browse files Browse the repository at this point in the history
This PR fixes the following error when using built-in LSP with Ruby 3.4dev (default by Prism).

LSP log (eglot-events-buffer):

```console
[jsonrpc] e[04:03:30.163] --> workspace/didChangeConfiguration {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
[stderr]  [server] RuboCop 1.66.1 language server +YJIT initialized, PID 5753
(snip)

[stderr]  [server] Error NameError uninitialized constant RuboCop::LSP::Runtime::StringIO
[stderr]  [server] ["/Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/lsp/runtime.rb:85:in 'RuboCop::LSP::Runtime#redirect_stdout'",
```

Ruby version:

```console
$ ruby -v
ruby 3.4.0dev (2024-09-19T18:51:21Z master 2230ac4a28) +PRISM [x86_64-darwin23]
```
  • Loading branch information
koic committed Sep 21, 2024
1 parent cabd576 commit 29e462e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rubocop/lsp/runtime.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'stringio'

#
# This code is based on https://github.com/standardrb/standard.
#
Expand Down

0 comments on commit 29e462e

Please sign in to comment.