oss-gate / workshop

OSSの開発に未参加または参加したことはあるけどまだ自信がない人を後押しするワークショップ用のリポジトリー
125 stars 548 forks source link

OSS Gate Workshop: Tokyo: 2024-09-21: yamatowani: Ruby LSP: Work log #1885

Closed yamatowani closed 23 minutes ago

yamatowani commented 5 hours ago

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 Workshop: ${LOCATION}: ${YEAR}-${MONTH}-${DAY}: ${ACCOUNT_NAME}: ${OSS_NAME}: Work log

タイトル例↓:

OSS Gate Workshop: Tokyo: 2017-01-16: kou: Rabbit: Work log

OSS Gateワークショップ関連情報

yamatowani commented 5 hours ago

ruby LSPはコードジャンプ(Go To Definition)がRuby Solargraphよりもできる範囲が狭い...?

yamatowani commented 5 hours ago

ruby LSPはコードジャンプがRuby Solargraphよりもできる範囲が狭い...?

Qiitaにもそんな声が https://qiita.com/NaokiIshimura/items/dbe6a9dc0af59fde0c6b

yamatowani commented 3 hours ago

https://github.com/user-attachments/assets/f0a03720-69b1-4235-89c5-3cec28d1f1b8

Go To Difinition機能がうまく動作しない

yamatowani commented 3 hours ago

ドキュメントがこれだけであまり充実していない...?

スクリーンショット 2024-09-21 13 31 21

https://shopify.github.io/ruby-lsp/#go-to-definition

yamatowani commented 3 hours ago
スクリーンショット 2024-09-21 13 53 33

https://qiita.com/NaokiIshimura/items/dbe6a9dc0af59fde0c6b

上記の記事に

(インスタンス化したクラスのメソッド呼び出しから、定義元クラスの先頭にしかジャンプできなかった)

とあるが、再現できず。

https://github.com/user-attachments/assets/361b5621-f3bd-4272-a532-e32138698760

yamatowani commented 2 hours ago

Environment

再現手順

yamatowani commented 2 hours ago

日本語のコメントがあるとできないけど、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
yamatowani commented 2 hours ago

Gemfile

# frozen_string_literal: true

source 'https://rubygems.org'

ruby '3.2.4'

gem 'debug', platforms: %i[mri windows]
gem 'rubocop'
yamatowani commented 1 hour ago

下記のissueにコメント投げてみた

https://github.com/Shopify/ruby-lsp/issues/1347

I have a similar problem, How is your progress?

Description

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

environment

github-actions[bot] commented 23 minutes ago

おつかれさまでした!

ワークショップの終了にともないissueを閉じますが、このまま作業メモとして使っても構いません :ok_hand:

ワークショップの感想を集めています!

ブログなどに書かれた際は、このページへリンクの追加をお願いします :pray:

またの参加をお待ちしています!