saviorand / lightbug_http

Simple and fast HTTP framework for Mojo! šŸ”„
MIT License
582 stars 37 forks source link

lightbug_http package support in VSCode #73

Open ajshedivy opened 2 weeks ago

ajshedivy commented 2 weeks ago

NOTE: I am new to the modular ecosystem so I appreciate you help and patience :grin:

I followed the instructions to setup a mojoproject using magic:

  1. Create mojo project
magic init lightbug-test --format mojoproject
  1. Add community channel to mojoproject.toml

    [project]
    channels = ["conda-forge", "https://conda.modular.com/max", "https://repo.prefix.dev/mojo-community"]
  2. Add lightbug_http package

magic add lightbug_http

mojoproject.toml:

[project]
channels = ["conda-forge", "https://conda.modular.com/max", "https://repo.prefix.dev/mojo-community"]
name = "lightbug-test"
platforms = ["osx-arm64"]
version = "0.1.0"

[tasks]

[dependencies]
max = ">=24.5.0,<25"
lightbug_http = ">=0.1.5,<0.2"

Everything up to this point works great, but when I create a mojo file in vscode and import modules from lightbug_http, I get the following error:

unable to locate module 'lightbug_http' mojo

image

I am able to run the server just fine using magic run mojo image

Is there a setup step or config I am missing that would resolve the import errors with mojo? Is there a way to select a "magic environment" like in python where you can activate a specific environment in vscode?

Desktop (please complete the following information):

ajshedivy commented 2 weeks ago

After doing some more reading I found that there is not a package manager (yet) for mojo. I cloned the repo and added it to my include directories in mojo extension settings which resolves the import errors šŸ‘

saviorand commented 2 weeks ago

@ajshedivy yup, there is basically no IDE support for this kind of package management in Magic/Mojo ecosystem yet. Hopefully we get it soon!