mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-08 11:20:37 +00:00
feat: Add capability logging to LSP server initialization
This commit is contained in:
parent
fa5fe5c9ae
commit
0d59e8eaa7
1 changed files with 38 additions and 29 deletions
|
@ -69,36 +69,45 @@ impl LanguageServer for DjangoLanguageServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(InitializeResult {
|
let capabilities = ServerCapabilities {
|
||||||
capabilities: ServerCapabilities {
|
text_document_sync: Some(TextDocumentSyncCapability::Options(
|
||||||
text_document_sync: Some(TextDocumentSyncCapability::Options(
|
TextDocumentSyncOptions {
|
||||||
TextDocumentSyncOptions {
|
open_close: Some(true),
|
||||||
open_close: Some(true),
|
change: Some(TextDocumentSyncKind::INCREMENTAL),
|
||||||
change: Some(TextDocumentSyncKind::INCREMENTAL),
|
will_save: Some(false),
|
||||||
will_save: Some(false),
|
will_save_wait_until: Some(false),
|
||||||
will_save_wait_until: Some(false),
|
save: Some(SaveOptions::default().into()),
|
||||||
save: Some(SaveOptions::default().into()),
|
},
|
||||||
},
|
)),
|
||||||
)),
|
completion_provider: Some(CompletionOptions {
|
||||||
completion_provider: Some(CompletionOptions {
|
resolve_provider: Some(false),
|
||||||
resolve_provider: Some(false),
|
trigger_characters: Some(vec![
|
||||||
trigger_characters: Some(vec![
|
"{".to_string(),
|
||||||
"{".to_string(),
|
"%".to_string(),
|
||||||
"%".to_string(),
|
" ".to_string(),
|
||||||
" ".to_string(),
|
]),
|
||||||
]),
|
|
||||||
..Default::default()
|
|
||||||
}),
|
|
||||||
diagnostic_provider: Some(DiagnosticServerCapabilities::Options(DiagnosticOptions {
|
|
||||||
identifier: Some("django".to_string()),
|
|
||||||
inter_file_dependencies: false,
|
|
||||||
workspace_diagnostics: false,
|
|
||||||
work_done_progress_options: WorkDoneProgressOptions {
|
|
||||||
work_done_progress: Some(true),
|
|
||||||
},
|
|
||||||
})),
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
}),
|
||||||
|
diagnostic_provider: Some(DiagnosticServerCapabilities::Options(DiagnosticOptions {
|
||||||
|
identifier: Some("django".to_string()),
|
||||||
|
inter_file_dependencies: false,
|
||||||
|
workspace_diagnostics: false,
|
||||||
|
work_done_progress_options: WorkDoneProgressOptions {
|
||||||
|
work_done_progress: Some(true),
|
||||||
|
},
|
||||||
|
})),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
self.log_message(
|
||||||
|
MessageType::INFO,
|
||||||
|
&format!("Advertising capabilities: {:?}", capabilities),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.ok();
|
||||||
|
|
||||||
|
Ok(InitializeResult {
|
||||||
|
capabilities,
|
||||||
server_info: Some(ServerInfo {
|
server_info: Some(ServerInfo {
|
||||||
name: SERVER_NAME.to_string(),
|
name: SERVER_NAME.to_string(),
|
||||||
version: Some(SERVER_VERSION.to_string()),
|
version: Some(SERVER_VERSION.to_string()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue