Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VSCode plugin] Intricate un-responsive case for the plugin #503

Open
iscas-zac opened this issue Dec 2, 2024 · 1 comment
Open

[VSCode plugin] Intricate un-responsive case for the plugin #503

iscas-zac opened this issue Dec 2, 2024 · 1 comment

Comments

@iscas-zac
Copy link

Bug Report

Environment

OS

Operating System: Windows

MoonBit CLI Tools Version

moon version --all
moon 0.1.20241128 (b242ba1 2024-11-28) ~.moon\bin\moon.exe
moonc v0.1.20241201+31766fa96 ~.moon\bin\moonc.exe
moonrun 0.1.20241128 (b242ba1 2024-11-28) ~.moon\bin\moonrun.exe

A story of pitfalls

> moon new example && cd example && code .
Created example
example> mkdir src/test
example> echo 'test "123" { panic() }' >> src/test/test.mbt

Switch to VSCode, and run the "run test" for the new test.mbt. It shows error: could not find a moon.mod.json file in the source directory or its ancestors in the panel.

(The "run test" seems to run

example> moon test --target wasm-gc -p moonbitLsp/orphanPkg0 -f test.mbt -i 0
Warning: cannot find file `test.mbt` in package , --file only support exact matching
Warning: no test entry found

under the hood)

It is natural to add a 'mod.json' file here according to the error message.

example> echo '{}' >> src/test/moon.mod.json

Still doesn't work. It seems to need a pkg.json?

example> echo '{}' >> src/test/moon.pkg.json
example> rm src/test/moon.mod.json

Switch back to VSCode, click the moon.pkg.json and then back to test.mbt. The "run test" above the test line are still there but could not respond any more. The green button on the left is still responsive, but clicks still give error: could not find a moon.mod.json file in the source directory or its ancestors in the panel. Meanwhile, the test case in lib folder still works.

Finally restarting VSCode makes it happy.

@bzy-debug
Copy link
Contributor

confirmed, will be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants