Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / class

Symbol

codeintel.parsers.base.Symbol

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Called by (4)
SymbolFileResolved by
line_chunks__init__.pythrough an import
_enterpython_parser.pythrough an import
parse_pythonpython_parser.pythrough an import
parse_treesittertreesitter_parser.pythrough an import
Contains (2)
SymbolFileResolved by
add_callbase.pysame file
add_identifierbase.pysame file
Inside (1)
SymbolFileResolved by
basebase.pysame file
codeintel.parsers.base.Symbolbackend/app/codeintel/parsers/base.py, lines 14–46Open source
@dataclassclass Symbol:    """A retrievable unit of code: a module, class, function, method, ...    Line numbers are 1-based and inclusive.    """    name: str    qualified_name: str    kind: str  # module | class | function | method | interface | struct | enum | trait | impl | type    start_line: int    end_line: int    signature: str    docstring: str = ""    # Simple names of called functions / constructed types, in first-seen order.    calls: list[str] = field(default_factory=list)    # Identifiers referenced in the body (bounded; feeds keyword search).    identifiers: list[str] = field(default_factory=list)    # Qualified name of the enclosing class / impl / module symbol.    parent: str | None = None    def add_call(self, name: str) -> None:        if name and name not in self.calls and len(self.calls) < MAX_CALLS:            self.calls.append(name)    def add_identifier(self, name: str) -> None:        if (            name            and len(name) > 1            and name not in self.identifiers            and len(self.identifiers) < MAX_IDENTIFIERS        ):            self.identifiers.append(name)

What the index recorded

Signature
class Symbol:
File
backend/app/codeintel/parsers/base.py
Lines
14–46
Parser
python-ast
Git blob
3ebc48248b33125ad21597173a82926893a501dc
Call sites
1 named, 0 resolved, 1 left unlinked

Read it on GitHub at this commit