Skip to content

Commit 3d6cf5b

Browse files
committed
allow non-expandable objects
1 parent b433026 commit 3d6cf5b

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

extensions/positron-python/python_files/posit/positron/connections.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class ConnectionObjectInfo(TypedDict):
4848
class ConnectionObject(TypedDict):
4949
name: str
5050
kind: str
51+
has_children: bool | None
5152

5253

5354
class ConnectionObjectFields(TypedDict):
@@ -1090,6 +1091,7 @@ def list_objects(self, path: list[ObjectSchema]):
10901091
{
10911092
"name": row["volume_name"],
10921093
"kind": "volume",
1094+
"has_children": False,
10931095
}
10941096
)
10951097
for row in volumes

extensions/positron-python/python_files/posit/positron/connections_comm.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class ObjectSchema(BaseModel):
3131
description="The object type (table, catalog, schema)",
3232
)
3333

34+
has_children: Optional[StrictBool] = Field(
35+
default=None,
36+
description="Indicates if the object has children that can be listed. This property is optional and when omitted, it is assumed that the object may have children unless its kind is 'field'.",
37+
)
38+
3439

3540
class FieldSchema(BaseModel):
3641
"""

positron/comms/connections-backend-openrpc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@
174174
"kind": {
175175
"type": "string",
176176
"description": "The object type (table, catalog, schema)"
177+
},
178+
"has_children": {
179+
"type": "boolean",
180+
"description": "Indicates if the object has children that can be listed. This property is optional and when omitted, it is assumed that the object may have children unless its kind is 'field'."
177181
}
178182
}
179183
},

src/vs/workbench/services/languageRuntime/common/positronConnectionsComm.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ export interface ObjectSchema {
2525
*/
2626
kind: string;
2727

28+
/**
29+
* Indicates if the object has children that can be listed. This property
30+
* is optional and when omitted, it is assumed that the object may have
31+
* children unless its kind is 'field'.
32+
*/
33+
has_children?: boolean;
34+
2835
}
2936

3037
/**

src/vs/workbench/services/positronConnections/browser/positronConnectionsInstance.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class PositronConnectionsInstance extends BaseConnectionsInstance impleme
7878
let icon: string | undefined = await object.getIcon();
7979
if (!icon || icon === '') {
8080
icon = undefined;
81-
} else if (!icon.startsWith("data:image/")) {
81+
} else if (!icon.startsWith('data:image/')) {
8282
// icon paths starting with data:image/ are assumed to be data URI's
8383
// not file paths.
8484
icon = FileAccess.uriToBrowserUri(URI.file(icon)).toString();
@@ -389,6 +389,7 @@ class PositronConnectionItem implements IPositronConnectionItem {
389389
this._name = last_elt.name;
390390
this._kind = last_elt.kind;
391391
this._dtype = last_elt.dtype;
392+
this._has_children = last_elt.has_children;
392393
}
393394

394395
get id() {

0 commit comments

Comments
 (0)