Skip to content

Commit db98448

Browse files
benStrejonasstrehle
authored andcommitted
update datex-core changes
1 parent 2fe5f02 commit db98448

File tree

3 files changed

+5
-34
lines changed

3 files changed

+5
-34
lines changed

Cargo.lock

Lines changed: 1 addition & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lsp/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl LanguageServer for LanguageServerBackend {
255255
let file_path = uri.to_file_path().unwrap();
256256
let mut workspace = self.compiler_workspace.borrow_mut();
257257
let file = workspace.get_file_mut(&file_path).unwrap();
258-
if let Some(RichAst { ast: Some(ast), .. }) = &mut file.rich_ast {
258+
if let Some(RichAst { ast, .. }) = &mut file.rich_ast {
259259
let mut finder = VariableDeclarationFinder::new(id);
260260
finder.visit_datex_expression(ast);
261261
Ok(finder.variable_declaration_position.map(|position| {

src/lsp/utils.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl LanguageServerBackend {
5757
let mut workspace = self.compiler_workspace.borrow_mut();
5858
let file = workspace.get_file_mut(&file_path).unwrap();
5959
if let Some(rich_ast) = &mut file.rich_ast {
60-
let ast = rich_ast.ast.as_mut().unwrap();
60+
let ast = &mut rich_ast.ast;
6161
let mut collector = TypeHintCollector::default();
6262
collector.visit_datex_expression(ast);
6363
Some(
@@ -238,13 +238,14 @@ impl LanguageServerBackend {
238238
let mut workspace = self.compiler_workspace.borrow_mut();
239239
let file_path = position.text_document.uri.to_file_path().unwrap();
240240
if let Some(rich_ast) = &mut workspace.get_file_mut(&file_path).unwrap().rich_ast {
241-
let ast = rich_ast.ast.as_mut().unwrap();
241+
let ast = &mut rich_ast.ast;
242242
let mut finder = ExpressionFinder::new(byte_offset);
243243
finder.visit_datex_expression(ast);
244244
finder.found_expr.map(|e| DatexExpression {
245245
span: e.1,
246246
data: e.0,
247247
wrapped: None,
248+
ty: None,
248249
})
249250
} else {
250251
None

0 commit comments

Comments
 (0)