public class LSCompiler extends Object
Constructor and Description |
---|
LSCompiler(WorkspaceDocumentManager documentManager)
Returns a new LS Compiler instance with this document manager.
|
Modifier and Type | Method and Description |
---|---|
static BallerinaFile |
compileContent(String content,
CompilerPhase phase)
Returns a BallerinaFile compiling in-memory content.
|
BallerinaFile |
compileFile(Path filePath,
CompilerPhase phase)
Compile file.
|
BLangPackage |
getBLangPackage(LSContext context,
WorkspaceDocumentManager docManager,
boolean preserveWS,
Class errStrategy,
boolean compileFullProject)
Get the BLangPackage for a given program.
|
List<BLangPackage> |
getBLangPackages(LSContext context,
WorkspaceDocumentManager docManager,
boolean preserveWS,
Class errStrategy,
boolean compileFullProject)
Get the BLangPackage for a given program.
|
BallerinaFile |
updateAndCompileFile(Path filePath,
String content,
CompilerPhase phase,
WorkspaceDocumentManager documentManager)
Updates content and compile file.
|
public LSCompiler(WorkspaceDocumentManager documentManager)
documentManager
- document managerpublic static BallerinaFile compileContent(String content, CompilerPhase phase) throws LSCompilerException
content
- content to be compiledphase
- CompilerPhase
for the compilerBallerinaFile
containing the compiled packageLSCompilerException
- when compiler error occurredpublic BallerinaFile compileFile(Path filePath, CompilerPhase phase)
filePath
- file Path
of the filephase
- CompilerPhase
for the compilerBallerinaFile
containing compiled packagepublic BallerinaFile updateAndCompileFile(Path filePath, String content, CompilerPhase phase, WorkspaceDocumentManager documentManager) throws LSCompilerException
content
- content need to be updatedfilePath
- file Path
of the filephase
- CompilerPhase
for the compilerdocumentManager
- document managerBallerinaFile
containing compiled packageLSCompilerException
- when compiler error occurredpublic BLangPackage getBLangPackage(LSContext context, WorkspaceDocumentManager docManager, boolean preserveWS, Class errStrategy, boolean compileFullProject) throws LSCompilerException
context
- Language Server ContextdocManager
- Document managerpreserveWS
- Enable preserve whitespaceerrStrategy
- custom error strategy classcompileFullProject
- updateAndCompileFile full project from the source rootList
A list of packages when compile full projectLSCompilerException
- when compilation failspublic List<BLangPackage> getBLangPackages(LSContext context, WorkspaceDocumentManager docManager, boolean preserveWS, Class errStrategy, boolean compileFullProject)
context
- Language Server ContextdocManager
- Document managerpreserveWS
- Enable preserve whitespaceerrStrategy
- custom error strategy classcompileFullProject
- updateAndCompileFile full project from the source rootList
A list of packages when compile full projectCopyright © 2019 WSO2. All rights reserved.