-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add datasources to the extension ui #147
Conversation
yield node, decorator.id | ||
yield {"node": node, "kind": decorator.id} | ||
|
||
elif isinstance(node, ast_module.Assign): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be easier if you did something as:
for _stack, node in _iter_nodes(ast, recursive=False):
if isinstance(node, ast_module.Call) and isinstance(call_node.func, ast_module.Name) and call_node.func.id == "DataSourceSpec":
... # i.e.: Any call to `DataSourceSpec` would be gotten.
The issue in the current code is that it'll match something as x = Annotated[DataSource, DataSourceSpec(...)]
, but then not x = typing.Annotated[...]
because it's an Attribute, not a Name.
@@ -230,30 +230,49 @@ export class RobotsTreeDataProvider implements vscode.TreeDataProvider<RobotEntr | |||
} | |||
); | |||
if (result.success) { | |||
let actions: IActionInfo[] = result.result; | |||
let actionsAndDatasources: IActionInfo[] = result.result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the method askForActionPackageAndAction
in actionPackage.ts
also calls roboCommands.SEMA4AI_LIST_ACTIONS_INTERNAL
, but it doesn't care about datasources (so, with this PR it'll do the wrong thing)... Maybe we should leave SEMA4AI_LIST_ACTIONS_INTERNAL
as is and create a SEMA4AI_LIST_ACTIONS_AND_DATASOURCES_INTERNAL
.... or alternatively add a bool saying collect_datasources=true|false
(default being false not to break compatibility in the other use case).
"end": { | ||
"line": node.lineno, | ||
"character": node.col_offset + coldelta + len(node.name), | ||
"line": node.end_lineno or func_node.lineno, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really get this one: since we just want the name coordinates, why isn't it directly func_node.end_lineno
/ func_node.end_col_offset
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is because of linting. It seems that node.end_lineno is int | None
while we always expect a number. In our case it will probably never be None, or will be if there is a mistake (e.g: function not closed) so then we default to the start line.
Stable release checklist:
python -m dev set-version {version}
/docs/changelog.md
with the changes for the releasePre-release checklist:
/docs/changelog.md
with the new changes.