Add command discovery to Extension Points#102
Add command discovery to Extension Points#102MUFFANUJ wants to merge 1 commit intojupyterlab:mainfrom
Conversation
|
The broad outline looks good at a first glance, though I haven't tested the completer yet. A nice addition, but harder and not for this PR, would be also completing the argument attributes. For now we can think how to expose the available arguments in UI.
|
There was a problem hiding this comment.
Pull request overview
This PR adds command discovery to the Plugin Playground extension, renaming the "Service Tokens" sidebar section to "Extension Points" with a Tokens/Commands toggle, and introducing a completion provider that suggests command IDs inside commands.execute() calls in JS/TS editors.
Changes:
- New
CommandCompletionProviderclass and helpers insrc/command-completion.tsfor autocompleting command IDs inexecute()calls - Updated
TokenSidebarto support a dual Tokens/Commands view with filtering and copy actions for both - Moved
@jupyterlab/completerfrom devDependencies to dependencies and wired up the provider registration
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/command-completion.ts |
New file: completion provider, command record helpers, regex-based query extraction |
src/token-sidebar.tsx |
Adds Tokens/Commands toggle, command list rendering, generalized copy logic |
src/index.ts |
Registers completion provider, refreshes extension points on plugin load, listens to commandChanged |
package.json |
Moves @jupyterlab/completer from devDependencies to dependencies |
style/base.css |
Styles for the view toggle buttons |
ui-tests/tests/plugin-playground.spec.ts |
Two new E2E tests for command tab and command completer |
README.md |
Documents the new features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| app.commands.commandChanged.connect(() => { | ||
| tokenSidebar.update(); |
| requires: [ | ||
| ISettingRegistry, | ||
| ICommandPalette, | ||
| IEditorTracker, | ||
| ICompletionProviderManager | ||
| ], | ||
| optional: [ILauncher, IDocumentManager], | ||
| activate: ( | ||
| app: JupyterFrontEnd, | ||
| settingRegistry: ISettingRegistry, | ||
| commandPalette: ICommandPalette, | ||
| editorTracker: IEditorTracker, | ||
| completionManager: ICompletionProviderManager, | ||
| launcher: ILauncher | null, | ||
| documentManager: IDocumentManager | null | ||
| ) => { | ||
| completionManager.registerProvider(new CommandCompletionProvider(app)); |
There was a problem hiding this comment.
I guess we should test how the extension works with Notebook v7 in different views in general
closes #94
Renames the sidebar section from Service Tokens to Extension Points and adds a Tokens / Commands view so available command IDs can be browsed and copied from the UI.
Also adds command ID autocomplete inside commands.execute(...) and app.commands.execute(...) in JavaScript and TypeScript editors, with focused UI coverage for the new sidebar tab and completer behavior.