Skip to content

Other Options

Nick Kwiatkowski edited this page Nov 25, 2026 · 1 revision

Other Options

Every .clif.json / initializationOptions key that is not about formatting or linting. For the overall shape and precedence rules see LSP Initialization Options.

Contents: Workspace · Mappings · Expression mappings · Startup files · Custom tags · Component resolvers · Property resolvers · Service property resolvers · Bean paths · Java stubs · Routes · Features · Completions · Doc blocks · References · Debug


Workspace

{
  "workspaceName": "myproject",
  "workspacePaths": [".", "../shared-lib"],
  "workspaceIndexGlobs": ["packages/**/*.cfc", "models/**/*.cfc"]
}
Key Type Default Description
workspaceName string — Unique project name. Derives the daemon socket path, so sessions naming the same project share one index. Needed in .clif.json for daemon mode
workspacePaths string[] The editor's workspace folders (or the CLI's path arguments) Folders treated as workspace roots, relative to the config file. List sibling projects here so their components resolve
workspaceIndexGlobs string[] every .cfc Glob patterns filtering which .cfc files are indexed

Mappings

Resolve component dot-paths that use a virtual root.

{
  "mappings": {
    "models": "./src/models",
    "lib": "/opt/shared/cfml-lib"
  }
}
Input Resolves to
new models.User() ./src/models/User.cfc
extends="lib.base.Service" /opt/shared/cfml-lib/base/Service.cfc
Rule Detail
Keys The first segment of a dot-path
Values Directories, absolute or relative to the config
Workspace folders A folder in workspacePaths is itself a mapping of its own name: with "workspacePaths": ["../tassweb"], tassweb.packages.core.Kernel resolves to ../tassweb/packages/core/Kernel.cfc. Tried last, after every explicit and Application.cfc mapping
Application.cfc this.mappings are read as the engine builds them, including expandPath(), getDirectoryFromPath( getCurrentTemplatePath() ), earlier mappings and multi-segment names (/modules/wheels, longest first)
CFConfig Physical non-root mappings in .cfconfig.json (or the file server.json names) supply defaults; Application.cfc overrides them, and explicit config mappings override both (case-insensitive)
Project layouts Recognised standard layouts can supply missing root and library mappings; explicit mappings keep priority

Expression mappings

Substitute a runtime expression that appears inside a component path with a literal value, so the path can be resolved statically.

{
  "expressionMappings": {
    "#VARIABLES._core#": "packages.tass.core."
  }
}
Source Resolved as
createObject( "component", "#VARIABLES._core#kernel" ) packages.tass.core.kernel

Startup files

REQUEST, SESSION, APPLICATION and SERVER variables are usually set up in one place and read everywhere. The server types them from the templates that set the request up:

Source Configuration
Templates the governing Application.cfc/.cfm includes (recursively) Automatic
startupFiles entries For code under no Application.cfc, or templates none includes; applies to the whole workspace
{
  "startupFiles": ["/tassweb/packages/tass/core/bootstrap.cfm", "config/bootstrap.cfm"]
}

An entry is a file path (relative to the config or absolute) or a template path starting with /, resolved as a cfinclude would be (through mappings, workspace folders and a folder named by its first segment).

Assignments of the form SCOPE.name = value are read in tag or script syntax. The value is typed if it creates a component (createObject("component", …), new …) or is a chain of calls on another shared variable or a resolver match:

<!--- bootstrap.cfm --->
<cfset REQUEST.kernel = createObject("component", "packages.core.Kernel")>
<cfset REQUEST.context = REQUEST.kernel.getContextObject()>

Anywhere in the workspace, REQUEST.context.getUser() is then checked against whatever Kernel.getContextObject() returns.


Custom tags

Go-to-definition and document links follow a custom tag call to the template it runs:

