use of org.ballerinalang.langserver.workspace.repository.NullSourceDirectory in project ballerina by ballerina-lang.
the class CommonUtil method prepareTempCompilerContext.
/**
* Prepare a new compiler context.
* @return {@link CompilerContext} Prepared compiler context
*/
public static CompilerContext prepareTempCompilerContext() {
CompilerContext context = new CompilerContext();
CompilerOptions options = CompilerOptions.getInstance(context);
options.put(PROJECT_DIR, "");
options.put(COMPILER_PHASE, CompilerPhase.DESUGAR.toString());
options.put(PRESERVE_WHITESPACE, "false");
context.put(SourceDirectory.class, new NullSourceDirectory());
return context;
}
Aggregations