implements PLN-0023
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package p.lsp.v1;
|
||||
|
||||
import p.lsp.PrometeuLspProjectContext;
|
||||
import p.lsp.PrometeuLspService;
|
||||
import p.lsp.PrometeuLspServiceFactory;
|
||||
import p.lsp.v1.internal.PrometeuLspV1Service;
|
||||
import p.studio.vfs.ProjectDocumentVfs;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public final class PrometeuLspV1ServiceFactory implements PrometeuLspServiceFactory {
|
||||
@Override
|
||||
public PrometeuLspService open(
|
||||
final PrometeuLspProjectContext projectContext,
|
||||
final ProjectDocumentVfs projectDocumentVfs) {
|
||||
return new PrometeuLspV1Service(
|
||||
Objects.requireNonNull(projectContext, "projectContext"),
|
||||
Objects.requireNonNull(projectDocumentVfs, "projectDocumentVfs"));
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package p.lsp.v1.internal;
|
||||
|
||||
import p.lsp.PrometeuLspProjectContext;
|
||||
import p.lsp.PrometeuLspService;
|
||||
import p.lsp.dtos.PrometeuLspSessionStateDTO;
|
||||
import p.studio.vfs.ProjectDocumentVfs;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public final class PrometeuLspV1Service implements PrometeuLspService {
|
||||
private final PrometeuLspProjectContext projectContext;
|
||||
private final ProjectDocumentVfs projectDocumentVfs;
|
||||
|
||||
public PrometeuLspV1Service(
|
||||
final PrometeuLspProjectContext projectContext,
|
||||
final ProjectDocumentVfs projectDocumentVfs) {
|
||||
this.projectContext = Objects.requireNonNull(projectContext, "projectContext");
|
||||
this.projectDocumentVfs = Objects.requireNonNull(projectDocumentVfs, "projectDocumentVfs");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrometeuLspProjectContext projectContext() {
|
||||
return projectContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectDocumentVfs projectDocumentVfs() {
|
||||
return projectDocumentVfs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrometeuLspSessionStateDTO snapshot() {
|
||||
return new PrometeuLspSessionStateDTO(
|
||||
true,
|
||||
List.of("diagnostics", "symbols", "definition", "highlight"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user