Skip to content

Commit 70a264f

Browse files
committed
some renaming
1 parent 8103219 commit 70a264f

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

robotcode/language_server/robotframework/diagnostics/imports_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
final,
2424
)
2525

26-
from ....utils.async_cache import AsyncSimpleCache
26+
from ....utils.async_cache import AsyncSimpleLRUCache
2727
from ....utils.async_tools import Lock, async_tasking_event, create_sub_task
2828
from ....utils.logging import LoggingDescriptor
2929
from ....utils.path import path_is_relative_to
@@ -472,9 +472,9 @@ def __init__(self, parent_protocol: RobotLanguageServerProtocol, folder: Uri, co
472472
self._python_path: Optional[List[str]] = None
473473
self._environment: Optional[Mapping[str, str]] = None
474474

475-
self._library_files_cache = AsyncSimpleCache()
476-
self._resource_files_cache = AsyncSimpleCache()
477-
self._variables_files_cache = AsyncSimpleCache()
475+
self._library_files_cache = AsyncSimpleLRUCache()
476+
self._resource_files_cache = AsyncSimpleLRUCache()
477+
self._variables_files_cache = AsyncSimpleLRUCache()
478478

479479
@property
480480
def environment(self) -> Mapping[str, str]:

robotcode/language_server/robotframework/parts/references.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
cast,
1919
)
2020

21-
from ....utils.async_cache import AsyncSimpleCache
21+
from ....utils.async_cache import AsyncSimpleLRUCache
2222
from ....utils.async_itertools import async_next
2323
from ....utils.async_tools import create_sub_task, run_coroutine_in_thread, threaded
2424
from ....utils.glob_path import iter_files
@@ -72,7 +72,7 @@ def __init__(self, parent: RobotLanguageServerProtocol) -> None:
7272

7373
parent.references.collect.add(self.collect)
7474

75-
self._keyword_reference_cache = AsyncSimpleCache(max_items=128)
75+
self._keyword_reference_cache = AsyncSimpleLRUCache(max_items=128)
7676

7777
def _find_method(self, cls: Type[Any]) -> Optional[_ReferencesMethod]:
7878
if cls is ast.AST:

robotcode/utils/async_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self) -> None:
1919
self.lock: Lock = Lock()
2020

2121

22-
class AsyncSimpleCache:
22+
class AsyncSimpleLRUCache:
2323
def __init__(self, max_items: int = 128) -> None:
2424
self.max_items = max_items
2525

robotcode/utils/async_tools.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,6 @@ async def __inner_lock(self) -> AsyncGenerator[Any, None]:
585585
yield None
586586
finally:
587587
self._lock.release()
588-
# with self._lock:
589-
# yield None
590-
# yield None
591588

592589
async def acquire(self) -> bool:
593590
async with self.__inner_lock():

0 commit comments

Comments
 (0)