-
Notifications
You must be signed in to change notification settings - Fork 0
Project Configuration
lexicon-lsp discovers project configuration from workspace roots. The same configuration should be used by all editor integrations.
Accepted filenames:
lexicon-lsp.json.lexicon-lsp.jsonlexicon.conf.lexicon.conf
Prefer lexicon-lsp.json for clarity.
{
"lexicon": "lexicons/commerce.lexicon"
}The path is relative to the configuration file.
Use a single root when one composed lexicon describes the whole workspace.
{
"scope": "apps/storefront",
"lexicon": "lexicons/storefront.lexicon"
}scope limits the mapping to a subtree of the workspace. It is also relative to the configuration file.
{
"lexicons": [
{
"scope": "apps/storefront",
"lexicon": "lexicons/storefront.lexicon"
},
{
"scope": "packages/payments",
"lexicon": "packages/payments/payments.lexicon"
}
]
}The longest matching scope wins for each opened file.
Use this when independent products or packages intentionally have separate roots.
repo/
lexicon-lsp.json
lexicons/
commerce.lexicon
shared-commerce.lexicon
api/
storefront.lexicon
ui/
product.lexicon
apps/
storefront/
src/
packages/
generated/
lexicon-lsp.json:
{
"lexicon": "lexicons/commerce.lexicon"
}lexicons/commerce.lexicon:
@ ./shared-commerce.lexicon
commerce:
api:
storefront:
@ ./api/storefront.lexicon
ui:
product:
@ ./ui/product.lexicon
The server searches workspace roots for configuration files. It skips common generated and dependency directories:
.build.git.swiftpmDerivedDatanode_modulestarget
Open configuration files are also considered when they live inside the workspace root.
If the server starts with an explicit --lexicon argument, that lexicon is the fallback root:
lexicon-lsp --lexicon lexicons/commerce.lexiconIf no explicit root or config exists, opening a .lexicon file can adopt that file as the fallback lexicon.
Project configuration is better for teams because it is deterministic and shared.