baldurk
c97850e39b
Allow customisation of VS Code executable
2026-08-13 17:46:44 +01:00
baldurk
ca0ac6157a
Fix some issues with reference counting on python objects
2026-08-13 17:46:44 +01:00
baldurk
459bfb2592
Add a project explorer to the python scripting window
...
* This displays the current UI extension files, some built-in examples, and
recently opened loose files
2026-08-13 17:46:44 +01:00
baldurk
b846705c0b
Handle python scripts via drag-and-drop to the window
2026-08-13 17:46:43 +01:00
baldurk
c95a69c8a1
Returning const arrays forces a copy
...
* This doesn't cover all cases but helps with 'pythonic' cases where a list
returned from a function should be expected to be mutable. Modifying direct
'members' can still modify through const.
2026-08-13 17:46:43 +01:00
baldurk
0bab6e4059
Fix cases where syntax checking timer wouldn't properly be started
...
* We let it run after any change unconditionally rather than stopping/starting
it. Instead if it fires and we ar in the middle of an autocomplete we just
ignore that instance.
2026-08-13 17:46:43 +01:00
baldurk
88782bea97
Use reflection script for autocomplete and help in python shell
...
* Also add syntax checking via parse attempts.
2026-08-13 17:46:43 +01:00
baldurk
2aff86b678
Change python scripting panel to allow multiple editor windows
...
* We also remove the old completion/help functionality as it will be replaced.
2026-08-13 17:46:43 +01:00
baldurk
f5033de8ff
Add some local changes to Scintilla to avoid autocomplete flicker
...
* The code by default will recreate/move/resize the autocomplete box when re-
initialising and there's no way to just update the list without doing so.
2026-08-13 17:46:43 +01:00
baldurk
8a86b754f6
Generate autocomplete tooltips inside python reflector
2026-08-13 17:46:43 +01:00
baldurk
94c4e656d6
Move RDToolTip into separate file independent of tree view
2026-08-13 17:46:43 +01:00
baldurk
f9035e1c42
Assign enum value __doc__ attributes as python interpreter doesn't
2026-08-13 17:46:43 +01:00
baldurk
b9595f3685
Handle forward-referenced string return annotations
2026-08-13 17:46:43 +01:00
baldurk
ed52bc55df
Backport Qt implementation of calltips in Scintilla
...
* Taken from https://sourceforge.net/p/scintilla/code/ci/a82b87a88556f0bc23b7ff6
f4bdfd5241ef44a62/ upstream
2026-08-13 17:46:42 +01:00
baldurk
09c036bd36
Embed and initialise reflection script in python context
2026-08-13 17:46:42 +01:00
baldurk
be3d34fb93
Add support for aliasing modules when processing reflection
...
* This is a little specific to us, but when we see references to a `renderdoc`
module etc we want to be able to look up the generated stubs instead as they
have better type hints for processing.
2026-08-13 17:46:42 +01:00
baldurk
64645aa9d6
Add autocomplete helpers for members and function calls
...
* This requires a small quasi-hack for tracking user defined function calls
while looking up types.
2026-08-13 17:46:42 +01:00
baldurk
e0ca14d55a
Add a helper to figure out which function call and argument we're in
2026-08-13 17:46:42 +01:00
baldurk
575d8ed853
Add a function to figure out the trailing subexpression in an expr
...
* This is what will be used for autocompletion at a cursor point
2026-08-13 17:46:42 +01:00
baldurk
1b5ba59336
Return the correct type for list comprehension targets
2026-08-13 17:46:42 +01:00
baldurk
d7c3371777
Add a helper function that replaces contents of any strings with "xxx"
2026-08-13 17:46:42 +01:00
baldurk
6a2fca967c
Add a helper to get the friendly name for a type
2026-08-13 17:46:42 +01:00
baldurk
6b85e503fe
Add testing for type checking
2026-08-13 17:46:42 +01:00
baldurk
e7845446db
Add a query to pull the type of a given location
2026-08-13 17:46:41 +01:00
baldurk
f090436670
Determine best-effort type information for AST nodes
...
* This is not perfect but does a good enough job for most common cases.
2026-08-13 17:46:41 +01:00
baldurk
e57d9db9c4
Process scope declarations and identifiers in AST tree
...
* We don't generate type information yet, _get_type is stubbed out.
2026-08-13 17:46:41 +01:00
baldurk
b2b46e7e7c
Add structs for tracking identifiers and scopes
2026-08-13 17:46:41 +01:00
baldurk
08369056d3
Add python script for autocompletion parsing
...
* This tries to ast parse source that may contain an error.
* We don't try to fully error recover from unlimited problems, but a single
statement that is being edited can be tolerated by commenting out lines around
it
2026-08-13 17:46:41 +01:00
baldurk
23ca2cf053
Show syntax errors when editing in python script editor
2026-08-13 17:46:41 +01:00
baldurk
a70ee3a2eb
Watch python extensions for changes on disk and update status bar
...
* We show a button to quickly reload changed extensions.
2026-08-13 17:46:41 +01:00
baldurk
22444aa44d
Disable python debugging buttons if it's not supported
2026-08-13 17:46:41 +01:00
baldurk
c0b47ee48c
Don't enable output/debug buttons for unloaded extensions
2026-08-13 17:46:41 +01:00
baldurk
a995ded466
Add quick-helper to view extension output from manager dialog
2026-08-13 17:46:41 +01:00
baldurk
02ead51303
Add a status entry showing loaded python extensions & debugger status
2026-08-13 17:46:40 +01:00
baldurk
3c6dfd23b4
Add a drop-down for the script output panel to switch context
...
* By default we still display all messages, but this allows users to switch to
just seeing the output from one extension if desired.
2026-08-13 17:46:40 +01:00
baldurk
768d8fa615
Add a static context for connecting Qt signals for python extensions
2026-08-13 17:46:40 +01:00
baldurk
b1f0b9d310
Flush output before an exception
...
* We buffer output to avoid spamming huge numbers of signals especially when
single lines can be many write calls. This means if an exception is processed
immediately after a print the output from the print may come after the
extension.
2026-08-13 17:46:40 +01:00
baldurk
229c4c8746
Avoid polluting globals with completion objects
2026-08-13 17:46:40 +01:00
baldurk
836a5da7fa
Re-organise python shell to be dockable and dock REPL at bottom
2026-08-13 17:46:40 +01:00
baldurk
60b989f2b7
Give extensions their own OutputRedirector object to identify them
2026-08-13 17:46:40 +01:00
baldurk
3ff393c91f
Add option to launch/wait for debugger on python contexts
2026-08-13 17:46:40 +01:00
baldurk
3dfd829331
Initialise debugpy on a thread to reduce startup time
2026-08-13 17:46:40 +01:00
baldurk
d71827d6a1
Load debugpy when possible to allow python debugging in-program
2026-08-13 17:46:39 +01:00
baldurk
53e5e718b1
Copy whichever libffi version the python installation needs
2026-08-13 17:46:39 +01:00
baldurk
9fc3c3cdcd
Use sys.settrace instead of PyEval_SetTrace for better compatibility
2026-08-13 17:46:39 +01:00
baldurk
c15a5c2c66
Add os.add_dll_directory cruft to verify-docstrings
2026-08-13 17:46:39 +01:00
baldurk
e5f395497c
Allow custom python folder to contain platform-subfolders
...
* This is not the default python layout but is convenient for sharing the
standard library .zip and include folder with separate binary folders per-
platform. The layout mirrors what we include in the repository.
2026-08-13 17:46:39 +01:00
baldurk
7e11dc9cc5
Allow loading a custom PySide2 with a customised python location
...
* This is expected to be in a pyside\ subfolder, with an organisation matching
our default setup.
* We also now copy the shiboken2 python module (if it exists) as required by new
pyside2 versions.
2026-08-13 17:46:39 +01:00
baldurk
388f914b3a
Add a script for building a pythonXY.zip
...
* This is the only thing missing from an installed version of python to be able
to build against it, so it's convenient to rebuild it instead of fetching it
separately from the embeddable distribution
2026-08-13 17:46:39 +01:00
baldurk
965d788fe5
Add a settings window entry to add extra python stubs paths
2026-08-13 17:46:39 +01:00