Add type checking features and UI - #62
Conversation
|
Thanks for a valuable contribution. A few suggestions before we move any further:
Also, we should probably consider deduplicating reports from Ruff, mpy-cross and Pyright |
|
Thanks for the initial review, I agree with most of the points above. A few follow ups
VsCode uses Problems, that or Diagnostics seems best.
Agree, do you have an example how to trigger such a message?
I'll need to look into that. In the stubs playground client I remember I needed to do extra work on the merging and sorting of the rather poor suggestions from code mirrors python and the ones from pylance.
That was the intent, to avoid unexpected synchronisation from the device.
The goal is to allow installation of stubs of libraries such as emlearn-micropython from PyPi once @jonnor has published it. |
|
"Problems" is fine
print(0x1.to_bytes(1))Using "Advanced Mode" and improving the suggestion for stubs selection is welcome! |
49baaf7 to
95402f2
Compare
|
@vshymanskyy and all others that may stumble on this. All things that I set out to do work, but there also some things that want to look into a bit further. (scope creep ?) For anyone wanting to try: Any feedback is appreceated. |
85816c3 to
4421af6
Compare
Add a restricted jsDelivr HTTPS-module Rollup loader with relative remote-import resolution and validation for URLs, redirects, responses, and JavaScript content types. Bundle the tagged LSP client, consume the corrected diagnostics client, and pin the Pyright worker assets to the immutable v0.2.3 release. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the type-checking service boundary, worker asset loading, debounced diagnostics, device-aware stub selection, and serialized reconfiguration. Support MicroPython VM stubs and PyPI stub package discovery, installation, persistence, and cache controls. Document the integration API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add persistent Basic, Standard, and Strict modes; automatic or manual board stubs; configurable workspace scope; and organized localized settings. Expose type-check status and disable controls, and add a diagnostics panel that distinguishes live editor diagnostics from unopened workspace files. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bind Python editors to LSP compartments, synchronize and hydrate cached workspace files, and mirror device Python files when All scope is enabled. Use device platform and build metadata for stub selection, preserve manual overrides, guard device reads when type checking is disabled, and expand workflow coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Removed the duplicate sizeOf method
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Includes support for translations. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
…al tabs Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
@mp-codemirror/lsp-client @mp-codemirror/pyright-worker Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
The reusable client defaults typeshedPath to /typeshed-fallback, which is CPython's typeshed, and ViperIDE never overrode it. MicroPython-specific stdlib signatures were therefore reported as errors -- for example json.dump(obj, fp, separators) is valid on MicroPython but rejected by CPython's keyword-only signature -- and hover showed CPython documentation. Pin typeshedPath to /typeshed-micropython so micropython-stdlib-stubs are used, and take pyright-worker 0.4.0, which starts about 2.5x faster and ships a 5.4 MB bundle instead of 8.7 MB.
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
- Updated typechecking_assets.js to support board stub package configuration. - Enhanced typechecking_service.js to allow filtering of stub packages and added a new method for querying the stub package catalog. - Modified typechecking_settings.js to build runtime configuration from published catalog packages. - Added new localization keys for typecheck stub family, version, port, board, selected package, and not applicable. - Improved unit tests to cover new stub package features and ensure correct behavior of typechecking settings. - Updated diagnostics panel tests to reflect changes in typechecking mode and stub selection. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
…ages Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Avoids a version mismatch between the loader and a service worker's cached MicroPython N-1 WASM binary. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
…nce build scripts Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c38c9917-3bfc-4b82-9321-90b3e57c84df
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c38c9917-3bfc-4b82-9321-90b3e57c84df
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Startup resolved the stub package after Pyright reached ready and then restarted the runtime, so completions and edits made in that window were lost. Queued type-checking work now keeps the status busy until it drains. Also declare the Python browser-test environment (pyproject test group, uv.lock, test:browser script) and make two tests depend on explicit configuration instead of a stale version literal and a transient state.
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
4421af6 to
941776e
Compare
|
|
||
| /** localStorage key for last-known-good runtime metadata. */ | ||
| const DEFAULT_RUNTIME_STORAGE_KEY = 'viperide-pyright-runtime-lkg' | ||
|
|
There was a problem hiding this comment.
does this fallback to localhost not intruduce a risk ?
Why is it needed in the first place ?
- Updated .gitignore to include Viper tools stubs output. - Added Viper tools stubs wheel to assets. - Enhanced Development.md to document Viper tools stubs lifecycle. - Modified eslint.config.mjs to include Viper tools stubs metadata. - Updated rollup.config.mjs to copy Viper tools stubs during build. - Added UI checkbox for including Viper tools stubs in ViperIDE.html. - Updated app.js to manage Viper tools stubs setting. - Translated new UI strings for Viper tools stubs in multiple languages. - Enhanced typechecking_assets.js to handle Viper tools stubs metadata. - Updated browser tests to verify Viper tools stubs functionality. - Added unit tests for Viper tools stubs integration in typechecking_assets.js. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Allows connection to versions/varionst that do not support `"".hex()` Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
…pe checking resources Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
- Add a reusable input dialog to handle user input for WebREPL connection and file creation. - Update bridge.html to include the new dialog and refactored connection logic to utilize it. - Modify control_client.js to streamline connection handling and remove direct prompt usage. - Enhance viper_lib.js to export the new requestUserValue function for dialog interactions. - Update tests to verify dialog functionality for WebREPL connections and file creation. - Add new tests for package installation dialog interactions. Fixes: vshymanskyy#63 Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>

Introduce a new type-checking service with
Adds dependencies and add a new Rollup loader.
Include tests for type-checking eligibility and expand localization for type-checking settings.
Currently I publish the components from github via immutable tags via the JSDeliver CDN
But intend to move to npm or similar - open to suggestions.
There is likely more fit and finish to do, I have tested against VMs and hardware, and have done my best to extend the test cases.
I have some documentation for the backend services that I want to push to RTD , for now it is in https://github.com/Josverl/stubs_playground/tree/integrate/docs
Closes: #4