refactor: use dotted LSP command names
This commit is contained in:
+3
-3
@@ -160,7 +160,7 @@ impl EditorSession {
|
||||
fn dispatch(&mut self, invocation: Invocation) {
|
||||
if invocation.plugin == "core" {
|
||||
let result = match invocation.command.as_str() {
|
||||
"lsp_definition" | "lsp_hover" => {
|
||||
"lsp.definition" | "lsp.hover" => {
|
||||
if let Some(id) = self.lsp_request_id.checked_add(1) {
|
||||
self.lsp_request_id = id;
|
||||
let context = self.editor.context();
|
||||
@@ -170,7 +170,7 @@ impl EditorSession {
|
||||
};
|
||||
self.requests.entry("core".into()).or_default().latest = Some((id, source));
|
||||
self.lsp_source_cursor = Some(self.editor.cursor());
|
||||
self.pending_hover = invocation.command == "lsp_hover";
|
||||
self.pending_hover = invocation.command == "lsp.hover";
|
||||
if self.pending_hover {
|
||||
self.lsp.hover(&context, id)
|
||||
} else {
|
||||
@@ -180,7 +180,7 @@ impl EditorSession {
|
||||
Err("LSP request IDs exhausted".into())
|
||||
}
|
||||
}
|
||||
"lsp_diagnostics" => self.lsp.diagnostics(self.editor.buffer_id()),
|
||||
"lsp.diagnostics" => self.lsp.diagnostics(self.editor.buffer_id()),
|
||||
_ => unreachable!("session-dispatched core command"),
|
||||
};
|
||||
if let Err(error) = result {
|
||||
|
||||
Reference in New Issue
Block a user