Using ede-php-autoload with PHP-mode
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
まず、issue に示されている PHP-mode の統合ポイント、特に php-mode-hook、php-mode-map、および ede-php-autoload の使用例を確認してください。issue では具体的な変更やテストは定義されていません。望ましい統合動作と受け入れ確認項目について合意して初めて、作業は完了となります。
索引モデルが issue の本文から書いたものです。
説明
ede-php-autoload is a fantastic package that enables Emacs to understand the dependencies of PHP projects, the most immediate benefit of this is that Emacs can translate class names into files, for example allowing you to jump to the definition of a third-party package with the flick of a button.
The package provides PSR-0 and PSR-4 autoload capabilities to the SemanticDB Emacs subsystem and it can be either used as part of the Semantic parsing system, or with some customisation as a standalone package that doesn't require semantic-mode to be active on your php buffers.
Since ede-php-autoload is by nature designed to work in conjunction with semantic PHP parsers, here's a couple of implementations that's worth knowing about:
- @jorissteyn's EDEP package is being updated to work in tandem with
ede-php-autoload. - @stevenremot has originally written
ede-php-autoloadas part of his work to update the CEDET contrib PHP parser to suit the updated PHP syntax, so it's inherently designed to work with it. Here's a version of the CEDET Contrib PHP parser that works withede-php-autoloadand the built-in CEDET version shipped with Emacs 24 and 25.
I personally am using ede-php-autoload without semantic-mode so I've hacked a function that uses it to jump to the declaration of a class imported with use.
(defun ofc/tags-find-at-point ()
"Finds the definitions of the symbol at point using a tag file."
(interactive)
(xref-find-definitions (thing-at-point 'sexp)))
(defun ofc/visit-class-file-at-point ()
"Maps a FQN into a file name using PHP autoload resolution."
(interactive)
(let* ((class-name (replace-regexp-in-string "^\\\\" "" (thing-at-point 'sexp)))
(class-file (ede-php-autoload-find-class-def-file (ede-current-project) class-name)))
(when class-file
(xref-push-marker-stack)
(find-file class-file))))
(defun ofc/php-tags-find-at-point ()
"When called on a FQN, it resolves its name and jumps to the file where it's defined.
When called on anything else it forwards the call to a tag search function."
(interactive)
(unless (ofc/visit-class-file-at-point)
(ofc/tags-find-at-point)))
(global-ede-mode 1)
(add-hook 'php-mode-hook #'ede-php-autoload-mode)
(define-key php-mode-map (kbd "M-.") 'ofc/php-tags-find-at-point)
I would be interested in knowing how @jorissteyn and @stevenremot are using it.
- 主要言語
- Emacs Lisp
- スター
- 602
- フォーク
- 117
- 平均マージ
- 12時間 54分
- マージ済み PR(30日)
- 3
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
emacs-php/php-mode のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
emacs-php/php-mode の issue をすべて見る
似ている issue
-
難易度 2/5 半日 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
JustJarethB/invoicer#54 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
comp/tools P3 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
NousResearch/hermes-agent#126059 ·
メンテナーはふだん 1 日以内に返信