mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: Add TypeTrackingNode
Splits `ModuleVariableNode` away from `LocalSourceNode`, instead creating a class `TypeTrackingNode` that encapsulates both of these. This means we no longer have module variable nodes as part of `LocalSourceNode` (which is good, since they have no "local" aspect to them), and hence we can have `LocalSourceNode` inherit directly from `ExprNode` (which makes the API a bit nicer). Unfortunately these are breaking changes, so we can't actually fulfil the above two desiderata until the `track` and `backtrack` methods on `LocalSourceNode` have been fully deprecated. For this reason, we preserve the present implementation of `LocalSourceNode`, and instead lay the foundation for switching over in the future, by deprecating `track` and `backtrack` on `LocalSourceNode`.
This commit is contained in:
2
python/.vscode/ql.code-snippets
vendored
2
python/.vscode/ql.code-snippets
vendored
@@ -106,7 +106,7 @@
|
||||
"prefix": "type tracking",
|
||||
"body": [
|
||||
"/** Gets a reference to ${3:a thing}. */",
|
||||
"private DataFlow::LocalSourceNode ${1:myType}(DataFlow::TypeTracker t) {",
|
||||
"private DataFlow::TypeTrackingNode ${1:myType}(DataFlow::TypeTracker t) {",
|
||||
" t.start() and",
|
||||
" result = ${2:value}",
|
||||
" or",
|
||||
|
||||
Reference in New Issue
Block a user