Skip to content

Commit 3e8eb5a

Browse files
committed
chore: cleanup
1 parent e90533d commit 3e8eb5a

File tree

1 file changed

+12
-37
lines changed

1 file changed

+12
-37
lines changed

crates/pglt_lsp/tests/server.rs

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,12 @@ use tower::{Service, ServiceExt};
2020
use tower_lsp::jsonrpc;
2121
use tower_lsp::jsonrpc::Response;
2222
use tower_lsp::lsp_types as lsp;
23-
use tower_lsp::lsp_types::DidCloseTextDocumentParams;
24-
use tower_lsp::lsp_types::DidOpenTextDocumentParams;
25-
use tower_lsp::lsp_types::InitializeResult;
26-
use tower_lsp::lsp_types::InitializedParams;
27-
use tower_lsp::lsp_types::PublishDiagnosticsParams;
28-
use tower_lsp::lsp_types::TextDocumentContentChangeEvent;
29-
use tower_lsp::lsp_types::TextDocumentIdentifier;
30-
use tower_lsp::lsp_types::TextDocumentItem;
31-
use tower_lsp::lsp_types::VersionedTextDocumentIdentifier;
32-
use tower_lsp::lsp_types::{ClientCapabilities, Url};
33-
use tower_lsp::lsp_types::{DidChangeConfigurationParams, DidChangeTextDocumentParams};
23+
use tower_lsp::lsp_types::{
24+
ClientCapabilities, DidChangeConfigurationParams, DidChangeTextDocumentParams,
25+
DidCloseTextDocumentParams, DidOpenTextDocumentParams, InitializeResult, InitializedParams,
26+
PublishDiagnosticsParams, TextDocumentContentChangeEvent, TextDocumentIdentifier,
27+
TextDocumentItem, Url, VersionedTextDocumentIdentifier,
28+
};
3429
use tower_lsp::LspService;
3530
use tower_lsp::{jsonrpc::Request, lsp_types::InitializeParams};
3631

@@ -181,23 +176,8 @@ impl Server {
181176
"textDocument/didOpen",
182177
DidOpenTextDocumentParams {
183178
text_document: TextDocumentItem {
184-
uri: url!("document.js"),
185-
language_id: String::from("javascript"),
186-
version: 0,
187-
text: text.to_string(),
188-
},
189-
},
190-
)
191-
.await
192-
}
193-
194-
async fn open_untitled_document(&mut self, text: impl Display) -> Result<()> {
195-
self.notify(
196-
"textDocument/didOpen",
197-
DidOpenTextDocumentParams {
198-
text_document: TextDocumentItem {
199-
uri: url!("untitled-1"),
200-
language_id: String::from("javascript"),
179+
uri: url!("document.sql"),
180+
language_id: String::from("sql"),
201181
version: 0,
202182
text: text.to_string(),
203183
},
@@ -207,18 +187,13 @@ impl Server {
207187
}
208188

209189
/// Opens a document with given contents and given name. The name must contain the extension too
210-
async fn open_named_document(
211-
&mut self,
212-
text: impl Display,
213-
document_name: Url,
214-
language: impl Display,
215-
) -> Result<()> {
190+
async fn open_named_document(&mut self, text: impl Display, document_name: Url) -> Result<()> {
216191
self.notify(
217192
"textDocument/didOpen",
218193
DidOpenTextDocumentParams {
219194
text_document: TextDocumentItem {
220195
uri: document_name,
221-
language_id: language.to_string(),
196+
language_id: String::from("sql"),
222197
version: 0,
223198
text: text.to_string(),
224199
},
@@ -247,7 +222,7 @@ impl Server {
247222
"textDocument/didChange",
248223
DidChangeTextDocumentParams {
249224
text_document: VersionedTextDocumentIdentifier {
250-
uri: url!("document.js"),
225+
uri: url!("document.sql"),
251226
version,
252227
},
253228
content_changes,
@@ -261,7 +236,7 @@ impl Server {
261236
"textDocument/didClose",
262237
DidCloseTextDocumentParams {
263238
text_document: TextDocumentIdentifier {
264-
uri: url!("document.js"),
239+
uri: url!("document.sql"),
265240
},
266241
},
267242
)

0 commit comments

Comments
 (0)