Skip to content

Commit 4606c4f

Browse files
d-biehlpetrieh
andcommitted
fix(imports): corrected caching of already loaded resources
fixes #461 Co-authored-by: Petri Huovinen <[email protected]>
1 parent 999b839 commit 4606c4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/robot/src/robotcode/robot/diagnostics/imports_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,11 +1527,11 @@ def _get_entry_for_resource_import(
15271527
variables: Optional[Dict[str, Any]] = None,
15281528
) -> _ResourcesEntry:
15291529
source = self.find_resource(name, base_dir, variables=variables)
1530+
source_path = normalized_path(Path(source))
15301531

15311532
def _get_document() -> TextDocument:
1532-
self._logger.debug(lambda: f"Load resource {name} from source {source}", context_name="import")
1533+
self._logger.debug(lambda: f"Load resource {name} from source {source_path}", context_name="import")
15331534

1534-
source_path = normalized_path(Path(source))
15351535
extension = source_path.suffix
15361536
if extension.lower() not in RESOURCE_EXTENSIONS:
15371537
raise ImportError(
@@ -1541,7 +1541,7 @@ def _get_document() -> TextDocument:
15411541

15421542
return self.documents_manager.get_or_open_document(source_path)
15431543

1544-
entry_key = _ResourcesEntryKey(source)
1544+
entry_key = _ResourcesEntryKey(str(source_path))
15451545

15461546
with self._resources_lock:
15471547
if entry_key not in self._resources:

0 commit comments

Comments
 (0)