Call Where the template is looked for
<cf_name>, cf_name(...) The caller's directory, then the custom tag paths
<cfmodule name="a.b">, cfmodule(name="a.b"), module name="a.b"; a/b under the custom tag paths
<cfmodule template="x.cfm"> The path, found as a cfinclude's is
<cfimport taglib="lib" prefix="ui"> then <ui:name> name in lib
<cfabridge> bridge in a customTagPaths entry with prefix cfa
{
  "customTagPaths": [
    "shared/customtags",
    { "directory": "lib/tags", "recursive": true },
    { "directory": "lib/bridge", "prefix": "cfa" },
    { "directory": "lucee/library/tag", "prefix": "cf" }
  ]
}
Entry property Type Description
(bare string) string A directory, relative to the config
directory string The directory
recursive boolean Also search subdirectories (shallowest match wins)
prefix string Makes the entry a tag library: <cfabridge> runs bridge.cfm for prefix cfa

Search order: this.customTagPaths from Application.cfc; then customTagPaths entries without a prefix; then the CFConfig file's customTagMappings (Lucee) or customTagPaths (CommandBox). Names are tried as .cfm, .cfc, .cfml, case-insensitively. A name written with #…# is not followed.


Component resolvers

Teach the LSP how custom factory patterns resolve to components, enabling go-to-definition, completion and method checks on the result.

{
  "componentResolvers": [
    { "match": "getService(\"$1\")", "resolve": "packages.$1.service", "prefix": "getService" },
    { "match": "_parent", "resolve": "packages.tass.core.kernel2", "prefix": "_parent" },
    { "call": { "function": "getBean", "namedArgument": true, "moreArguments": true }, "resolve": "$1" }
  ]
}
Property Type Required Default Description
match string Yes (or call) — Pattern matched against the right-hand side of an assignment. $1, $2 … capture. Without a placeholder it is an exact variable-name match. Case-insensitive; qualifiers before it are ignored
call object Yes (or match) — A match written as the call it recognises; see below. Wins over match
resolve string Yes — Component dot-path or file path template; $1 is replaced with the capture. Supports ${1:lower} style transforms. File paths are normalised to dot-paths
prefix string Yes (defaults to call.function) — Fast-check string: expressions without it are skipped. Pipe-delimit alternatives: "createModel|buildModel"
anchored boolean No false Require prefix at the start of the expression
noFollow boolean No false Accept calls on the result without checking the method exists (dynamic factories, incomplete Java stubs)
dynamicIfMissing boolean No false A component this resolver produces that names no file is treated as dynamic instead of reported missing
nameOnly boolean No false Says what a variable of that name holds, not what calls on it return: x = document is typed, x = document.load() is not

call object

Property Type Description
function string The function called
namedArgument boolean Also accept the string by name: getBean( name = "x" )
moreArguments boolean Allow further arguments: getBean( "x", true )

A call rule matches only when the call ends the expression, so getBean( "a" ).run() is a call of run on what getBean returns. It does not match computed arguments (getBean( computed ), getBean( "a" & b )).

Matching examples

{"match": "getService(\"$1\")", "resolve": "packages.$1.service", "prefix": "getService"}:

Expression Resolves to
getService("timetable") packages.timetable.service
_parent.getService("timetable") packages.timetable.service
VARIABLES._parent.getService("timetable") packages.timetable.service

anchored stops a broad catch-all from claiming expressions that merely contain its prefix:

Rule Expression Without anchored With anchored
{"prefix": "document", "match": "document", "resolve": "app.document"} domobject_document app.document (wrong) no match
{"prefix": "get", "match": "get$1()", "resolve": "packages.tass.${1:lower}"} VARIABLES._document.getDirectContent() packages.tass.directcontent (wrong) no match
same getPageTools() packages.tass.pagetools packages.tass.pagetools

A match containing a backslash is read as a regular expression. That is deprecated: clif warns on startup. Use placeholders, a call rule, or a framework preset.

Use clif explain <file> <line> or the "Explain call resolution" code action to see which resolver fired.


Property resolvers

Map a <cfproperty> / property attribute to a component.

{
  "propertyResolvers": [
    { "attribute": "inject", "match": "model:$1", "resolve": "models.$1" }
  ]
}
Property Type Description
attribute string The property attribute to read (e.g. inject, type)
match string Pattern against the attribute value; $1 captures
resolve string Component dot-path template

