You know I did get typing working in vscode before but I don’t recall how - I need to look into that.
The python sources for the saleae analyzers module can be found here: "C:\Program Files\Logic\resources\windows\pythonlibs\lib\site-packages\saleae\analyzers"
If I have time I’ll see if I can get something working again in vscode to get intelliSense working.
Hey @timreyes, are you aware if there’s update on providing stubs? I am currently developing my HLA using the Python files from the installation directory, but it’s far from perfect. No need for a library, just stubs would be nice for proper code editor support.
Thanks for the follow up! I just took a crack at this with claude code, and it seems to work very well. Eventually I want to get the creation of this more formalized, and integrated into the application, templates, and documentation, but in the short term, anyone can use these typings to improve their experience authoring Saleae HLAs.
This just supports HLAs for the moment, but please let me know if you would like typings for measurements too.
I’ve tested and reviewed these typings and I’m pretty pleased with them. There is room for improvement (for example, the AnalyzerFrame data dict value type would be nice to constrain) but for most stuff I think this will be a lot smoother than checking the docs or other examples.
Please let me know if you have any trouble with this!
If you’ve never used typings (pyi) files before, there are two main ways to load them into an IDE like visual studio code.
Automatic loading. VSCode with the standard python extension installed will automatically look for typings in a top-level typings directory. You just need to extract this zip and locate it with nesting such that this file exists: .\typings\saleae\analyzers\__init__.pyi. Restarting VS code after this is a quick, reliable way to make sure this gets picked up.
Put the typings anywhere, and set the .vscode/settings.json key "python.analysis.stubPath" to the directory that holds the “saleae” folder from the zip file above.