robocorp / robotframework-lsp

Robocorp extensions for VS Code: Robocorp Code and RFW LSP
https://robocorp.com/docs/developer-tools/visual-studio-code
Apache License 2.0
205 stars 93 forks source link

VS Code is trying to run conda activate, but it should not try it. #636

Closed janipalsamaki closed 2 years ago

janipalsamaki commented 2 years ago

This seems to execute source on conda activate script. I guess this is not the intended behavior?

source /Users/janipalsamaki/.robocorp/RobocodeLab/data/conda/bin/activate
conda activate b1f3c244e_6cd60f16
~/Projects/template-robot-framework-playwright $ source /Users/janipalsamaki/.robocorp/RobocodeLab/data/conda/
bin/activate
(Robocode Lab) ~/Projects/template-robot-framework-playwright $ conda activate b1f3c244e_6cd60f16
Could not find conda environment: b1f3c244e_6cd60f16
You can list all discoverable environments with `conda info --envs`.

(Robocode Lab) ~/Projects/template-robot-framework-playwright $

Note that the output says: Could not find conda environment: b1f3c244e_6cd60f16.

This is probably pointing to a holotree environment and thus fails?

Conda activate should not happen in any case?

This is similar behavior has been seen on the forums and on the Slack, so this might be happening to other people, too.

Ping me (or Jippo) for more information!

fabioz commented 2 years ago

@janipalsamaki which version of the ms-python extension do you have?

i.e.: this is really done by the ms-python extension and actually needed a setting such as "python.terminal.activateEnvironment": false, but I can't really reproduce this with ms-python v2022.4.0 anymore, so, I'd like to know if this is something they actually fixed in that version (or maybe I have a setting in an unexpected place which is disabling this...)

xylix commented 2 years ago

@fabioz If the ms-python extension is doing it I guess the surprising part to the user would be that when Robocorp: Terminal with Robot environment is run, ms-python is still doing things in that terminal.

fabioz commented 2 years ago

Yes, it does that to all created terminals inside of VSCode (regardless of the reason).

fabioz commented 2 years ago

The latest pre-release of Robocorp Code sets "python.terminal.activateEnvironment": false so that this doesn't happen anymore.

janipalsamaki commented 2 years ago

This change might have introduced a bug where creating a single-bot workspace fails due to the folder not being empty since a new .vscode/settings.json is created before rcc is done with creating the robot files.

rcc refuses to write the files if the target folder is not empty.

One possible solution might be adding the --force flag to the rcc command. This would ignore the folder not being empty. Not sure if this would have bad consequences in some scenario.

fabioz commented 2 years ago

Thanks for the report. I've just fixed that and pushed a 0.30.0 with a fix.