Without a rule, inject="UserService@users" is typed by WireBox convention (see Support for Frameworks).


Service property resolvers

Recognise <!--- @serviceproperty varName kind|name ---> comments documenting the real component of a generically typed dependency.

{
  "servicePropertyResolvers": {
    "service": "tassweb.packages.${name}.service",
    "package": "tassweb.packages.${name}"
  }
}
Comment Resolves objGLJournal to
<!--- @serviceproperty objGLJournal service|gljournal ---> tassweb.packages.gljournal.service

Bean paths

Roots of DI-managed components. A CFC under a bean path whose public setName(Name) setter takes one generic argument learns the dependency's bean type (including literal aliases); generated getters return it.

{
  "beanPaths": { "services": "./model/services", "gateways": "./model/gateways" }
}

beanPaths and propertyResolvers apply to the unresolved report and code map as they do in the editor. A getBean component resolver with "resolve": "$1" also learns literal declareBean() / addAlias() registrations from startup files.


Java stubs

{ "javaStubsPath": "tassweb.packages.tass.javastubs" }

When set, createObject("java", "X") resolves to <javaStubsPath>.X with no hand-written resolver. Without a stub, Java objects are dynamic.


Routes

Describe a framework's convention for turning a dotted route into a controller method and a view. Enables route edges in the code map, go-to-definition from a route, and document links. Check it with clif routes.

"routes": {
  "attributes":  ["data-view", "data-read", "data-process"],
  "queryParams": ["do"],                        // href="x.cfm?do=a.b.c"
  "properties":  ["read", "view", "process"],   // { view: "a.b.c" }
  "functions":   ["redirect", "setPrint"],      // any string argument
  "suffixes":    ["iframe"],
  "aliases":     { "ui.web": ["tassweb", "kiosk", "parentportal"] },
  "controllers": [
    { "component": "tassweb.packages.tass.${1}-${2}", "method": "${3+:search}" },
    { "component": "tassweb.packages.tass.${1}",      "method": "${2+:search}" }
  ],
  "views": [
    { "longestDir": true, "ext": [".cfm"] },
    { "longestDir": true, "root": "..", "ext": [".cfm"] }
  ]
}

Where routes are found

Property Type Example source
attributes string[] <div data-view="a.b.c"> (case-insensitive)
queryParams string[] href="index.cfm?do=a.b.c"
properties string[] { view: "a.b.c" }
functions string[] redirect("a.b.c"), redirect( route = "a.b.c" ); every string argument is read

How routes are rewritten

Property Type Description
suffixes string[] Trailing segments that say how a target is shown (kiosk.lms.grades.iframe → kiosk.lms.grades). The route is tried as written first
aliases object Rewrite a leading portion; each alias may name several replacements, all returned as candidates

Controller rules (controllers[], tried in order; the method must exist)

Property Type Description
component string Dot-path template, e.g. controllers.${1}
method string Method name template, e.g. ${2} or ${3+:search}

View rules (views[], tried after controllers)

Property Type Default Description
path string — File template relative to root, e.g. views/${1}/${2}
longestDir boolean false Use the longest leading run of segments naming a real directory, the rest as a dotted file name (ui.web.general.popup.lookup.filter → ui/web/general/popup.lookup.filter.cfm)
ext string[] [".cfm"] Extensions to try
root string workspace Directory the path resolves under

Template syntax

Token Meaning a.b.c.d gives
${N} Segment N (1-based) ${2} → b
${N+} Segments N to the end, joined with dots ${2+} → b.c.d
${N-M} Segments N to M ${2-3} → b.c
:concat Join without dots, camel-cased ${2+:concat} → bCD
:slash Join with / ${2+:slash} → b/c/d
:lower / :upper Fold case ${1:upper} → A
:search Try every split point, longest first, checking each against the component's real methods —

A rule that reaches past the end of a route declines it. A literal / in a path separates directories: "webroot/${2}/${3+}" turns tassweb.assessment.dialog.objectivegroup.setup into webroot/assessment/dialog.objectivegroup.setup.cfm.

