bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.61k stars 94 forks source link

Navigate to classes from yaml files #2868

Closed corretge closed 3 months ago

corretge commented 5 months ago

I have an application with a lot of configuration files in yaml, with information about classes, for example:

app/Htech/etc/route/doc_get_one.yml:
---
method: CLI
path: "/htech/doc/get/{hre}*"
description: Get a document site from Redis.
run: 
  class: \Etram2\Htech\App\Service\Hre
  method: getOne
in:
  type: redis
  envvar: CLI_REDIS_HRN_CONFIG
  root: \Etram2\Root
out:
  type: yaml
  template: none
  reserved: none  

When I'm editing this file in vscode, I'm dreaming to press command + click on the classs name, and go to the definition.

I added *.yml files to intelephense associations:

  "intelephense.files.associations": [
    "*.php",
    "*.yml"
  ]

Describe the solution you'd like Editing this kind of configuration files, if detects a string starting with \ plus one of the namespaces of the application, show the hyperlink to go to the class definition.

Additional context Several years ago, in 2014, there was a Symfony plugin for PHPStorm that do something like this with service definitions and templates.