Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the LSP server log some version info on startup #393

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/lsp/cobol_lsp/lsp_request.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ let try_with_main_document_data ~f =

(** {3 Initialization} *)

let log_initialization_info () =
Lsp_io.log_info "Initializing SuperBOL LSP Server";
match Version.commit_hash, Version.commit_date with
| None, _ | _, None ->
Lsp_io.log_info "Version: %s" Version.version
| Some h, Some d ->
Lsp_io.log_info "Commit: %s (%s)" h d;
Lsp_io.log_info "Version tag: %s" Version.version

let initialize ~config (params: InitializeParams.t) =
let root_uri = match params.rootUri with
| None -> None
Expand All @@ -54,8 +63,9 @@ let initialize ~config (params: InitializeParams.t) =
| Some Some (_ :: _ as l) -> List.map (fun x -> x.WorkspaceFolder.uri) l
| _ -> Option.to_list root_uri
in
Lsp_io.log_info "Initializing@ for@ workspace@ folders:@ %a"
Pretty.(list ~fopen:"@[" ~fclose:"@]" string)
log_initialization_info ();
Lsp_io.log_info "Initial workspace folders: %a"
Pretty.(list ~fopen:"" ~fclose:"" string)
(List.map (fun x -> DocumentUri.to_path x) workspace_folders);
let capabilities = Lsp_capabilities.reply params.capabilities in
let with_semantic_tokens =
Expand Down
Loading