Skip to content

Add command discovery to Extension Points#102

Open
MUFFANUJ wants to merge 1 commit intojupyterlab:mainfrom
MUFFANUJ:showCommandList
Open

Add command discovery to Extension Points#102
MUFFANUJ wants to merge 1 commit intojupyterlab:mainfrom
MUFFANUJ:showCommandList

Conversation

@MUFFANUJ
Copy link
Member

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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 14, 2026

Binder JupyterLite 👈 Launch a Binder on branch MUFFANUJ/jupyterlab-plugin-playground/showCommandList

@MUFFANUJ MUFFANUJ added the enhancement New feature or request label Mar 14, 2026
@krassowski
Copy link
Member

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.

__internal:context-menu-info could be hidden, we hide all commands starting with __internal in 4.6 alpha shortcuts editor.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CommandCompletionProvider class and helpers in src/command-completion.ts for autocompleting command IDs in execute() calls
  • Updated TokenSidebar to support a dual Tokens/Commands view with filtering and copy actions for both
  • Moved @jupyterlab/completer from 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.

Comment on lines +230 to +231
app.commands.commandChanged.connect(() => {
tokenSidebar.update();
Comment on lines +808 to +824
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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should test how the extension works with Notebook v7 in different views in general

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Autocomplete commands/show list of commands

3 participants