From f80d7da1e64dd71536260a55ec0226397a63540e Mon Sep 17 00:00:00 2001 From: Dominik Nakamura Date: Fri, 15 Dec 2023 16:34:45 +0900 Subject: [PATCH] refactor(lsp): group handler related modules together Move all the modules that are specific to the handler into their own module to thin out the root module. --- crates/stef-lsp/src/{ => handlers}/compile.rs | 0 crates/stef-lsp/src/{ => handlers}/document_symbols.rs | 0 crates/stef-lsp/src/{handlers.rs => handlers/mod.rs} | 6 +++++- crates/stef-lsp/src/{ => handlers}/semantic_tokens.rs | 0 crates/stef-lsp/src/main.rs | 3 --- 5 files changed, 5 insertions(+), 4 deletions(-) rename crates/stef-lsp/src/{ => handlers}/compile.rs (100%) rename crates/stef-lsp/src/{ => handlers}/document_symbols.rs (100%) rename crates/stef-lsp/src/{handlers.rs => handlers/mod.rs} (98%) rename crates/stef-lsp/src/{ => handlers}/semantic_tokens.rs (100%) diff --git a/crates/stef-lsp/src/compile.rs b/crates/stef-lsp/src/handlers/compile.rs similarity index 100% rename from crates/stef-lsp/src/compile.rs rename to crates/stef-lsp/src/handlers/compile.rs diff --git a/crates/stef-lsp/src/document_symbols.rs b/crates/stef-lsp/src/handlers/document_symbols.rs similarity index 100% rename from crates/stef-lsp/src/document_symbols.rs rename to crates/stef-lsp/src/handlers/document_symbols.rs diff --git a/crates/stef-lsp/src/handlers.rs b/crates/stef-lsp/src/handlers/mod.rs similarity index 98% rename from crates/stef-lsp/src/handlers.rs rename to crates/stef-lsp/src/handlers/mod.rs index e70b80d..509dc9b 100644 --- a/crates/stef-lsp/src/handlers.rs +++ b/crates/stef-lsp/src/handlers/mod.rs @@ -14,7 +14,11 @@ use lsp_types::{ }; use ropey::Rope; -use crate::{compile, document_symbols, semantic_tokens, state::FileBuilder, GlobalState}; +use crate::{state::FileBuilder, GlobalState}; + +mod compile; +mod document_symbols; +mod semantic_tokens; pub fn initialize( _state: &mut GlobalState<'_>, diff --git a/crates/stef-lsp/src/semantic_tokens.rs b/crates/stef-lsp/src/handlers/semantic_tokens.rs similarity index 100% rename from crates/stef-lsp/src/semantic_tokens.rs rename to crates/stef-lsp/src/handlers/semantic_tokens.rs diff --git a/crates/stef-lsp/src/main.rs b/crates/stef-lsp/src/main.rs index a96f9bc..bcac12b 100644 --- a/crates/stef-lsp/src/main.rs +++ b/crates/stef-lsp/src/main.rs @@ -20,12 +20,9 @@ use crate::state::GlobalState; mod cli; mod client; -mod compile; mod config; -mod document_symbols; mod handlers; mod logging; -mod semantic_tokens; mod state; fn main() -> Result<()> {