lego-spikeprime-mindstorms-vscode
lego-spikeprime-mindstorms-vscode copied to clipboard
Is it possible to use autocomplete for the spike libraries?
Thanks for this awesome tool. I recognized it for connecting the Remote Control to the Hub.
My question is just: Is it possible to use autocomplete for the spike libraries?
Thank you.
Hey @TravelTrader , this is on my wish list too, but so far did not find a good way to achieve this...
Can I help you in any way? I'm new with VSCode but I am coding for many years now. Maybe we can add this feature together in any way?
Well, this is my first vscode extension as well 😄 Problem is I haven't found a way how to include custom language autocompletions in a plugin. Right now from what I understand they fully rely on the native language service that comes with the given language.
Respect for this useful extension if it's your first. But I see the problem with the autocompletions. I'll tell you if I'd find anything, of course.
Seems it might be possible to use python.autoComplete.extraPaths: https://code.visualstudio.com/docs/python/editing#_enable-intellisense-for-custom-package-locations
Not sure if it will be possible to create and distribute mock PY files with all the methods provided from the LEGO hub in the extension and then users to add the extraPaths settings to their workspace and point it to the directory within the plugin. Or even better - to have the extension auto append its autocomplete folder to the list when it is loaded.
Hi!
We use an additional folder in the project directory. It describes all the classes and auto-completion works great. You can also describe functions in your language there.
For the spike library you can just put this file in the same folder as the program you're doing rn https://github.com/sanjayseshan/spikeprime-tools/blob/master/spiketools/hub/spike.py (I'm not sure if it has everything, but probably not since there is spike.control which can't be in the same file)
For the spike library you can just put this file in the same folder as the program you're doing rn https://github.com/sanjayseshan/spikeprime-tools/blob/master/spiketools/hub/spike.py (I'm not sure if it has everything, but probably not since there is spike.control which can't be in the same file)
We use this for us and it does have all functions, just mixed together into one single file. We had to sort out control functions and move them into a seperate file, etc.
@GSG-Robots and @PeterStaev the suggested work around using the 'spike.py' file also works with a 'mindstorms.py' file in the root directory.