try-catch #3

Merged
elmma merged 2 commits from try-catch into vm-bytecode 2026-06-26 15:14:45 +08:00
3 changed files with 14 additions and 10 deletions
Showing only changes of commit af63957b11 - Show all commits
+2 -8
View File
@@ -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
View File
@@ -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)),
+1 -1
View File
@@ -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"
}
]
},