/mk-targets-runner

A Visual Studio Code extension to easily run command files: Makefile, just, ...

Primary LanguageTypeScriptMIT LicenseMIT

Targets Runner

Run Makefiles and justfiles directly from your editor. Available for download at the VSCode Marketplace.

Key Features

Inline Runner

Toggle this feature using mk-targets-runner.enableInlineTargetRunner.

or from the gutter:

Quickpick Menu for Running any Target

Support for Included Files

Run targets targets from included files:

Additional Features

  • Re-run last target
  • Support for justfile-comments (shown as description in the picker)
  • Proper execution of included files, ensuring variables defined in one file are recognized in included targets.

Configurations

Property Description Type Default Value
mk-targets-runner.command.make The command to run makefiles targets. string make -C <dir> -f <fsPath> <name>
mk-targets-runner.command.just The command to run justfiles targets. string just -d <dir> -f <fsPath> <name>
mk-targets-runner.dryrun.make The command to run makefiles targets in dry-run mode. string make -C <dir> -f <fsPath> --dry-run <name>
mk-targets-runner.dryrun.just The command to run justfiles targets in dry-run mode. string just -d <dir> -f <fsPath> --dry-run <name>
mk-targets-runner.filePattern.make The glob patterns to match makefiles. array ['Makefile', '*.mk']
mk-targets-runner.filePattern.just The glob patterns to match justfiles. array ['justfile', '*.just']
mk-targets-runner.excludedFoldersPatterns The glob patterns to exclude folders. array ['**/.git', '**/node_modules']
mk-targets-runner.enableInlineTargetRunner Enable inline target runner. boolean True
mk-targets-runner.inlineRunnerLocation Where to show the inline target runner. string target

TODO

  • Timeout for finding targets
  • Add tasks via the TaskProvider
  • Right now the extension uses the activation event onLanguage since the extension should be activated for any targetfile type which is dynmically determined. This is not ideal since it will be activated for any file
  • Extend support to include Rakefile and Python typer
  • Git hooks for:
    • Tests
    • Linting
    • Configurations generation
  • Add tests
  • Auto increment version with commit and auto append commit messages to CHANGELOG.md
  • Add a visual indication (e.g., spinner) to show the extension is actively searching for targets
  • Option to open the included file in a new editor tab
  • Detect just version to determine which include directive to use
  • Use offical lexer to parse just files

Helpful Resources

Developer Notes

  • To enable glob import, it was necessary to shift it from devDependencies to dependencies in package.json (see this discussion). Without this change, the extension failed to activate with an error "Cannot find module 'glob'", a problem not encountered in debug mode.