ifc-language-server is a lightweight Language Server Protocol server for IFC STEP P21 files (ISO 10303). It provides schema-aware IFC editing features, local STEP id navigation, diagnostics, semantic tokens, and editor assistance for IFC entity arguments.
- Hover on IFC entity names such as
IFCWALLandIFCSPACE - Hover preview for entity references such as
#123 - Derived
*hover forIfcSIUnitandIfcGeometricRepresentationSubContext - Go-to-definition for local entity references
- Find-references within the current document
- Document highlight for local STEP ids such as
#123 - Signature help for IFC entity parameter lists
- Document symbols for editor Outline, breadcrumbs, and go-to-symbol navigation
- IFC STEP boilerplate via
!ifc/!!ifc/!!!ifccompletions and empty-document code actions - Range-based semantic tokens for syntax highlighting
- Schema-aware diagnostics for:
- invalid local reference targets
- primitive datatype mismatches
- invalid enumeration values
- incorrect entity argument counts
- invalid
$/*usage for attributes
Bundled entity documentation is currently included for:
- IFC 2.3.0.1
- IFC 4.0.2.1
- IFC 4.3.2.0
- Single-document navigation only
- Full-document reparsing on open and change
- Diagnostics currently focus on entity-instance argument validation, not full EXPRESS rule evaluation
- No general completion, rename, or formatting support
- Code actions are currently limited to IFC boilerplate insertion for empty documents
- The LSP server provides range-based semantic tokens, but does not provide full-document semantic-token or TextMate grammar support
Extensions for VSCode and Zed are available for local installation (though still under development):
Release binaries are available on the Releases page.
After downloading a release:
- Place the
ifc-language-serverbinary somewhere on yourPATH, or configure your editor to point to the absolute binary path. - Register it as the language server for IFC STEP files in your editor or IDE.
- Rust (stable): https://www.rust-lang.org/tools/install
- An editor with LSP client support such as Helix, Neovim, VS Code, or Zed
Build a release binary with:
cargo build --releaseThe server accepts configuration through LSP initializationOptions.
Supported options:
-
overwriteExpSchemaWithLocal- A single path to a local
.expfile. - If set, the server always uses that schema for diagnostics and hover, regardless of the
FILE_SCHEMA(...)declared in the IFC file. - If the forced schema does not match the schema declared in the IFC file, the server shows a warning and continues with the forced schema.
- A single path to a local
-
addLocalSchemaToSelection- A list of local paths.
- Each path may point to either:
- a single
.expfile - a directory containing
.expfiles
- a single
- These schemas are added to the server's schema selection pool.
- When an IFC file declares a schema name that is not bundled, the server checks the configured local schemas for an exact
SCHEMA ...;name match and loads the matching schema on demand.
-
astFileSizeLimitMb- Maximum file size in MiB for AST-backed features.
- Defaults to
70. - Files above this limit keep basic hover/navigation, document highlight, signature help, and semantic tokens available, but skip schema diagnostics and derived-value hover.
-
semanticTokensEnabled- Enables range-based semantic tokens.
- Defaults to
true.
Configuration changes currently require restarting the server.
Example initializationOptions:
{
"overwriteExpSchemaWithLocal": "/Users/alice/dev/express/IFC4x2.exp",
"astFileSizeLimitMb": 128,
"semanticTokensEnabled": true,
"addLocalSchemaToSelection": [
"/Users/alice/dev/express/IFC4x1.exp",
"/Users/alice/dev/express/custom-schemas"
]
}This project depends on the published tree-sitter-ifc crate for IFC parsing.
If you are developing the grammar itself, work in the tree-sitter-ifc repository and publish a new crate version when needed. During local development, you can temporarily override the crates.io dependency with a [patch.crates-io] entry that points at a local checkout.
Contributions are welcome. Read Architecture and Coding Guidelines before submitting a PR.
MIT