Using ede-php-autoload with PHP-mode
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Empieza revisando los puntos de integración de PHP-mode mostrados en el issue, especialmente php-mode-hook, php-mode-map y los ejemplos de uso de ede-php-autoload. El issue no define un cambio concreto ni pruebas; el trabajo solo se considera terminado después de acordar el comportamiento de integración deseado y las comprobaciones de aceptación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Emacs Lisp
- Estrellas
- 604
- Forks
- 117
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de emacs-php/php-mode
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Todos los issues de emacs-php/php-mode
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
bug good first issue hacktoberfest
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
codercops/discord-bot#57 ·
Los mantenedores suelen responder en 1 día
-
uno-testing: the step-by-step procedure serializes tool use (1.7 vs 2.3 tools/call)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
unoplatform/studio#200 ·
Los mantenedores suelen responder en 1 día
-
axisPlacement for stateTimelineAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100