Class PathToSourceFileUri

java.lang.Object
org.ek9lang.core.PathToSourceFileUri
All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>

public final class PathToSourceFileUri extends Object implements UnaryOperator<String>
THE encoder, the inverse of SourceFileUriToPath: a filesystem path as the compiler's general source identifier, the file: URI every CompilableSource, ErrorListener and source token carries, and the key under which LSP diagnostics are published. Hold one and use it.

Anything that must match a published identifier (clearing an editor's diagnostics on close, turning an extractor's plain path back into an LSP Location) goes through here. The LSP didClose used to clear diagnostics under the bare path while every publish used this form, so the keys never matched and squiggles outlived the buffer.

  • Constructor Details

    • PathToSourceFileUri

      public PathToSourceFileUri()
  • Method Details

    • apply

      public String apply(String fsPath)
      The file: URI form of fsPath.
      Specified by:
      apply in interface Function<String,String>
      Parameters:
      fsPath - a filesystem path (absolute or relative to the working directory)
      Returns:
      the file: URI form, or null when given null