package moving
This commit is contained in:
+3
-2
@@ -1,5 +1,6 @@
|
||||
package p.studio.lsp.services;
|
||||
|
||||
import p.studio.lsp.api.LspServerLifecycle;
|
||||
import p.studio.lsp.messages.LspProjectContext;
|
||||
import p.studio.lsp.messages.LspServerBootRequest;
|
||||
import p.studio.lsp.messages.LspServerHandle;
|
||||
@@ -11,12 +12,12 @@ import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
public final class LspServerLifecycle implements p.studio.lsp.api.LspServerLifecycle {
|
||||
public final class LspServerLifecycleImpl implements LspServerLifecycle {
|
||||
private final ProjectScopedLspServerHostFactory serverHostFactory;
|
||||
private final CompilerLanguageServiceBridge compilerBridge;
|
||||
private final ConcurrentMap<String, ProjectScopedLspServerHost> activeServers;
|
||||
|
||||
public LspServerLifecycle(
|
||||
public LspServerLifecycleImpl(
|
||||
final ProjectScopedLspServerHostFactory serverHostFactory,
|
||||
final CompilerLanguageServiceBridge compilerBridge) {
|
||||
this.serverHostFactory = Objects.requireNonNull(serverHostFactory, "serverHostFactory");
|
||||
+3
-3
@@ -14,13 +14,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class LspServerLifecycleTest {
|
||||
class LspServerLifecycleImplTest {
|
||||
|
||||
@Test
|
||||
void lifecycleBootsAndShutsDownProjectScopedHost() {
|
||||
final FakeHost host = new FakeHost();
|
||||
final ProjectScopedLspServerHostFactory factory = (request, compilerBridge) -> host;
|
||||
final var lifecycle = new LspServerLifecycle(factory, new CompilerLanguageServiceBridge());
|
||||
final var lifecycle = new LspServerLifecycleImpl(factory, new CompilerLanguageServiceBridge());
|
||||
final var project = new LspProjectContext("demo", "pbs", Path.of("."));
|
||||
|
||||
final var handle = lifecycle.bootServer(LspServerBootRequest.defaults(project));
|
||||
@@ -37,7 +37,7 @@ class LspServerLifecycleTest {
|
||||
@Test
|
||||
void lifecycleRejectsDoubleBootForSameProject() {
|
||||
final ProjectScopedLspServerHostFactory factory = (request, compilerBridge) -> new FakeHost();
|
||||
final var lifecycle = new LspServerLifecycle(factory, new CompilerLanguageServiceBridge());
|
||||
final var lifecycle = new LspServerLifecycleImpl(factory, new CompilerLanguageServiceBridge());
|
||||
final var request = LspServerBootRequest.defaults(new LspProjectContext("demo", "pbs", Path.of(".")));
|
||||
|
||||
lifecycle.bootServer(request);
|
||||
Reference in New Issue
Block a user