vscode-tree-view
vscode-tree-view copied to clipboard
Support for ABB robot programming language RAPID
Have have been programming/editing robot programs for many years. Used ABB RobotStudio for online editing, for offline i have used UltraEdit and Notepad++. Now I started using Visual Studio Code for programming Arduino and other small controllers. Found some plugins for RAPID and tried it out.
Works great, or at least almost.....
It is possible to drag a backup(folder) into VSCode and then use the Explorer to navigate down to the .mod-file. File opens and highlighting etc is working fine.
In UltaEdit it is possible to view a "function list", this list show all procedures and it is possible to go direcly to that part/Procedure:
Would it be possible to achieve this with "File Tree View"?
The functions that are use are: PROC, LOCAL PROC, TRAP, FUNC and RECORD
Thanks for opening the ticket, I would be glad to add support for it, could you just provide me with a reference documentation or snippets that I can use for testing out the implementation?
To save some time I have recorded a short clip. I´m explaining some stuff regarding RAPID structure and also show what I have managed to do with another extension(Code Map). https://youtu.be/6deoocggj3g
The zip contains some sample files you can use to do tests. When you have questions, just shoot :-D BackupFolderExample.zip
To config Code Map I added this to the settings: ` // Regex-based definition of the mapping rules for ABB RAPID syntax. "codemap.mod": [ { "pattern": "MODULE (.)", "clear": "", "suffix": "", "icon": "class" }, { "pattern": "LOCAL PROC (.)[()]", "clear": "", "suffix": "", "icon": "level2" }, { "pattern": "PROC (.)[()]", "clear": "", "suffix": "", "icon": "level1" }, { "pattern": " TRAP (.)", "clear": "", "suffix": "", "icon": "function" }, { "pattern": "FUNC (.)[()]", "clear": "", "suffix": "", "icon": "function" }, { "pattern": " RECORD (.)", "clear": "", "suffix": "", "icon": "function" } ],
"codemap.sys": [ { "pattern": "MODULE (.)", "clear": "", "suffix": "", "icon": "property" }, { "pattern": "LOCAL PROC (.)[()]", "clear": "", "suffix": "", "icon": "property" }, { "pattern": "PROC (.)[()]", "clear": "", "suffix": "", "icon": "property" }, { "pattern": " TRAP (.)", "clear": "", "suffix": "", "icon": "property" }, { "pattern": "FUNC (.)[()]", "clear": "", "suffix": "", "icon": "property" }, { "pattern": " RECORD (.)", "clear": "", "suffix": "", "icon": "property" } ],
"codemap.cfg": [ { "pattern": "(.*)[:]", "clear": "", "suffix": "", "icon": "property" } ], `
Thank you very much for the detailed info. I am confident that I will have more time around the end of the week so I can work on the extension as recently work has piled up.
Guess you are busy :smile: Let me know if you want me to specify anything to make it easier for you :+1:
I am absolutely sorry for the delay, I am extremely busy in the past couple of months ... I haven't forgotten about the request and will try to make it asap 😔
No problem, take your time, I have a temporary solution, no hurry
Hey sorry for the delay, but I think it might be worth it :slightly_smiling_face: I have managed to workout an MVP support which I will probably try to release by the end of the week.
Here is a small video with how it looks like atm, please feel free to share any feedback you might have I will happily consider/discuss any suggestions
I'm not in a hurry, stay cool :-D Looking good! Looks like it does what i should, don't have any feedback right now. When you have released I will try it out.
I did a few small tweaks & fixes, could you install this preview version of the extension and check it out if it makes sense.
Namely the handling of LOCAL FUNC
and TRAP
are what I am concerned about, but since I have no knowledge about RAPID I don't think I will be able to take a good informed decision
If you have time that is
Looking forward to try it out but ended up in a strange problem.... TREE extension will not show up in explorer if I install a version higher than 2.3.1. I have tried several versions but it just wont show up? Have disabled all other extension. Tried to start VScode as administrator, no luck. Am I doing something wrong? Any ideas what to try? Try another computer/installation? Make a reinstall of VScode?
With 2.3.1(OK):
With 2.4.0(NOK):
With 2.6.0(NOK):
(After update/install of new version restart was done)
Note that there is an < >
icon on the ~right~ left, that is the icon for the extension. Although as part of the RC there is a configuration which you can use to move it back to the explorer
view.
Look for "treeview.location" in settings editor - sidebar
is the new icon on the activity bar, and explorer
is the behavior you had previously under explorer
You got me on track and moved it back :smile:
Running the RC:
But nothing will show up :thinking: :
Refresh wont help...
Because I am an idiot :laughing: you will need to add rapid
to your vscode config to enable the functionality, "treeview.allowedProviders"
is the key, and in order to enable just rapid
add ["rapid"]
or alternatively to enable all set the value to []
We take turns being an idiot, fine for me :laughing:
I have the RC active:
Have added "treeview.allowedProviders" but can´t get it to work with rapid. Changed the file type of settings.json from jsonc to json, then tree is updated. Added jsonc to "treeview.allowedProviders" but it will not update tree. Same case as with rapid :thinking:
From my tests..... (I have restarted vscode every time i have made changes to settings.json)
Tree updating with json:
Not updating with jsonc:
Not updating rapid:
If removing json it obviously wont update json:
:thinking: Could you try this RC to see if it works now, cuz I have the slight suspicion I might've build against the wrong branch. and I have removed the need for allowedProvidres
configuration, so regardless of what you have in there you should see the tree displayed.
Still not working, really strange :thinking:
I have RC2 installed:
Still no tree when opening a .mod recognized as rapid:
Looks like the "allowedProviders" is not functional any more, if i remove json it will still show in tree:
I have tried to disable all other extensions, no luck. Can it be a conflict with other extensions?:
Also tried to run vscode as admin, no luck.....
it is pretty strange I can't reproduce the case. I am using the code sample you have provided, but it seems to be working correctly on my side with both RCs.
Looks like the "allowedProviders" is not functional any more, if i remove json it will still show in tree
This is because there is a check if the file is dirty, in order to prevent attempting to parse a file which is in invalid state while you type. The tree should update once you save the changes.
have tried to disable all other extensions, no luck. Can it be a conflict with other extensions?:
I've had this previously occur, but I can't recall for which language. Although then in the new view it was saying something like "No provider registered" or smth.
I've managed to reproduce the case, when I changed the file language from rapid to something else, then the view was not updated, but when I clicked on the refresh
action it rendered properly. Another thing that you can try is opening another file and cycling between the files to see if it gets things going or not (although there is a slight chance it should've happened already when you switched to settings.json
and back)
I will try to see if I can get the issue to reproduce on my end so I could fix it
I have tried opening the sample files and also "real" rapid files. No luck. Also switch between them, restarted vscode. Let me know when you have come up with something to try.
Any news? Something I should test for you?
Sorry, I didn't have enough time, I will try to investigate today to see if I could come up with something
Hey I was looking for a way to get in touch, can you proved any feedback if the abb support is working prooerly?
Hey, sorry for not answering! Got back to work from vacation and now have some time to continue. Migrated my computer from win7 to win10 and installed VScode. Have tested the latest published version(2.7.0) and also the previous RCs you sent in this issue thread. No luck.... Uninstalled VSCode and recorded a movie showing re-installation and opening the example rapid file, also example .json and a .js file. Tree view is not working for rapid but for the others...
Have a look HERE
Had a look in the rapid.js which is more or less mumbo jumbo for me but I noticed "return langId === "rapid";" is written "rapid" with lower case. Noticed there are two extensions for Rapid. One of them shows "rapid" in down right corner and the other "RAPID". None of them work....
Hey, no worries, thanks for your feedback, I am reopening the issue and will give it another shot, maybe I missed something along the way, I will keep you updated as much as I can with any progress I manage to make on this one :+1:. :beer: because you have a ton of patience :)
Sounds great! No problem for me to wait 😄 Pretty sure you will find that last missing thing, let me know when you have something for me and I will try it 👍
Have have been programming/editing robot programs for many years. Used ABB RobotStudio for online editing, for offline i have used UltraEdit and Notepad++. Now I started using Visual Studio Code for programming Arduino and other small controllers. Found some plugins for RAPID and tried it out. Works great, or at least almost..... It is possible to drag a backup(folder) into VSCode and then use the Explorer to navigate down to the .mod-file. File opens and highlighting etc is working fine.
In UltaEdit it is possible to view a "function list", this list show all procedures and it is possible to go direcly to that part/Procedure:
Would it be possible to achieve this with "File Tree View"?
The functions that are use are: PROC, LOCAL PROC, TRAP, FUNC and RECORD