-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: fix the cli args for startup of lsp (#740)
* bugfix: fix the cli args for normal startup of lsp to be consistent with client of vscode Signed-off-by: He1pa <[email protected]> * test: add invalid subcommand unit test Signed-off-by: He1pa <[email protected]> * chore: fmt code Signed-off-by: He1pa <[email protected]> --------- Signed-off-by: He1pa <[email protected]>
- Loading branch information
Showing
5 changed files
with
93 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
mod analysis; | ||
mod capabilities; | ||
mod completion; | ||
mod config; | ||
mod db; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
use crate::config::Config; | ||
use crate::state::LanguageServerState; | ||
use clap::Command; | ||
use lsp_server::Connection; | ||
|
||
#[allow(dead_code)] | ||
/// Runs the main loop of the language server. This will receive requests and handle them. | ||
pub(crate) fn main_loop(connection: Connection, config: Config) -> anyhow::Result<()> { | ||
LanguageServerState::new(connection.sender, config).run(connection.receiver) | ||
} | ||
|
||
#[allow(dead_code)] | ||
/// Get the kcl language server CLI application. | ||
pub(crate) fn app() -> Command { | ||
Command::new("kcl-language-server") | ||
.version(kclvm_version::VERSION) | ||
.about("KCL language server CLI.") | ||
.subcommand(Command::new("version").about("Show the KCL language server version")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters