Intrepid/Prometeu/Studio/pipeline/pr-master Build started...
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 64.01% (20482/31999)
* Branch Coverage: 54.22% (8240/15196)
* Lines of Code: 31999
* Cyclomatic Complexity: 13164
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 15, passed: 715
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
36 lines
1.2 KiB
Java
36 lines
1.2 KiB
Java
package p.studio.app.lsp;
|
|
|
|
import p.studio.api.project.ProjectReference;
|
|
import p.studio.core.session.LspLifecyclePort;
|
|
import p.studio.lsp.api.LspServerLifecycle;
|
|
import p.studio.lsp.messages.LspProjectContext;
|
|
import p.studio.lsp.messages.LspServerConfiguration;
|
|
|
|
import java.util.Objects;
|
|
|
|
public final class LspLifecycleAdapter implements LspLifecyclePort {
|
|
private final LspServerLifecycle lifecycle;
|
|
|
|
public LspLifecycleAdapter(LspServerLifecycle lifecycle) {
|
|
this.lifecycle = Objects.requireNonNull(lifecycle, "lifecycle");
|
|
}
|
|
|
|
@Override
|
|
public void boot(ProjectReference project) {
|
|
lifecycle.bootServer(LspServerConfiguration.defaults(), context(project));
|
|
}
|
|
|
|
@Override
|
|
public void shutdown(ProjectReference project) {
|
|
lifecycle.shutdownServer(context(project));
|
|
}
|
|
|
|
private static LspProjectContext context(ProjectReference project) {
|
|
final var safeProject = Objects.requireNonNull(project, "project");
|
|
return new LspProjectContext(
|
|
safeProject.rootPath().toAbsolutePath().normalize().toString(),
|
|
safeProject.languageId(),
|
|
safeProject.rootPath());
|
|
}
|
|
}
|