Closed yamatowani closed 23 minutes ago
ruby LSPはコードジャンプ(Go To Definition)がRuby Solargraphよりもできる範囲が狭い...?
ruby LSPはコードジャンプがRuby Solargraphよりもできる範囲が狭い...?
Qiitaにもそんな声が https://qiita.com/NaokiIshimura/items/dbe6a9dc0af59fde0c6b
https://github.com/user-attachments/assets/f0a03720-69b1-4235-89c5-3cec28d1f1b8
Go To Difinition機能がうまく動作しない
UserMailer
クラスやaccount_activation
メソッドにジャンプできないドキュメントがこれだけであまり充実していない...?
https://qiita.com/NaokiIshimura/items/dbe6a9dc0af59fde0c6b
上記の記事に
(インスタンス化したクラスのメソッド呼び出しから、定義元クラスの先頭にしかジャンプできなかった)
とあるが、再現できず。
https://github.com/user-attachments/assets/361b5621-f3bd-4272-a532-e32138698760
日本語のコメントがあるとできないけど、5文字未満の場合はできることが判明
コードジャンプできるコード
class Foo
# ああああ
def foobar
puts 'foobar'
end
end
foo = Foo.new
foo.foobar
コードジャンプできないコード
class Foo
# あああああ
def foobar
puts 'foobar'
end
end
foo = Foo.new
foo.foobar
Gemfile
# frozen_string_literal: true
source 'https://rubygems.org'
ruby '3.2.4'
gem 'debug', platforms: %i[mri windows]
gem 'rubocop'
下記のissueにコメント投げてみた
https://github.com/Shopify/ruby-lsp/issues/1347
I have a similar problem, How is your progress?
I'm also using VSCode's ruby-lsp plugin, but it seems that if there is more than 13 bytes of character data, including multibyte characters, in the method comment, I cannot define a jump.
Specifically, it is not possible to jump from the followingfoobar
instances to the definition source.
Case | Data Quantity | Result |
---|---|---|
"あああ" | 9byte | Success |
"ああああ" | 12byte | Success |
"ああああa" | 13byte | Failed |
"あああああ" | 15byte | Failed |
Success File
class Foo
# ああああ
def foobar
puts 'foobar'
end
end
foo = Foo.new
foo.foobar
Failed File
class Foo
# あああああ
def foobar
puts 'foobar'
end
end
foo = Foo.new
foo.foobar
おつかれさまでした!
ワークショップの終了にともないissueを閉じますが、このまま作業メモとして使っても構いません :ok_hand:
ワークショップの感想を集めています!
ブログなどに書かれた際は、このページへリンクの追加をお願いします :pray:
またの参加をお待ちしています!
This is a work log of a "OSS Gate workshop". "OSS Gate workshop" is an activity to increase OSS developers. Here's been discussed in Japanese. Thanks.
作業ログ作成時の説明
以下のテンプレートを埋めてタイトルに設定します。埋め方例はスクロールすると見えてきます。
タイトル例↓:
OSS Gateワークショップ関連情報