Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Moonbit TasksNew to Visual Studio Code? Get it now.
Moonbit Tasks

Moonbit Tasks

Pegasus.Cadence

|
295 installs
| (1) | Free
Add smart tasks for moonbit and other project
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Features

Create a "SMART TASKS" panel in EXPLORER workspace view

> WORKSPACE
> OUTLINE
> TIMELINE
V SMART TASKS
    Build
    Check
    Test
    Coverage
    Run
    Clean
    Fmt
    Update
    Upgrade
    Package
    Publish

V GIT TASKS
    pull
    fetch
    commit
    commit|push

Build -> 'moon build'
Check -> 'moon check'
Test -> 'moon test'
Coverage -> 'moon test --enable-coverage; moon coverage report' 
Run -> 'moon run'
Clean -> 'moon clean'
Fmt -> 'moon fmt'
Update -> 'moon update'
Upgrade -> 'moon upgrade'
Package -> 'moon package'
Publish -> 'moon publish'

pull -> 'git pull'
fetch -> 'git fetch'
commit -> 'git commit -m "message"'
commit|push -> 'git commit -m "message"; git push'

Also support:
  Cangjie(cjpm)
  Gleam
  Rust (cargo, tarpaulin)
  TypeScript/JavaScript (npm)
  Go
  Swift
  Java (Maven)
  C/C++ (CMake, GoogleTest)
  Nim (nimble)
  Zig
Language definition within setting, can manually update, extension will reload definition automatically

Sample definition:
{"Moonbit":{"signatureFileName":"moon.mod.json","projectManagerCmd":"moon","macroHandler":null},"Rust":{"signatureFileName":"Cargo.toml","projectManagerCmd":"cargo","macroHandler":{"run":"run src/main","coverage":"tarpaulin --skip-clean"}},"Nim":{"signatureFileName":"*.nimble","projectManagerCmd":"nimble","macroHandler":{"run":"run","fmt":"for /r %f in (*.nim) do ( nimpretty --backup:off %f )","coverage":"testament --backend:html --show-times --show-progress --compile-time-tools --nim:tests"}},"Cangjie":{"signatureFileName":"cjpm.toml","projectManagerCmd":"cjpm","macroHandler":{"run":"run"}},"Zig":{"signatureFileName":"build.zig.zon","projectManagerCmd":"zig","macroHandler":{"run":"run src/main.zig","test":"test src/main.zig"}},"Gleam":{"signatureFileName":"gleam.toml","projectManagerCmd":"gleam","macroHandler":{"run":"run","fmt":"format"}},"Go":{"signatureFileName":"go.mod","projectManagerCmd":"go","macroHandler":null},"Wa":{"signatureFileName":"wa.mod","projectManagerCmd":"wa","macroHandler":null},"Java":{"signatureFileName":"pom.xml","projectManagerCmd":"mvn","macroHandler":{"build":"compile"}},"Npm":{"signatureFileName":"package.json","projectManagerCmd":"npm run","macroHandler":{"build":"compile"}},"TypeScript":{"signatureFileName":"tsconfig.json","projectManagerCmd":"tsc","macroHandler":null},"Swift":{"signatureFileName":"Package.swift","projectManagerCmd":"swift","macroHandler":{"run":"run"}},"C++":{"signatureFileName":"CMakeLists.txt","projectManagerCmd":"cmake","macroHandler":{"run":"run", "build":"-S . -B .build && cmake --build .build", "test":"-S. -B .build&&cmake --build .build&&ctest --test-dir .build"}}}

//Create tasks for contributed task group 'moon', to make build/test/clean etc tasks easier.

Requirements

CLI of Moonbit installed so that shellcmd 'moon' can be called

Extension Settings

Include if your extension adds any VS Code settings through the contributes.configuration extension point.

For example:

This extension contributes the following settings:

  • myExtension.enable: Enable/disable this extension.
  • myExtension.scanSubdirectoryForProject: default is true.

Known Issues

Release Notes

Users appreciate release notes as you update your extension.

0.0.1

Initial release of moonbit tasks - 'build', 'test'

0.0.2

Add icon, 'run src/main'

0.0.3

Undo web extension entrypoint

0.0.4

Add smart tasks view in explorer view

Build, Test, Run, Clean, Fmt, Coverage

0.0.5

Multi-root workspace support

Cangjie, Rust, Go, Gleam, Nim, Zig, Maven support

0.0.6

If multi project contains active document, choose the project that has maximum path length

