Class FileAssociationVariableSupport

java.lang.Object
org.eclipse.lemminx.extensions.contentmodel.settings.FileAssociationVariableSupport

public class FileAssociationVariableSupport extends Object
Resolves VS Code-style predefined variables in file association patterns and systemIds.

Supported variables:

  • ${workspaceFolder} — workspace folder containing the document
  • ${workspaceFolderBasename} — basename of the workspace folder
  • ${file} — full path of the document
  • ${fileWorkspaceFolder} — workspace folder of the document (same as workspaceFolder)
  • ${relativeFile} — document path relative to workspace folder
  • ${relativeFileDirname} — dirname of relativeFile
  • ${fileBasename} — basename of the document
  • ${fileBasenameNoExtension} — basename without extension
  • ${fileExtname} — extension of the document (with dot)
  • ${fileDirname} — directory of the document
  • ${env:Name} — environment variable
  • Method Details

    • resolve

      public static String resolve(String value, URI documentUri, List<String> workspaceFolderUris)
      Resolves all supported variables in the given value using the document URI and workspace folder URIs.
      Parameters:
      value - the string containing variable references.
      documentUri - the URI of the document being matched.
      workspaceFolderUris - the list of workspace folder URIs.
      Returns:
      the string with all resolvable variables substituted.