Class Workspace

java.lang.Object
org.ek9lang.compiler.Workspace

public class Workspace extends Object
Designed to represent one or more source files that are part of a workspace. Needs to become thread safe, especially around parsing. This is because when a user is typing via lsp mode - this will get triggered over and over.
  • Constructor Details

    • Workspace

      public Workspace()
    • Workspace

      public Workspace(String sourceFileBaseDirectory)
  • Method Details

    • addSource

      public void addSource(File file)
    • addSource

      public void addSource(Path path)
    • addSource

      public void addSource(String fileName)
    • addLibrarySource

      public void addLibrarySource(File file, String packageModuleName)
      Add a source of a resolved package dependency: compiled with the project, but a library source - never a dev source, and outside the project's coverage and profiling metadata (its own tests covered it when it was packaged).
      Parameters:
      file - the dependency's source file (in the library, outside this workspace's directory)
      packageModuleName - the module name of the dependency's package
    • addSource

      public void addSource(CompilableSource source)
    • isSourcePresent

      public boolean isSourcePresent(String fileName)
    • getSource

      public CompilableSource getSource(Path path)
    • getSource

      public CompilableSource getSource(String fileName)
    • removeSource

      public Optional<ErrorListener> removeSource(Path path)
      Remove some source code from the work space. Maybe a file has been deleted or renamed.
    • removeSource

      public Optional<ErrorListener> removeSource(String fileName)
    • getSources

      public Collection<CompilableSource> getSources()
    • getSourceFileBaseDirectory

      public String getSourceFileBaseDirectory()