kishmakov / mojo-at-jetbrains

Repo for feedback and public materials for Mojo plugin for JetBrains IDEs
https://kishmakov.github.io/mojo-at-jetbrains/
Other
8 stars 0 forks source link

Solution: magic does not seem to support parameters: --no-optimization --debug-level full #12

Open dsidlo opened 1 month ago

dsidlo commented 1 month ago

/home/user/.modular/bin/magic run --no-optimization --debug-level full /home/user/workspace/program/program.mojo error: unexpected argument '--no-optimization' found

tip: to pass '--no-optimization' as a value, use '-- --no-optimization'

Usage: magic run [OPTIONS] ...

For more information, try '--help'.

dsidlo commented 1 month ago

I fixed the issue with the following script (magic-fix.sh), instruction in the scripts comments...

#!/usr/bin/bash                                                                                                                                                                                                                                             

# Usage...                                                                                                                                                                                                                                                  
# - Place into ~/.local/bin or ~/bin and make sure that the dir on in your PATH                                                                                                                                                                             
# - Set up a magic environment in your project                                                                                                                                                                                                              
#   - > cd ~/<path to my project>                                                                                                                                                                                                                           
#   - make sure that you deactivate any envs you are in.                                                                                                                                                                                                    
#     - > conda deactivate                                                                                                                                                                                                                                  
#   - > magic init --format mojoproject                                                                                                                                                                                                                     
#   - Start a magic shell for the prject environment                                                                                                                                                                                                        
#   - > magic shell                                                                                                                                                                                                                                         
#   - Verify that mojo is installed for this magic project                                                                                                                                                                                                  
#     - > magic run mojo --version                                                                                                                                                                                                                          
#       : mojo 24.5.0 (e8aacb95)                                                                                                                                                                                                                            
# - Install the mojo-plugin for you JetBrains IDE if not allready installed                                                                                                                                                                                 
# - In Ctrl+Alt+S Setting -> Languages & Frameworks -> Mojo. set the Driver: field to the full path to this script                                                                                                                                          
#   -> Driver: /<path>/magic-fix.sh                                                                                                                                                                                                                         
# - Finally, create and test a hello-world.mojo script from your IDE                                                                                                                                                                                        
#                                                                                                                                                                                                                                                           

cmd=$@
cmd=`echo "magic run mojo ${cmd}"`
echo Command: $cmd
exec $cmd
kishmakov commented 1 month ago

@dsidlo Thank you for information, will check that everything is smooth once magic is supported.