try-catch #3
@@ -41,14 +41,8 @@ pub fn handle_goto_definition(
|
||||
let location = Location {
|
||||
uri: uri.clone(),
|
||||
range: Range {
|
||||
start: Position {
|
||||
line: l,
|
||||
character: c,
|
||||
},
|
||||
end: Position {
|
||||
line: l,
|
||||
character: c + word.len() as u32,
|
||||
},
|
||||
start: Position { line: l, character: c },
|
||||
end: Position { line: l, character: c + word.len() as u32 },
|
||||
},
|
||||
};
|
||||
let response: GotoDefinitionResponse = GotoDefinitionResponse::Scalar(location);
|
||||
|
||||
+11
-1
@@ -28,7 +28,17 @@ pub fn run() {
|
||||
text_document_sync: Some(TextDocumentSyncCapability::Kind(
|
||||
TextDocumentSyncKind::FULL,
|
||||
)),
|
||||
completion_provider: Some(lsp_types::CompletionOptions::default()),
|
||||
completion_provider: Some(lsp_types::CompletionOptions {
|
||||
trigger_characters: Some(
|
||||
(b'a'..=b'z').chain(b'A'..=b'Z')
|
||||
.map(|c| (c as char).to_string())
|
||||
.chain(std::iter::once(".".to_string()))
|
||||
.chain(std::iter::once("_".to_string()))
|
||||
.collect()
|
||||
),
|
||||
resolve_provider: Some(false),
|
||||
..Default::default()
|
||||
}),
|
||||
hover_provider: Some(lsp_types::HoverProviderCapability::Simple(true)),
|
||||
signature_help_provider: Some(lsp_types::SignatureHelpOptions::default()),
|
||||
definition_provider: Some(lsp_types::OneOf::Left(true)),
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "keyword.control.aster",
|
||||
"match": "\\b(let|const|fn|if|else|while|for|in|break|continue|return)\\b"
|
||||
"match": "\\b(let|const|fn|if|else|while|for|in|break|continue|return|try|catch|finally|throw)\\b"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user