mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 04:16:34 +00:00
SolidLanguageServer.request_full_symbol_tree: Fix ValueError when obtaining relative path
Fixes #627
This commit is contained in:
1 parent
19b9e1cf31
commit
a317017fe7
1 file changed
+14
-1
+14
-1
@@ -1022,7 +1022,20 @@ class SolidLanguageServer(ABC):
|
||||
|
||||
for contained_dir_or_file_name in contained_dir_or_file_names:
|
||||
contained_dir_or_file_abs_path = os.path.join(abs_dir_path, contained_dir_or_file_name)
|
||||
contained_dir_or_file_rel_path = str(Path(contained_dir_or_file_abs_path).resolve().relative_to(self.repository_root_path))
|
||||
|
||||
# obtain relative path
|
||||
try:
|
||||
contained_dir_or_file_rel_path = str(
|
||||
Path(contained_dir_or_file_abs_path).resolve().relative_to(self.repository_root_path)
|
||||
)
|
||||
except ValueError as e:
|
||||
# Typically happens when the path is not under the repository root (e.g., symlink pointing outside)
|
||||
self.logger.log(
|
||||
f"Skipping path {contained_dir_or_file_abs_path}; likely outside of the repository root {self.repository_root_path} [cause: {e}]",
|
||||
logging.WARNING,
|
||||
)
|
||||
continue
|
||||
|
||||
if self.is_ignored_path(contained_dir_or_file_rel_path):
|
||||
self.logger.log(f"Skipping item: {contained_dir_or_file_rel_path}\n(because it should be ignored)", logging.DEBUG)
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user