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
0.0.9
Async load language def
Check, Update
0.0.10
0.11.1
0.11.4
- Language definition save/load fix, monitoring change to reload
0.11.5
- Language definition in setting, monitoring change
0.11.7
0.11.8
Update definition in setting for C/C++ CMake, Google Test
Disable contributed task group in 'Terminal' -> 'Run Task...'
0.11.20241103
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
0.12.2024112907
0.12.2024120103
0.12.2024120205
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
0.12.2024120401
- Detect HEAD detached state
0.12.2024120402
cd PATH slash processing
div frame reduce
Fix discard()
0.12.2024120403
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
0.12.2024120601
- Fix icons for smart tasks tree view.
0.12.2024120602
0.12.2024120603
0.12.2024120604
Reuse terminal by name.
Npm lint.
0.12.2024120605
- Fix extension search slice processing.
0.12.2024120606
0.12.2024120607
0.12.2024120701
- Nim format script for bash.
0.12.2024120702
0.12.2024120902
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
0.12.2024121003
- Language definition update for submenu
0.12.2024121101
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.