Class XMLWorkspaceIndexSettings
xml.workspaceIndex).
Disabled by default — users must opt in by setting
"xml.workspaceIndex.enabled": true in their VS Code settings.
When enabled, the server maintains a per-file Bloom filter that powers cross-file grammar reference features: Find References on grammar files, the "N references" code lens, and automatic reference updates on rename.
-
Field Summary
FieldsModifier and TypeFieldDescriptionDefault directory names that are excluded from the workspace scan. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the directory names to skip during the workspace scan.Returns the raw (unparsed) head-limits map.booleanReturnstruewhen the workspace Bloom index is active.voidmerge(XMLWorkspaceIndexSettings newSettings) Copies all settings fromnewSettingsinto this instance.static intparseSizeLimit(String value) Parses a human-readable size string into a character count (not byte count — the index reads Javacharunits).voidsetEnabled(boolean enabled) Enables or disables the workspace Bloom index.voidsetExcludeDirectories(List<String> excludeDirectories) Sets the directory names to skip during the workspace scan.voidsetHeadLimits(Map<String, String> headLimits) Sets the raw head-limits map.
-
Field Details
-
DEFAULT_EXCLUDE_DIRECTORIES
Default directory names that are excluded from the workspace scan. These directories are skipped entirely during the initial index build.
-
-
Constructor Details
-
XMLWorkspaceIndexSettings
public XMLWorkspaceIndexSettings()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returnstruewhen the workspace Bloom index is active.Use case:
checks this flag on every settings change to decide whether to trigger a scan or clear the index.invalid reference
WorkspaceIndexPlugin -
setEnabled
public void setEnabled(boolean enabled) Enables or disables the workspace Bloom index.Use case: Bound to
"xml.workspaceIndex.enabled"in the client settings JSON. When switched tofalse, the plugin immediately clears the index so no stale candidates are served. When switched back totrue, a fresh workspace scan is triggered. -
getExcludeDirectories
Returns the directory names to skip during the workspace scan. Any directory whose name exactly matches an entry in this list is skipped entirely (along with all its descendants). -
setExcludeDirectories
Sets the directory names to skip during the workspace scan. Falls back toDEFAULT_EXCLUDE_DIRECTORIESwhennullis supplied.Use case: Bound to
"xml.workspaceIndex.excludeDirectories". A project with a heavygenerated-sourcesdirectory can add it here so the initial scan does not spend time indexing machine-generated XML. -
getHeadLimits
Returns the raw (unparsed) head-limits map. Keys are file extensions without dot or"*"; values are size strings. -
setHeadLimits
Sets the raw head-limits map.Use case: Bound to
"xml.workspaceIndex.headLimits". The raw map is passed toHeadLimitRules.compile(Map)which compiles the glob patterns once for efficient per-file lookup. -
parseSizeLimit
Parses a human-readable size string into a character count (not byte count — the index reads Javacharunits).Supported formats (case-insensitive):
null,"","0"→Integer.MAX_VALUE(no limit)"512"→ 512 chars (raw integer)"512KB"or"512Ko"→ 524 288"1MB"or"1Mo"→ 1 048 576"1GB"or"1Go"→ 1 073 741 824
Integer.MAX_VALUE(no limit).- Parameters:
value- raw size string from the settings JSON.- Returns:
- parsed character limit, or
Integer.MAX_VALUEfor no limit.
-
merge
Copies all settings fromnewSettingsinto this instance.Use case: Called when the client sends
didChangeConfigurationand the existing settings object needs to be updated in place (e.g. inside a cachedXMLGeneralClientSettingsthat other components hold a reference to).
-