Skip to content

Commit 3cec835

Browse files
committed
feat: Add a --version cli paramter to check for version
1 parent bb41aab commit 3cec835

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "protols"
33
description = "Language server for proto3 files"
4-
version = "0.8.0"
4+
version = "0.8.5"
55
edition = "2021"
66
license = "MIT"
77
homepage = "https://github.com/coder3101/protols"

src/lsp.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ use async_lsp::lsp_types::{
1515
GotoDefinitionResponse, Hover, HoverContents, HoverParams, HoverProviderCapability,
1616
InitializeParams, InitializeResult, Location, OneOf, PrepareRenameResponse, ProgressParams,
1717
ReferenceParams, RenameFilesParams, RenameOptions, RenameParams, ServerCapabilities,
18-
ServerInfo, TextDocumentPositionParams, TextDocumentSyncCapability,
19-
TextDocumentSyncKind, TextEdit, Url, WorkspaceEdit,
20-
WorkspaceFileOperationsServerCapabilities, WorkspaceFoldersServerCapabilities,
21-
WorkspaceServerCapabilities,
18+
ServerInfo, TextDocumentPositionParams, TextDocumentSyncCapability, TextDocumentSyncKind,
19+
TextEdit, Url, WorkspaceEdit, WorkspaceFileOperationsServerCapabilities,
20+
WorkspaceFoldersServerCapabilities, WorkspaceServerCapabilities,
2221
};
2322
use async_lsp::{LanguageClient, LanguageServer, ResponseError};
2423
use futures::future::BoxFuture;

src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,23 @@ use server::{ProtoLanguageServer, TickEvent};
99
use tower::ServiceBuilder;
1010
use tracing::Level;
1111

12+
mod formatter;
1213
mod lsp;
1314
mod nodekind;
1415
mod parser;
1516
mod server;
1617
mod state;
1718
mod utils;
1819
mod workspace;
19-
mod formatter;
2020

2121
#[tokio::main(flavor = "current_thread")]
2222
async fn main() {
23+
let args: Vec<String> = std::env::args().collect();
24+
if args.len() == 2 && args[1] == "--version" {
25+
println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
26+
return;
27+
}
28+
2329
let (server, _) = async_lsp::MainLoop::new_server(|client| {
2430
tokio::spawn({
2531
let client = client.clone();

src/workspace/hover.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::{
66
formatter::ProtoFormatter, state::ProtoLanguageState, utils::split_identifier_package,
77
};
88

9-
109
static BUITIN_DOCS: LazyLock<HashMap<&'static str, &'static str>> = LazyLock::new(|| {
1110
HashMap::from([
1211
(

0 commit comments

Comments
 (0)