FW/1 is expressed with the same grammar:

"routes": {
  "queryParams": ["action"],
  "controllers": [{ "component": "controllers.${1}", "method": "${2}" }],
  "views": [{ "path": "views/${1}/${2}" }]
}

Features

Per-capability switches. Set only the keys you want to change; the block is merged key by key. Switching a feature off un-advertises it, so the editor falls back to its own behaviour.

{
  "features": {
    "semanticTokens": false,
    "inlayHints": true,
    "inlayHintsParameterNames": false,
    "renameCrossFile": false
  }
}
Key Default Controls
documentHighlight true Shading other occurrences of the identifier under the cursor
folding true Folding ranges (functions, comments, CFScript blocks, closures, literals, markup elements, <cfelse> branches). Off: the editor folds by indentation
watchedFiles true Re-indexing files changed outside the editor. Off: use clif.reindex
rangeFormatting true Format Selection (requires formatting.enabled)
typeDefinition true Go to Type Definition: from a variable/argument/property to its component, or from a call to its return type
variableDefinitions true Go-to-definition on variables (nine scopes, cross-file for shared scopes)
routes true Go-to-definition and document links for framework routes
outputContextInterpolation true Read #…# in tag files only where ColdFusion evaluates it (<cfoutput>, <cfquery>, <cfmail>, output="true" functions, tag attributes); read a tag-free .cfm as HTML. Changes what the parser reads
structureDiagnostics true Tag-structure diagnostics as you type (300 ms debounce): unclosed-tag, unmatched-close, misplaced-tag, missing-attribute, duplicate-attribute, duplicate-argument
inlayHints true Inlay hints
inlayHintsParameterNames true name: hints before positional arguments (with inlayHints)
inlayHintsComponentPath true Path: (models.User) beside a component declaration (with inlayHints)
rename true Rename a local variable of a script function; refuses where it cannot see every use
renameCrossFile true Extend rename to component methods and properties across the workspace (requires rename); refuses on ambiguous callers or breaking overrides
semanticTokens true textDocument/semanticTokens/full and /range: scopes, functions, methods, built-ins, parameters, new types

Defaults note. Every switch defaults to true. Some older releases shipped structureDiagnostics, inlayHints, rename, renameCrossFile and semanticTokens as opt-in, so set them explicitly if your setup must behave the same on every version.

linting and references are switches of the same kind but keep their own top-level keys.


Completions

{ "completions": { "tagSnippets": true, "functionSnippets": true, "globalFunctionResolution": true } }
Key Default Description
tagSnippets true Tag completions insert snippets with attribute placeholders
functionSnippets true Function completions insert argument placeholders
globalFunctionResolution true Resolve bare calls to functions declared elsewhere in the workspace (completion and go-to-definition)

Set the block only to turn one off.


Doc blocks

What /** expands to.

{
  "docBlock": {
    "gap": true,
    "extra": [
      { "name": "author", "default": "Jane Doe", "types": ["component"] },
      { "name": "since",  "default": "1.0" }
    ]
  }
}
Key Type Default Description
gap boolean true Blank * line between the hint and the tags
extra array [] Tags added to every block
extra[].name string — Tag name (@author)
extra[].default string — Placeholder value
extra[].types string[] all Limit to component, interface, function, property

Inside a doc block, @ completes the attributes of the tag being documented and a function's argument names.


References

textDocument/references ("Find All References") is off by default, because each request walks and parses every CFML file under the workspace roots.

{ "references": { "enabled": true } }
Cursor on Returns
A function name, declared or called Every call site resolving to that function (same-named functions on other components excluded)
A component dot-path (new models.UserDAO(), extends, <cfinvoke component>) Every place that path is written

includeDeclaration is honoured. When a function cannot be pinned to one declaration, the search is scoped by the requesting document.


Debug

{ "debug": true }

Enables development logging and the LSP traffic trace. Read from .clif.json on disk only; restart the server after changing it. See Tracing LSP traffic.

← LSP Initialization Options · Home

Clone this wiki locally