{"record":{"id":"02708e63b987cf43","repo":"oraios/serena","slug":"explicitly-requested-symbols-in-within-relative","errorCode":null,"errorMessage":"Explicitly requested symbols in '{within_relative_path}' while the path is ignored","messagePattern":"Explicitly requested symbols in '(.+?)' while the path is ignored","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/ls.py","lineNumber":2188,"sourceCode":"                                if path.is_absolute():\n                                    try:\n                                        path = path.relative_to(self.repository_root_path)\n                                        node[\"location\"][\"relativePath\"] = str(path)\n                                    except Exception:\n                                        pass\n                            if \"children\" in node:\n                                fix_relative_path(node[\"children\"])\n\n                    fix_relative_path(file_root_nodes)\n\n            return result\n\n        if within_relative_path:\n            within_abs_path = os.path.join(self.repository_root_path, within_relative_path)\n            if not os.path.exists(within_abs_path):\n                raise FileNotFoundError(f\"File or directory not found: {within_abs_path}\")\n            if self.is_ignored_path(within_relative_path):\n                raise ValueError(f\"Explicitly requested symbols in '{within_relative_path}' while the path is ignored\")\n            if os.path.isfile(within_abs_path):\n                root_nodes = self.request_document_symbols(within_relative_path).root_symbols\n                return root_nodes\n            else:\n                self.PathWorkspaceStatus.from_abs_resolved_path(Path(within_abs_path).resolve(), self).check_within_workspace_or_raise()\n                return process_directory(within_abs_path)\n        else:\n            full_result = []\n            for root in self.config.get_absolute_workspace_folders(self.repository_root_path):\n                full_result.extend(process_directory(root))\n            return full_result\n\n    @staticmethod\n    def _get_range_from_file_content(file_content: str) -> ls_types.Range:\n        \"\"\"\n        Get the range for the given file.\n        \"\"\"\n        lines = file_content.split(\"\\n\")","sourceCodeStart":2170,"sourceCodeEnd":2206,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/ls.py#L2170-L2206","documentation":"ValueError raised when a caller explicitly passes within_relative_path to a symbols-request API but that path is matched by the server's ignore rules (gitignore/ignore-path filtering). The library refuses to return ignored content on explicit requests rather than silently honoring or ignoring the request.","triggerScenarios":"Calling request_directory_symbols/overview with a path inside .gitignore'd directories (node_modules, build, .venv, dist) or matched by custom ignore patterns configured on the server.","commonSituations":"Asking for symbols in node_modules or a generated build directory, analyzing vendored/dependency code, or paths ignored by user-custom ignore_config passed at server creation.","solutions":["Request symbols only for non-ignored source files; list non-ignored files instead.","If the path must be analyzed, remove the corresponding entry from .gitignore or adjust the ignore patterns passed to SolidLanguageServer.create.","Use ls.is_ignored_path(rel_path) to check before calling and handle gracefully.","Copy the file to a non-ignored location if you only need one-off analysis."],"exampleFix":"// before\nls.request_directory_symbols(\"node_modules/pkg/index.js\")  # ignored\n// after\nif not ls.is_ignored_path(rel):\n    ls.request_directory_symbols(rel)\nelse:\n    print(f\"skipping ignored path {rel}\")","handlingStrategy":"validation","validationCode":"if ls.is_ignored_path(rel_path):\n    raise ValueError(f\"{rel_path} is ignored; pick a tracked source path\")","typeGuard":"def is_requestable(ls, rel: str) -> bool:\n    return os.path.exists(os.path.join(ls.repository_root_path, rel)) and not ls.is_ignored_path(rel)","tryCatchPattern":"try:\n    syms = ls.request_directory_symbols(rel_path)\nexcept ValueError as e:\n    logging.info(\"ignored path requested: %s\", e)\n    syms = []","preventionTips":["Pre-check is_ignored_path for user-supplied paths","Keep generated/vendor code out of requested paths or un-ignore it deliberately","Review .gitignore and custom ignore config passed to create()","Filter file lists through the ignore rules before batch requests"],"tags":["ignore-rules","gitignore","path","solidlsp"],"backgroundTag":"path-ignored","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}