public class JavaLanguageServerExtensionService extends Object
| Constructor and Description |
|---|
JavaLanguageServerExtensionService(org.eclipse.che.api.languageserver.FindServer registry,
org.eclipse.che.api.languageserver.LanguageServerInitializer languageServerInitializer,
org.eclipse.che.api.core.jsonrpc.commons.RequestHandlerConfigurator requestHandler,
org.eclipse.che.api.project.server.ProjectManager projectManager,
org.eclipse.che.api.core.notification.EventService eventService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addJars(String projectPath,
String library)
Adds all jars from the folder into the classpath.
|
void |
configureMethods() |
void |
createSimpleProject(String projectName,
String sourceFolder)
Compute output directory of the project.
|
List<DtoServerImpls.TestPositionDto> |
detectTest(String fileUri,
String testAnnotation,
int cursorOffset)
Detects test method by cursor position.
|
DtoServerImpls.ImplementersResponseDto |
findImplementers(org.eclipse.lsp4j.TextDocumentPositionParams params) |
org.eclipse.che.api.debug.shared.model.Location |
findResourcesByFqn(String fqn,
int lineNumber) |
List<String> |
findTestsByCursorPosition(String fileUri,
String methodAnnotation,
String classAnnotation,
int offset)
Finds test by cursor position.
|
List<String> |
findTestsFromFolder(String folderUri,
String methodAnnotation,
String classAnnotation)
Finds tests in the folder.
|
List<String> |
findTestsFromProject(String projectUri,
String methodAnnotation,
String classAnnotation)
Finds tests in the project.
|
List<String> |
findTestsFromSet(String methodAnnotation,
String classAnnotation,
List<String> entry)
Finds fqns of test classes.
|
List<String> |
findTestsInFile(String fileUri,
String methodAnnotation,
String classAnnotation)
Finds tests in the class.
|
String |
getEffectivePom(String projectPath)
Retrieves effective pom for specified project.
|
org.eclipse.che.jdt.ls.extension.api.dto.JavaCoreOptions |
getJavaCoreOptions(List<String> filter)
Returns JDT LS java core options.
|
List<String> |
getMavenProjects(String rootPath,
int timeout,
TimeUnit unit)
Returns all nested projects starting from the given path.
|
String |
getOutputDir(String projectPath)
Compute output directory of the project.
|
List<String> |
getResolvedClasspath(String projectUri)
Compute resolved classpath of the project.
|
List<String> |
getSourceFolders(String projectPath)
Gets source folders of plain java project.
|
String |
identifyFqnInResource(String filePath,
int lineNumber) |
org.eclipse.che.jdt.ls.extension.api.dto.OrganizeImportsResult |
organizeImports(org.eclipse.che.jdt.ls.extension.api.dto.OrganizeImportParams organizeImports)
Organizes imports in a file or in a directory.
|
List<String> |
reImportMavenProjects(org.eclipse.che.jdt.ls.extension.api.dto.ReImportMavenProjectsCommandParameters parameters)
Updates given maven projects.
|
CompletableFuture<Object> |
updateClasspathWithResult(String projectUri,
List<org.eclipse.che.jdt.ls.extension.api.dto.ClasspathEntry> entries)
Updates classpath of plain java project.
|
Boolean |
updateJavaCoreOptions(org.eclipse.che.jdt.ls.extension.api.dto.JavaCoreOptions javaCoreOptions)
Updates JDT LS java core options.
|
org.eclipse.che.jdt.ls.extension.api.dto.JobResult |
updateWorkspace(org.eclipse.che.jdt.ls.extension.api.dto.UpdateWorkspaceParameters updateWorkspaceParameters)
Update jdt.ls workspace accordingly to added or removed projects.
|
@Inject
public JavaLanguageServerExtensionService(org.eclipse.che.api.languageserver.FindServer registry,
org.eclipse.che.api.languageserver.LanguageServerInitializer languageServerInitializer,
org.eclipse.che.api.core.jsonrpc.commons.RequestHandlerConfigurator requestHandler,
org.eclipse.che.api.project.server.ProjectManager projectManager,
org.eclipse.che.api.core.notification.EventService eventService)
@PostConstruct public void configureMethods()
public String getOutputDir(String projectPath)
projectPath - project pathpublic void addJars(String projectPath, String library)
projectPath - project's pathlibrary - path to the folder with librariespublic void createSimpleProject(String projectName, String sourceFolder)
projectName - project URIsourceFolder - name of source folderpublic List<DtoServerImpls.TestPositionDto> detectTest(String fileUri, String testAnnotation, int cursorOffset)
fileUri - file URItestAnnotation - test method annotationcursorOffset - cursor positionTestPositionpublic List<String> getResolvedClasspath(String projectUri)
projectUri - project URIpublic CompletableFuture<Object> updateClasspathWithResult(String projectUri, List<org.eclipse.che.jdt.ls.extension.api.dto.ClasspathEntry> entries)
projectUri - project URIentries - classpath entriespublic List<String> getSourceFolders(String projectPath)
projectPath - project pathpublic List<String> findTestsInFile(String fileUri, String methodAnnotation, String classAnnotation)
fileUri - file URImethodAnnotation - test method annotationclassAnnotation - test class runner annotationpublic List<String> findTestsFromProject(String projectUri, String methodAnnotation, String classAnnotation)
projectUri - project folder URImethodAnnotation - test method annotationclassAnnotation - test class runner annotationpublic List<String> findTestsFromFolder(String folderUri, String methodAnnotation, String classAnnotation)
folderUri - folder URImethodAnnotation - test method annotationclassAnnotation - test class runner annotationpublic List<String> findTestsByCursorPosition(String fileUri, String methodAnnotation, String classAnnotation, int offset)
fileUri - URI of active filemethodAnnotation - test method annotationclassAnnotation - test class runner annotationoffset - cursor offsetpublic List<String> findTestsFromSet(String methodAnnotation, String classAnnotation, List<String> entry)
methodAnnotation - test method annotationclassAnnotation - test class runner annotationentry - list of URI of test classespublic DtoServerImpls.ImplementersResponseDto findImplementers(org.eclipse.lsp4j.TextDocumentPositionParams params)
public String getEffectivePom(String projectPath)
projectPath - path to project relatively to projects root (e.g. /projects)public List<String> reImportMavenProjects(org.eclipse.che.jdt.ls.extension.api.dto.ReImportMavenProjectsCommandParameters parameters)
parameters - dto with list of paths to projects (relatively to projects root (e.g.
/projects)) which should be re-imported.public org.eclipse.che.api.debug.shared.model.Location findResourcesByFqn(String fqn, int lineNumber)
public org.eclipse.che.jdt.ls.extension.api.dto.JobResult updateWorkspace(org.eclipse.che.jdt.ls.extension.api.dto.UpdateWorkspaceParameters updateWorkspaceParameters)
public org.eclipse.che.jdt.ls.extension.api.dto.OrganizeImportsResult organizeImports(org.eclipse.che.jdt.ls.extension.api.dto.OrganizeImportParams organizeImports)
public org.eclipse.che.jdt.ls.extension.api.dto.JavaCoreOptions getJavaCoreOptions(List<String> filter)
filter - list of the specific options to return.public Boolean updateJavaCoreOptions(org.eclipse.che.jdt.ls.extension.api.dto.JavaCoreOptions javaCoreOptions)
public List<String> getMavenProjects(String rootPath, int timeout, TimeUnit unit) throws com.google.gson.JsonSyntaxException, InterruptedException, ExecutionException, TimeoutException
rootPath - the root project pathTimeoutExceptionExecutionExceptionInterruptedExceptioncom.google.gson.JsonSyntaxExceptionCopyright © 2012–2019 Red Hat, Inc.. All rights reserved.