Skip to main content

atmos_vsc_commands 0.0.1-alpha copy "atmos_vsc_commands: ^0.0.1-alpha" to clipboard
atmos_vsc_commands: ^0.0.1-alpha copied to clipboard

VS Code / Cursor command hub (registry, execute, enablement) and JSONC contribution parsing; keybindings via atmos_vsc_keybindings by Atom735.

atmos_vsc_commands #

VS Code / Cursor command hub + contribution parsing by Atom735.

Русский: README_RU.md.

Install #

dependencies:
  atmos_vsc_commands: ^0.0.1-alpha

Quick start #

import 'package:atmos_vsc_commands/atmos_vsc_commands.dart';

final service = VscCommandService(
  context: {'editorTextFocus': true},
);

service.register('workbench.action.files.save', (inv) {
  // save…
  return null;
});

final engine = service.createEngine(
  defaults: VscKeybindingsLoader.loadBundledPlatform(
    VscKeyPlatform.windows,
    packageRoot: 'packages/atmos_vsc_keybindings',
  ),
);

final match = engine.handleKey(
  const VscKeyStroke(key: 's', control: true),
);
if (match != null) {
  service.executeMatch(match);
}

Contributions #

final contrib = VscCommandsLoader.parseContributions(r'''
{
  "contributes": {
    "commands": [
      { "command": "extension.sayHello", "title": "Say Hello", "category": "Demo" }
    ],
    "keybindings": [
      { "command": "extension.sayHello", "key": "ctrl+f1", "mac": "cmd+f1" }
    ]
  }
}
''');
service.registerContributions(contrib);

Flutter #

Use VscCommandHost so chords / when go through the keybindings engine into executeMatch.

License #

MIT. See LICENSE.

0
likes
150
points
798
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

VS Code / Cursor command hub (registry, execute, enablement) and JSONC contribution parsing; keybindings via atmos_vsc_keybindings by Atom735.

Repository (GitHub)
View/report issues

Topics

#commands #keybindings #editor #vscode

License

MIT (license)

Dependencies

atmos_jsonc, atmos_vsc_keybindings, atmos_vsc_l10n

More

Packages that depend on atmos_vsc_commands