Delphi LSIF

From RAD Studio
Jump to: navigation, search

Go Up to Code Insight Reference


Language Server Index Format (LSIF)

RAD Studio Florence 13.0 updated the DelphiLSP engine with support for the Language Server Index Format (LSIF). This integration reduces dependence on the compiler, thereby improving Code Insight performance, stability, and accuracy.

The LSIF system introduces a new way for DelphiLSP to provide navigation and Code Insight features by using pre-generated index files rather than relying on the compiler. When LSIF data is available, the language server can offer faster, more stable operations such as Go To Definition and Hover information.

When building a package, it is possible to generate the matching LSIF file that includes the symbols defined in the package's units using the Output .lsif file option available on the Linking options.

What LSIF Enables

When LSIF is enabled, Delphi can perform the following actions:

  • The use of prebuilt indexes for many core Delphi frameworks (VCL, FMX, FireDAC, and most RTL components).
  • Serve common navigation requests without invoking the compiler.
  • Improve responsiveness and reduce pauses previously caused by repeated background compilation.

When LSIF is Used

DelphiLSP uses LSIF data when both the referenced package and the file where navigation starts have LSIF.

If the current unit lacks LSIF, the language server automatically falls back to normal compiler-based behavior, even if the target package is fully indexed.

In addition, the entire LSIF caching mechanism can be disabled by setting the following registry key before starting the IDE. Navigate to HKEY_CURRENT_USER\Software\Embarcadero\BDS\XXX\LSP and add a new REG_SZ value, named "EnableLsif" with the value set to false.

Third-Party Libraries

Third-party components do not ship with LSIF files, but developers can generate LSIF for their own libraries if they have the source.

See Also