TYPO3 specific LSP implementations: Fluid (Q2/2025)

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 tag syntax, 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 for shorthand syntax.
In addition there are various other parts that are specific to TYPO3 which could benefit from additional LSP support (see goals for further examples).

What do you want to achieve by the end of Q2 2025?

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 12 LTS and 13 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 tag 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/key parameter will provide all ids of the locallang.xlf of this extension
    • typoscriptObjectPath argument of <f:cObject /> will provide all configured cObjects
    • name argument of <f:layout /> will provide completion of all available layouts for this template and “goto definition” will jump to the layout file
    • section 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 of LLL: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:

  • LSP functionality for TypoScript like completion, syntax highlighting etc.
  • New tolerant 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 and vice versa
  • LSP functionality inside yaml files like form definitions
  • Support for TYPO3 14

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

Please note: After the start of the voting we can not change the idea description nor the idea outcome. If this idea is selected by the members, it must be archived as described.

1 Like

Please also see the Ideas in 2024: