Skip to content

Commit ccbb78c

Browse files
committed
[IMP] server: no diagnostic for base class not evaluated
1 parent 21316e6 commit ccbb78c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

server/src/core/python_arch_eval.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,17 @@ impl PythonArchEval {
436436
let symbol = eval_base.upgrade().unwrap();
437437
if symbol.borrow().typ() != SymType::COMPILED {
438438
if symbol.borrow().typ() != SymType::CLASS {
439-
self.diagnostics.push(Diagnostic::new(
440-
Range::new(Position::new(base.start().to_u32(), 0), Position::new(base.end().to_u32(), 0)),
441-
Some(DiagnosticSeverity::WARNING),
442-
Some(NumberOrString::String(S!("OLS20003"))),
443-
Some(EXTENSION_NAME.to_string()),
444-
format!("Base class {} is not a class", AstUtils::flatten_expr(base)),
445-
None,
446-
None,
447-
));
439+
if symbol.borrow().typ() != SymType::VARIABLE { //we followed_ref already, so if it's still a variable, it means we can't evaluate it. Skip diagnostic
440+
self.diagnostics.push(Diagnostic::new(
441+
Range::new(Position::new(base.start().to_u32(), 0), Position::new(base.end().to_u32(), 0)),
442+
Some(DiagnosticSeverity::WARNING),
443+
Some(NumberOrString::String(S!("OLS20003"))),
444+
Some(EXTENSION_NAME.to_string()),
445+
format!("Base class {} is not a class", AstUtils::flatten_expr(base)),
446+
None,
447+
None,
448+
));
449+
}
448450
} else {
449451
let file_symbol = symbol.borrow().get_file().unwrap().upgrade().unwrap();
450452
if !Rc::ptr_eq(&self.file, &file_symbol) {

0 commit comments

Comments
 (0)