#As for the LSP troubleshooting I'm

1 messages · Page 1 of 1 (latest)

sturdy heart
#

Got it. So when I'm making a new standalone module with dagger init --sdk=python it's easy, just cd into the new module dir and run my editor with uv like

uv run zed .

If I'm daggerizing a project and will have a .dagger directory within it, then running the above in the root of the project won't work for the LSP, so I should run it within the .dagger (you say within .dagger/.venv but in .dagger was enough for me).

But I don't get LSP support in the original window after that, just in the second window with the dagger module code only.

So need two windows for now, eh, to work on the whole project (dagger and non-dagger)?

jagged oracle
jagged oracle
# sturdy heart Got it. So when I'm making a new standalone module with `dagger init --sdk=pytho...

So need two windows for now, eh, to work on the whole project (dagger and non-dagger)?

That's just the simpler solution so you don't have to fiddle with IDE settings but if you want to it depends on the IDE. You'll need to read the docs on how your IDE handles monorepos with multiple virtual envs in Python. Nothing special about a Dagger module, it's a normal Python project. For example, this is for VS Code: https://github.com/microsoft/vscode-python/wiki/Mono-Repo-Set‐up-Guide#scenario-2-separate-virtual-environments.

#

The improvement I want to make easier is sharing the virtual env with the main project, using a workspace. That way you can have a single virtual env at the root of the project, meaning you don't need monorepo support in the IDE. Just the one at the root will do. There's more about this in https://github.com/dagger/dagger/issues/8583.

sturdy heart
north remnant
#

yep same. When I have a dagger python module under .dagger and run uv run <ide> . from the project root, uv doesn't generate a venv at all because all the python code is in that .dagger subdirectory

jagged oracle
#

You can also do uv run --directory .dagger <ide>.

north remnant
#

That does the same as running uv run <ide> . from the .dagger subdir (maybe thats what you were saying). What we want to do is open the project root in the ide and have type hints and auto completes for a module thats not in the project root. Maybe its not possible without special ide configuration?

jagged oracle
#

How do you guys do with Go? I also cd into the module before calling vim in Go. Do your IDEs pick multiple modules seamlessly?

north remnant
jagged oracle
#

VSCode and others could do the same for Python. They just don't go the extra mile in doing that automatically. It's not hard to do it manually though, like you don't need to edit a json configuration file or anything, just need to do some right clicking and manually marking other roots in the project. Both VSCode and PyCharm.

north remnant
#

Cool I'll see if theres a way to do this in zed. It may not be supported yet without actually editing a config file because their .venv support is relatively new

#

cc other zed users ( @analog comet @lusty lava )

You currently must open the module source folder directly for python IDE integration (uv run --directory .dagger zed .)

#

Maybe we can poke our friends at zed to get the issue resolved 👼

sturdy heart
#

Something we could add to our Dagger VS Code extension perhaps

north remnant
sturdy heart
north remnant
#

sure but right now there's no reason to install the dagger vscode extension (last I checked it was just Cue LSP), so its not like they'll be installing it anyway and we're automating anything behind the scenes