Encounter typescipt bug, VSC 1.94.2, Node.js 20.16.0, Npm 10.8.2

					// Check each workspace folder to see if the file is in it and keep the folder that has maximum length
					let rootDir: vscode.WorkspaceFolder | undefined = undefined;
					const firstFoundRootDir = workspaceFolders.find(folder => {
						return false;
						//const folderPath = folder.uri.fsPath;
						//return fileDir.startsWith(folderPath);  // Check if the file is within this folder
					});
					rootDir = firstFoundRootDir; // Have to assign to the obsolete undefined firstFoundRootDir first, otherwise, in last line, rootDir can't by referenced, compiler reports .uri not exists, rootDir is of unknown type
					let maxPathLength = 0;
					workspaceFolders.forEach(folder => {
						const pathLength = folder.uri.fsPath.length;
						if (fileDir.startsWith(folder.uri.fsPath) && pathLength > maxPathLength) {
							maxPathLength = pathLength;
							rootDir = folder;
						}
					});
					if (rootDir !== undefined && rootDir !== null && rootDir.uri.fsPath.length > 0) {

Answer: do not assign undefined at begining

let rootDir : vscode.WorkspaceFolder | undefined; // = undefined;

0.0.7

  • Nim (*.nimble) project file support

0.0.8

  • Language definition file

  • Also search in parent folders for project file when current dir or active fold in workspace dir can't find project file

    1. Active file; 2. Active path; 3. Active parent paths chain (within workspace); 4. Root folders of workspace

0.0.9

  • Async load language def

  • Check, Update

0.0.10

  • Terminal shell/icon

0.11.1

  • Language definition save/load fix

  • Swift

0.11.4

  • Language definition save/load fix, monitoring change to reload

0.11.5

  • Language definition in setting, monitoring change

0.11.7

  • Update feature desctiption

  • cmake, google test

0.11.8

  • Update definition in setting for C/C++ CMake, Google Test

  • Disable contributed task group in 'Terminal' -> 'Run Task...'

0.11.20241103

  • LangDef setting fix

0.12.202411071

  • VSC version requirement lower to 1.80, so that VSC on Mac can use this extension.

0.12.2024111201

  • Update cmd handler for Zig, 'zig build run', 'zig build test'.

0.12.2024111202

  • Signature file pattern update, allow multiple file patter, seperated by '|', e.x. 'build.zig|build.zig.zon', '.nimble|.nim'

  • Add 'Package', 'Publish' tasks

0.12.2024111203

  • Fix signature pattern processing bug (remove first char)

0.12.2024112906

  • Redefine tasks of language, smart tasks menu refresh when capture project signatures

  • Add Git tasks view

0.12.2024112907

  • Update language def

0.12.2024120103

  • Git Webview

0.12.2024120205

  • Smart Tasks Webview

0.12.2024120206

  • Smart Tasks visibility management

0.12.2024120302

  • Git button and commit message state

0.12.2024120304

  • Git branch switch

  • Git repository switch

0.12.2024120305

  • Smart tasks tree view update

0.12.2024120306

  • Git pull/fetch/commit/push buttons on title bar

  • Git root detection

0.12.2024120401

  • Detect HEAD detached state

0.12.2024120402

  • cd PATH slash processing

  • div frame reduce

  • Fix discard()

0.12.2024120403

  • Custom modal dialog for discard()

  • Visibility control for Changes/Staged/CommitMessage/RepositorySelector

  • Fix project path

0.12.2024120501

  • Fix current repo not sync with selected repo

  • Fix repo root path for Windows

  • Click to view diff on changes (but not on staged changes yet)

-- Watch git root or current repo for file system changes to getGitChanges

0.12.2024120502

  • Fix view for staged changes.

  • Git button shown depend on git state.

0.12.2024120601

  • Fix icons for smart tasks tree view.

0.12.2024120602

  • Add 'Benchmark' tasks.

0.12.2024120603

  • async error catching.

  • init refresh timing adjust.

  • Fix upstream of branch info filter.

0.12.2024120604

  • Reuse terminal by name.

  • Npm lint.

0.12.2024120605

  • Fix extension search slice processing.

0.12.2024120606

  • Show repository selector even only one.

  • repo root path format convention for windows.

0.12.2024120607

  • Icon for Project Tasks.

  • Filter out tags/remotes from git.getRefs().

0.12.2024120701

  • Nim format script for bash.

0.12.2024120702

  • Responsive update.

0.12.2024120902

  • File status in repo

0.12.2024120903

  • Add LICENSE into package.json to avoid warning on vsce for macOS

0.12.2024120904

  • File status one letter mark

0.12.2024121001

  • Project Tasks submenu

0.12.2024121003

  • Language definition update for submenu

0.12.2024121101

  • Refine submenu

  • Language definition update

0.12.2024121102

  • Encode/Decode shellCmd to avoid conflict with JavaScript quotes.

0.12.2024121501

  • Click Project Tasks bar can toggle tasks display.

  • Add To Do tree view, to collect To Do information source.

0.12.2024121502

  • Regression verify and fix staged change tree, working change tree. Add merge conflict tree.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft