11# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
3- from __future__ import annotations
3+ from typing import TYPE_CHECKING , List , Optional
44
5- from typing import List , Optional
5+ from pydantic import Field as FieldInfo
66
7+ from .range import Range
78from .file_uri import FileUri
8- from ..._compat import PYDANTIC_V2
99from ..._models import BaseModel
1010from .base_range import BaseRange
11+ from .symbol_tag import SymbolTag
12+ from .symbol_kind import SymbolKind
1113from .base_location import BaseLocation
1214from .base_diagnostic import BaseDiagnostic
1315from .base_code_action import BaseCodeAction
1416from .signature_help_response import SignatureHelpResponse
1517
16- __all__ = ["CodeSegmentInfoResponse" , "Hover" ]
18+ __all__ = ["CodeSegmentInfoResponse" , "Symbol" , "Hover" ]
19+
20+
21+ class Symbol (BaseModel ):
22+ kind : SymbolKind
23+ """The kind of this symbol."""
24+
25+ name : str
26+ """The name of this symbol.
27+
28+ Will be displayed in the user interface and therefore must not be an empty
29+ string or a string only consisting of white spaces.
30+ """
31+
32+ range : Range
33+ """
34+ The range enclosing this symbol not including leading/trailing whitespace but
35+ everything else like comments. This information is typically used to determine
36+ if the clients cursor is inside the symbol to reveal in the symbol in the UI.
37+ """
38+
39+ selection_range : Range = FieldInfo (alias = "selectionRange" )
40+ """
41+ The range that should be selected and revealed when this symbol is being picked,
42+ e.g the name of a function. Must be contained by the `range`.
43+ """
44+
45+ children : Optional [List [object ]] = None
46+ """Children of this symbol, e.g. properties of a class."""
47+
48+ deprecated : Optional [bool ] = None
49+ """Indicates if this symbol is deprecated."""
50+
51+ detail : Optional [str ] = None
52+ """More detail for this symbol, e.g the signature of a function."""
53+
54+ tags : Optional [List [SymbolTag ]] = None
55+ """Tags for this document symbol."""
56+
57+ if TYPE_CHECKING :
58+ # Stub to indicate that arbitrary properties are accepted.
59+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
60+ # `getattr(obj, '$type')`
61+ def __getattr__ (self , attr : str ) -> object : ...
1762
1863
1964class Hover (BaseModel ):
@@ -29,7 +74,7 @@ class CodeSegmentInfoResponse(BaseModel):
2974
3075 references : List [BaseLocation ]
3176
32- symbol : "DocumentSymbol"
77+ symbol : Symbol
3378 """
3479 Represents programming constructs like variables, classes, interfaces etc. that
3580 appear in a document. Document symbols can be hierarchical and they have two
@@ -42,13 +87,3 @@ class CodeSegmentInfoResponse(BaseModel):
4287 hover : Optional [Hover ] = None
4388
4489 signature : Optional [SignatureHelpResponse ] = None
45-
46-
47- from .document_symbol import DocumentSymbol
48-
49- if PYDANTIC_V2 :
50- CodeSegmentInfoResponse .model_rebuild ()
51- Hover .model_rebuild ()
52- else :
53- CodeSegmentInfoResponse .update_forward_refs () # type: ignore
54- Hover .update_forward_refs () # type: ignore
0 commit comments