Skip to content

Commit

Permalink
lsp: Show message when lsp starting (#2233)
Browse files Browse the repository at this point in the history
  • Loading branch information
fox0430 authored Feb 4, 2025
1 parent 5dc4754 commit 3ff5490
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _#2233: https://github.com/fox0430/moe/pull/2233

Added
.....

- `#2233`_ lsp: Show message when lsp starting

7 changes: 5 additions & 2 deletions src/moepkg/editorstatus.nim
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ proc initLspExperimentalParams*(
proc lspInitialize*(
status: var EditorStatus,
workspaceRoot, langId: string): Result[(), string] =
## Initialize LSP client and server.
## Start LSP server and initialize LSP client and server.

if not status.lspClients.contains(langId):
# Init a LSP client and start a LSP server.
Expand Down Expand Up @@ -455,14 +455,17 @@ proc addNewBuffer*(
status.settings.lsp.languages[newBufStatus.langId].command,
err.error)
else:
# Start LSP initialization.
# Start LSP server and initialization.
let err = status.lspInitialize(
$newBufStatus.openDir,
newBufStatus.langId)
if err.isErr:
status.commandLine.writeLspInitializeError(
status.settings.lsp.languages[newBufStatus.langId].command,
err.error)
else:
status.commandLine.writeLspServerStart(
status.settings.lsp.languages[newBufStatus.langId].command)

return Result[int, string].ok status.bufStatus.high

Expand Down
5 changes: 5 additions & 0 deletions src/moepkg/messages.nim
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ proc writeInRecordingOperations*(
commandLine.writeMessageOnCommandLine(mess)
addMessageLog mess

proc writeLspServerStart*(commandLine: var CommandLine, command: Runes) =
let mess = fmt"LSP server starting: {$command}"
commandLine.writeMessageOnCommandLine(mess)
addMessageLog mess

proc writeLspInitialized*(commandLine: var CommandLine, command: Runes) =
let mess = fmt"LSP client initialized: {$command}"
commandLine.writeMessageOnCommandLine(mess)
Expand Down

0 comments on commit 3ff5490

Please sign in to comment.