Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yamatowani opened this issue Sep 21, 2024 · 10 comments
Closed
Labels
work log ワークショップ作業メモ

Comments

@yamatowani
Copy link
Contributor

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ワークショップ関連情報

  • スライド:ワークショップの進行に使っているスライドがあります。
  • チャット:OSS開発に関することならなんでも相談できます。ワークショップが終わった後もオンラインで相談しながら継続的にOSSの開発に参加しましょう!
  • シナリオ:ワークショップの目的・内容・進め方の詳細が書いています。
  • 過去のビギナーの作業ログ:他の人の作業ログから学べることがいろいろあるはずです。
@yamatowani yamatowani added the work log ワークショップ作業メモ label Sep 21, 2024
@yamatowani
Copy link
Contributor Author

yamatowani commented Sep 21, 2024

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

@yamatowani
Copy link
Contributor Author

yamatowani commented Sep 21, 2024

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

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

@yamatowani
Copy link
Contributor Author

yamatowani commented Sep 21, 2024

2024-09-21.12.37.05.mov

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

  • ドキュメントにはF12を押すか、右クリックしてGo To Definitionを押しても、定義されているはずのUserMailerクラスやaccount_activationメソッドにジャンプできない

@yamatowani
Copy link
Contributor Author

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

スクリーンショット 2024-09-21 13 31 21 https://shopify.github.io/ruby-lsp/#go-to-definition

@yamatowani
Copy link
Contributor Author

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

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

上記の記事に

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

とあるが、再現できず。

2024-09-21.13.56.05.mov

@yamatowani yamatowani changed the title OSS Gate Workshop: 東京: 2024-09-21: yamatowani: ${OSS_NAME}: Work log OSS Gate Workshop: Tokyo: 2024-09-21: yamatowani: Ruby LSP: Work log Sep 21, 2024
@yamatowani
Copy link
Contributor Author

Environment

  • macOS Sonoma 14.4
  • ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]
  • Rails 7.0.4.3
  • About VSCode
    • Version: 1.93.1 (Universal)
    • Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
    • Date: 2024-09-11T17:20:05.685Z
    • Electron: 30.4.0
    • ElectronBuildId: 10073054
    • Chromium: 124.0.6367.243
    • Node.js: 20.15.1
    • V8: 12.4.254.20-electron.0
    • OS: Darwin arm64 23.4.0

再現手順

@yamatowani
Copy link
Contributor Author

yamatowani commented Sep 21, 2024

日本語のコメントがあるとできないけど、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
Copy link
Contributor Author

Gemfile

# frozen_string_literal: true

source 'https://rubygems.org'

ruby '3.2.4'

gem 'debug', platforms: %i[mri windows]
gem 'rubocop'

@yamatowani
Copy link
Contributor Author

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

Shopify/ruby-lsp#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

  • macOS Sonoma 14.4
  • ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]
  • About VSCode
    • Version: 1.93.1 (Universal)
    • Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
    • Date: 2024-09-11T17:20:05.685Z
    • Electron: 30.4.0
    • ElectronBuildId: 10073054
    • Chromium: 124.0.6367.243
    • Node.js: 20.15.1
    • V8: 12.4.254.20-electron.0
    • OS: Darwin arm64 23.4.0

Copy link

おつかれさまでした!

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

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work log ワークショップ作業メモ
Projects
None yet
Development

No branches or pull requests

1 participant