Been using VS Code with RobotCode extension for a while, but never really looked into launch.json and parameters. So now I’m facing an issue with the file run / run all button visibility is a good time to dig into.
I have my “usual” folder/workspace where everything works well (execution, debug etc…), green arrows visible.
I have set another new folder/workspace where I have some other .robot or .py files, and copied/pasted the .vscode folder with launch.json at the root of the folder.
However I cannot manage to get the button on the left side of the test cases (even if I can run and debug from the VS Code button).
Setup is as follow :
With a “standard” .json file :
I have trying to reload, restart, delete and re-add manually the configuration with “Add configuration”, but no luck til now
Also on .py files (maybe a hint) I don’t have the green arrow for execution and debug.
I currently have only one python version/interpreter which is selected, and my test case can be run from the Debug left button.
I compared the outputs (RobotCode Language Server mode has nothing) between my two workspaces (one with green arrow, the other not), the infos in Output\Robotcode are the same, as below :
Activate RobotCode Extension.
Try to activate python extension
Python Extension is active
executeRobotCode: c:\Users\myuser\AppData\Local\Programs\Python\Python312\python.exe -u -X utf8 c:\Users\myuser.vscode\extensions\d-biehl.robotcode-0.80.0\bundled\tool\robotcode --format json --no-color --no-pager --default-path . profiles list
create Language client: RobotCode Language Server mode=pipe for folder “CodeProject”
trying to start Language client: RobotCode Language Server mode=pipe for folder “CodeProject”
client for file:///c%3A/Users/myuser/Documents/CodeProject starting.
executeRobotCode: c:\Users\myuser\AppData\Local\Programs\Python\Python312\python.exe -u -X utf8 c:\Users\myuser.vscode\extensions\d-biehl.robotcode-0.80.0\bundled\tool\robotcode --format json --no-color --no-pager discover info
executeRobotCode: exit code 0
executeRobotCode: c:\Users\myuser\AppData\Local\Programs\Python\Python312\python.exe -u -X utf8 c:\Users\myuser.vscode\extensions\d-biehl.robotcode-0.80.0\bundled\tool\robotcode --format json --no-color --no-pager --default-path . profiles list
executeRobotCode: exit code 0
client for file:///c%3A/Users/myuser/Documents/CodeProject running.
client for file:///c%3A/Users/myuser/Documents/CodeProject started.
Error: Can’t get items for keywords treeview: Error: Request canceled.
executeRobotCode: exit code 0
executeRobotCode: c:\Users\myuser\AppData\Local\Programs\Python\Python312\python.exe -u -X utf8 c:\Users\myuser.vscode\extensions\d-biehl.robotcode-0.80.0\bundled\tool\robotcode --format json --no-color --no-pager --default-path . profiles list
executeRobotCode: exit code 0
Tried to clear cache and restart language server too, for now I did not work.
I compared setting by setting in RobotCode sections the parameters between my two workspaces, but did not find anyting different.
May a VS Code workspace parameter show/hide this ? Or it’s only linked to the above parameter ?
Hi @CharlieScene ,
the first thing I do whenever I recognize tests not able to start is to check if there are any pending updates.
So, first check if there is a never VS Code version available (perhaps it has been installed inthe background) and check if there are any extensions waiting for an update.
Perhaps @daniel can tell more about this phenomen, in my case it helped me several times to “solve” such generic problems.
Thanks for the hints. Checked all the tools, and they were up to date.
In my case I can start the tests anyway, it’s just the Run button that was missing on the side of the test file.
Till now I didn’t find the reason but spend a lot of time today to try to reproduce it properly (verify glyph parameters, version, .json settings…)
What I know for sure is this (all opened as folder and not workspace) :
My usual “working folder” A has the button, has well as tests in the View > Testing. Here everything is ok
The new folder B has not the button on tests files, nor tests in View > Testing. However when opening a .robot file the RobotCode extension initializes in the bottom bar, but faster than on working folder. Output for RobotCode is however the same.
I tried to :
Create a new folder C \ Open it in VS Code, create a .robot file => OK (Run available)
Copy/paste B folder next to C folder => NOK (Run not available, no tests)
Renaming B folder and reopening with new name => NOK (Run not available, no tests)
Copy/paste full content of B in C folder => NOK (Run not available, no tests)
Remove/copy partially folder B content in C folder, by creating manually subfolder => OK (Run available)
So finally I’m wondering if some folders or files naming or else could lead to a wrong initialization.
I tried also to rename some “Python” folder to generic name, reload window and restart extension/empty cache.
Tbh for now I can have it work, so unless the infos above remind some memory to somebody, I’ll probably find the reason someday
You create a folder, open it in VSCode and everything works.
Then you create a 2nd folder that has the same parent folder as the first folder, and it doesn’t work? Do you then also open this folder in VSCode or do you just drag the file into VSCode?
Maybe you can be more specific.
Do you possibly have any settings in your 1st folder that contain absolute paths or something?
Maybe you can record a short video or something or attach a zip with example code?
You don’t actually need the launch.config for RobotCode, there is the robot.toml file in RobotCode for that, the written documentation is still being created, but I gave a tutorial about it at RoboCon,
Yes the behavior is as you described, and Iopened the folder directly, never use the drag & drop.
I totally agree it doesn’t really make sense… that’s why I was searching the reason to be able to fix it if it happens on another project.
Anyway I’ll continue to seek, and I had started the video already, so I’ll see if I find something.