From ba6228884d0760120579cbe5171b7f36316f543b Mon Sep 17 00:00:00 2001 From: He1pa <56333845+He1pa@users.noreply.github.com> Date: Tue, 6 Aug 2024 00:08:10 +0800 Subject: [PATCH] chore: enhance lsp version info (#1540) Signed-off-by: he1pa <18012015693@163.com> --- kclvm/tools/src/LSP/Cargo.toml | 2 +- kclvm/tools/src/LSP/src/main_loop.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kclvm/tools/src/LSP/Cargo.toml b/kclvm/tools/src/LSP/Cargo.toml index 1a0cf1bea..9e99501fd 100644 --- a/kclvm/tools/src/LSP/Cargo.toml +++ b/kclvm/tools/src/LSP/Cargo.toml @@ -16,7 +16,7 @@ dashmap = "5.1.0" log = "0.4.14" im-rc = "15.0.0" rustc_lexer = "0.1.0" -clap = "4.3.0" +clap ={ version = "4.3.0", features = ["string"] } maplit = "1.0.2" kclvm-tools = { path = "../../../tools" } diff --git a/kclvm/tools/src/LSP/src/main_loop.rs b/kclvm/tools/src/LSP/src/main_loop.rs index 272e639e2..6d8cba28f 100644 --- a/kclvm/tools/src/LSP/src/main_loop.rs +++ b/kclvm/tools/src/LSP/src/main_loop.rs @@ -1,5 +1,5 @@ use crate::state::LanguageServerState; -use clap::Command; +use clap::{builder::Str, Command}; use lsp_server::Connection; use lsp_types::InitializeParams; @@ -16,7 +16,7 @@ pub(crate) fn main_loop( /// Get the kcl language server CLI application. pub(crate) fn app() -> Command { Command::new("kcl-language-server") - .version(kclvm_version::VERSION) + .version(Str::from(kclvm_version::get_version_info())) .about("KCL language server CLI.") .subcommand(Command::new("version").about("Show the KCL language server version")) }