mojo
mojo copied to clipboard
[BUG] VSCode extension doesn't run simple file after switch to magic
Bug description
I am trying to run simplest file:
fn main():
var a = 1
print(a)
within project set up by magic init mojo-examples --format mojoproject
The result is it looks like Mojo extension is not aware of anything:
Failed to initialize Crashpad. Crash reporting will not be available. Cause: while locating crashpad handler: unable to locate crashpad handler executable
/home/kishmakov/Documents/mojo-examples/7.mojo:1:1: error: unable to locate module 'stdlib'
fn main():
^
/home/kishmakov/Documents/mojo-examples/7.mojo:1:4: error: unable to locate module 'builtin'
fn main():
^
/home/kishmakov/Documents/mojo-examples/7.mojo:2:1: error:
var a = 1
^
/home/kishmakov/Documents/mojo-examples/7.mojo:2:13: error: could not find an 'IntLiteral' type
var a = 1
^
/home/kishmakov/Documents/mojo-examples/7.mojo:3:5: error: use of unknown declaration 'print'
print(a)
^~~~~
/home/kishmakov/.config/Code/User/globalStorage/modular-mojotools.vscode-mojo/magic-data-home/envs/max/bin/mojo: error: failed to parse the provided Mojo source module```
Though it works through console as follows:
$ magic run mojo 7.mojo 1
### Steps to reproduce
- Include relevant code snippet or link to code that did not work as expected.
- If applicable, add screenshots to help explain the problem.
- If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
- Include anything else that might help us debug the issue.
### System information
```shell
$ magic --version
magic 0.3.0
Mojo VSCode extension: v24.5.2
$ echo $MODULAR_HOME
/home/kishmakov/.modular
$ tree $MODULAR_HOME
/home/kishmakov/.modular
├── bin
│ └── magic
└── webUserId