Component
pygls/workspace/workspace.py
Summary
remove_folder calls pop(..., None) and then immediately attempts del on the same key, which is entirely redundant. Both operations are attempted and two unquote calls are made for the same value.
Expected Behavior
A single removal operation.
Actual Behavior
Two removals and two unquote calls.
Affected Code (pygls/workspace/workspace.py, ~L211-216)
def remove_folder(self, folder_uri: str):
self._folders.pop(unquote(folder_uri), None)
try:
del self._folders[unquote(folder_uri)]
except KeyError:
pass
Proposed Fix
Delete the del block; keep only the pop.
Component
pygls/workspace/workspace.py
Summary
remove_foldercallspop(..., None)and then immediately attemptsdelon the same key, which is entirely redundant. Both operations are attempted and twounquotecalls are made for the same value.Expected Behavior
A single removal operation.
Actual Behavior
Two removals and two
unquotecalls.Affected Code (
pygls/workspace/workspace.py, ~L211-216)Proposed Fix
Delete the
delblock; keep only thepop.