Skip to content

Commit 815f3ba

Browse files
mmahroussfda-odoo
authored andcommitted
[FIX] server: fix deleting path of opened files
1 parent ee471ab commit 815f3ba

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

server/src/core/file_mgr.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,7 @@ impl FileMgr {
343343
}
344344

345345
pub fn get_file_info(&self, path: &String) -> Option<Rc<RefCell<FileInfo>>> {
346-
match self.files.get(path) {
347-
Some(rc) => Some(rc.clone()),
348-
None => None
349-
}
346+
self.files.get(path).cloned()
350347
}
351348

352349
pub fn text_range_to_range(&self, session: &mut SessionInfo, path: &String, range: &TextRange) -> Range {

server/src/core/import_resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn resolve_import_stmt(session: &mut SessionInfo, source_file_symbol: &Rc<Re
7070
let mut start_symbol = None;
7171
if level.is_some() && level.unwrap() != 0 {
7272
//if level is some, resolve_packages already built a full tree, so we can start from root
73-
start_symbol = Some(source_file_symbol.borrow().get_root().as_ref().unwrap().upgrade().unwrap().clone());
73+
start_symbol = Some(source_root.clone());
7474
}
7575
let (from_symbol, fallback_sym) = _get_or_create_symbol(
7676
session,

server/src/core/python_arch_eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl PythonArchEval {
118118
}
119119
let mut symbol = self.sym_stack[0].borrow_mut();
120120
symbol.set_build_status(BuildSteps::ARCH_EVAL, BuildStatus::DONE);
121-
if symbol.is_external() {
121+
if symbol.is_external() && (!self.file_mode || !file_info_rc.borrow().opened) {
122122
for sym in symbol.all_symbols() {
123123
if sym.borrow().has_ast_indexes() {
124124
sym.borrow_mut().ast_indexes_mut().clear(); //TODO isn't it make it invalid? should set to None?

0 commit comments

Comments
 (0)