Skip to content

Commit 4329b0e

Browse files
fix(api): remove recursive model for now (#534)
1 parent c4ac9f3 commit 4329b0e

4 files changed

Lines changed: 50 additions & 81 deletions

File tree

api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ from runloop_api_client.types.devboxes import (
163163
DiagnosticSeverity,
164164
DiagnosticsResponse,
165165
DiagnosticTag,
166-
DocumentSymbol,
167166
DocumentSymbolResponse,
168167
DocumentUri,
169168
FileContentsResponse,

src/runloop_api_client/types/devboxes/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from .location_param import LocationParam as LocationParam
2727
from .position_param import PositionParam as PositionParam
2828
from .base_diagnostic import BaseDiagnostic as BaseDiagnostic
29-
from .document_symbol import DocumentSymbol as DocumentSymbol
3029
from .log_list_params import LogListParams as LogListParams
3130
from .lsp_file_params import LspFileParams as LspFileParams
3231
from .text_edit_param import TextEditParam as TextEditParam

src/runloop_api_client/types/devboxes/code_segment_info_response.py

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,64 @@
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
78
from .file_uri import FileUri
8-
from ..._compat import PYDANTIC_V2
99
from ..._models import BaseModel
1010
from .base_range import BaseRange
11+
from .symbol_tag import SymbolTag
12+
from .symbol_kind import SymbolKind
1113
from .base_location import BaseLocation
1214
from .base_diagnostic import BaseDiagnostic
1315
from .base_code_action import BaseCodeAction
1416
from .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

1964
class 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

src/runloop_api_client/types/devboxes/document_symbol.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)