Lazy Index Entries
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、提案されている @listener.add_lazy_method と linearized_ancestors_of の呼び出し周辺にあるインデックス構築および検索の経路を追跡します。RubyIndex::Entry::Method と既存のインデックスエントリの処理を確認します。インデックス作成中に遅延エントリを保存でき、インデックス作成後に評価でき、proc が nil を返した場合に除外できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I have checked that this feature is not already implemented
- This feature does not exist
Use case
For every Ruby DSL I can think of, false positives could be avoided by querying the index to understand the context of the call. For example, the belongs_to DSL method in Rails is only available on descendants of ActiveRecord::Base.
Unfortunately, it is not possible to query the index to check if the current context inherits from ActiveRecord::Base while still building the index.
Description
I think this problem could be solved by allowing you to store lazy “potential” entries in the index. Let’s say you pick up the method call belongs_to :user. You want to define the method user as a result of this, but only if the class inherits from ActiveRecord::Base.
What if you could add an entry like this?
@listener.add_lazy_method("user") do |index|
if index.linearized_ancestors_of(owner).include?("ActiveRecord::Base")
RubyIndex::Entry::Method.new(
# ...
)
end
end
The index could store that there is potentially a method called user and its signature is in this Proc.
At lookup time, once the indexing is completed, the proc could be executed and if it returns nil, the entry is ignored. Otherwise, the returned Method entry is used.
Implementation
No response
- 主要言語
- Ruby
- スター
- 2k
- フォーク
- 284
- 平均マージ
- 11時間 11分
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Shopify/ruby-lsp のほかの issue
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memory対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
Multi-line `<%# %>` ERB comments are parsed as Ruby, so semantic highlighting colors the prose as method calls対応中かも @Pybsama が 72 日前に担当しました。 オープンbug Stale
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Shopify/ruby-lsp#4181 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Linux file system with square brackets in the directory/filename are failing to be indexed対応中かも @andriytyurnikov が 205 日前に担当しました。 オープンbug help-wanted pinned
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Shopify/ruby-lsp#3503 · コメント 8 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Rename of a class moves its file and leaves require_relative on the old path対応中かも @efegokdemir が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
-
Paths need to be escaped対応中かも @Vraiment が 6 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
Shopify/ruby-lsp の issue をすべて見る
似ている issue
-
ds-drift
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
we-promise/sure#4120 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
scanaislop/aislop#476 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
area/web interface
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
mastodon/mastodon#41000 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信