diff --git a/modules/lsp/src/main/scala/playground/lsp/LanguageServer.scala b/modules/lsp/src/main/scala/playground/lsp/LanguageServer.scala index f6b4a010..5109ba22 100644 --- a/modules/lsp/src/main/scala/playground/lsp/LanguageServer.scala +++ b/modules/lsp/src/main/scala/playground/lsp/LanguageServer.scala @@ -32,6 +32,7 @@ import playground.language.CommandResultReporter import playground.language.CompletionProvider import playground.language.DiagnosticProvider import playground.language.DocumentSymbolProvider +import playground.language.Feedback import playground.language.FormattingProvider import playground.language.TextDocumentProvider import playground.language.Uri @@ -173,13 +174,15 @@ object LanguageServer { .toList .map(_.toUri) - LanguageClient[F] - .showInfoMessage(s"Hello from Smithy Playground v${BuildInfo.version}") *> + Feedback[F] + .showInfoMessage( + s"Hello from Smithy Playground v${BuildInfo.version}! Loading project..." + ) *> ServerLoader[F] .prepare(wsf.some) .flatMap { prepped => ServerLoader[F].perform(prepped.params).flatTap { stats => - LanguageClient[F] + Feedback[F] .showInfoMessage( s"Loaded Smithy Playground server with ${stats.render}" ) @@ -307,11 +310,11 @@ object LanguageServer { .prepare(workspaceFolders = None) .flatMap { case prepared if !prepared.isChanged => - LanguageClient[F].showInfoMessage( + Feedback[F].showInfoMessage( LanguageClient.NoChangeDetected ) case prepared => - LanguageClient[F].showInfoMessage("Detected changes, will try to rebuild server...") *> + Feedback[F].showInfoMessage("Detected changes, will try to rebuild server...") *> ServerLoader[F] .perform(prepared.params) .onError { case e => @@ -322,7 +325,7 @@ object LanguageServer { .flatMap { stats => LanguageClient[F].refreshDiagnostics *> LanguageClient[F].refreshCodeLenses *> - LanguageClient[F].showInfoMessage( + Feedback[F].showInfoMessage( s"Reloaded Smithy Playground server with ${stats.render}" ) } diff --git a/modules/lsp/src/main/scala/playground/lsp/ServerLoader.scala b/modules/lsp/src/main/scala/playground/lsp/ServerLoader.scala index fbd8e316..53d51eef 100644 --- a/modules/lsp/src/main/scala/playground/lsp/ServerLoader.scala +++ b/modules/lsp/src/main/scala/playground/lsp/ServerLoader.scala @@ -41,13 +41,13 @@ object ServerLoader { ) { def render: String = - s"$sourceCount sources, $importCount imports, $dependencyCount dependencies and $pluginCount plugins" + s"$sourceCount source entries, $importCount imports, $dependencyCount dependencies and $pluginCount plugins" } object WorkspaceStats { - def fromBuildConfig( + def fromPlaygroundConfig( bc: PlaygroundConfig ): WorkspaceStats = WorkspaceStats( sourceCount = bc.sources.size, @@ -109,7 +109,7 @@ object ServerLoader { .build(params, this) .map(server => State(server, Some(params))) .flatMap(stateRef.set) - .as(WorkspaceStats.fromBuildConfig(params.config)) + .as(WorkspaceStats.fromPlaygroundConfig(params.config)) val server: LanguageServer[F] = LanguageServer.defer(stateRef.get.map(_.currentServer)) } diff --git a/modules/lsp/src/test/scala/playground/lsp/harness/LanguageServerIntegrationTests.scala b/modules/lsp/src/test/scala/playground/lsp/harness/LanguageServerIntegrationTests.scala index 231ce510..3a92d570 100644 --- a/modules/lsp/src/test/scala/playground/lsp/harness/LanguageServerIntegrationTests.scala +++ b/modules/lsp/src/test/scala/playground/lsp/harness/LanguageServerIntegrationTests.scala @@ -71,17 +71,17 @@ trait LanguageServerIntegrationTests { TestClient .MessageLog( MessageType.Info, - s"Hello from Smithy Playground v${BuildInfo.version}", + s"Hello from Smithy Playground v${BuildInfo.version}! Loading project...", ), TestClient.MessageLog( MessageType.Info, - "Loaded Smithy Playground server with 2 sources, 0 imports, 2 dependencies and 0 plugins", + "Loaded Smithy Playground server with 2 source entries, 0 imports, 2 dependencies and 0 plugins", ), ) IO { require( - events.size == 2, - "Events emitted at startup should've had size 2, it was " + events.size + " instead", + events.size == initLogs.size, + s"Events emitted at startup should've had size ${initLogs.size}, it was " + events.size + " instead", ) require( events == initLogs,