by Manfred egger
What is your idea about?
Code-/Autocompletion/Intellisense for Fluid tags is only possible in IDEs which support XSD based autocompletion for HTML (and not only XML) and only for tags not for shorthand syntax. With a language server we could have autocompletion and other LSP functionality in all IDEs which support LSP. And not only in HTML but also other template formats and shorthand syntax.
In addition there are various other parts that are specific to TYPO3 could benefit from additional LSP support (see goals for further examples).
What do you want to achieve by the end of Q2 2024?
The LSP will be implemented as TYPO3 extension which provides a console command. With this console command IDEs are able to connect to a specific TYPO3 installation. As there are many features in TYPO3 which are evaluated at runtime, an extension can get all needed informations of a TYPO3 installation which couldn’t be determined by a standalone tool.
The goals to be achieved by the end of Q2 - aka the first version - will be:
General:
- Basis for LSP implementation based on phpactor/language-server for TYPO3 11 LTS and 12 LTS
- “Extension points” to provide LSP functionality for different TYPO3 features. Via those “extension points” extension developers can also provide additional information to the LSP extension or even provide LSP functionality for own DSLs.
- Implementation LSP functionality for Fluid
- VS Code extension to connect to the LSP
- Neovim sample configuration to connect to the LSP
Fluid:
- LSP features will work independent from the template format (not only inside HTML)
- Code completion for ViewHelpers for tags and shorthand syntax of all ViewHelpers of all installed extensions (not only TYPO3 sysexts but also e.g. “vhs” or “news” if they are installed). Completion will provide namespaces (also merged namespaces), ViewHelpers of this namespace, arguments of the ViewHelper.
- Hover information for tags/shorthand syntax per ViewHelper
- “Goto defintion” for tags/shorthand syntax (IDE opens the PHP file of the ViewHelper)
- Basic diagnostic information based on the default Fluid parser of the TYPO3 installation
- Code completion for default template preprocessors shipped with TYPO3/Typo3Fluid (allthough there will be various extension points to support LSP features for individual template preprocessors for extension developers)
- ViewHelper specific extensions; examples:
extensionName
argument of<f:translate />
will provide completion for all extension names;id
parameter will provide all ids of the locallang.xlf of this extensiontyposcriptObjectPath
argument of<f:cobject />
will provide all configured cObjectsname
argument of<f:layout />
will provide completion of all available layouts for this template and “goto definition” will jump to the layout filesection
argument of<f:render />
will provide completion for all sections of a partials/template and “goto definition” will jump to the section inside the correct file- ViewHelper specific implementations can be added by extension developers through events (in addition to the out-of-the-box functionality for all available ViewHelpers regardless of the extension)
General:
- Code completion and file linking of “EXT:” paths in most file types (means: not only Fluid, but also in TypoScript files, PHP files etc. as long as they are complete parts - no variables or constants!)
- Code completion and file linking of “LLL:EXT:” paths
- Code completion, hover support and “goto definition” for LLL paths containing XLF ids (e.g. hovering over
CType.textmedia
ofLLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.textmedia
will show “Text & Media”) - Maybe part of the first version: Completion of PHP classes for usage inside (not only) TypoScript or YAML files
- Unit Tests
Some ideas for the project after Q2:
- Supporting TYPO3 13 LTS
- LSP functionality for TypoScript like completion, syntax highlighting etc.
- New Fluid parser to get
- better diagnostics (functionality with current Typo3Fluid implementation is limited for use in LSPs)
- Code actions like transforming tag syntax to shorthand syntax
- LSP functionality inside yaml files like form definitions
What is the potential impact of your idea for the overall goal?
Developers can have code completion, hover support, “goto definition” and other LSP features in (not only) Fluid templates. The speed of developing in TYPO3 can be increased.
Which budget do you need for your idea?
10.000 Euro