Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use autocomplete for the spike libraries? #29

Open
TravelTrader opened this issue Mar 6, 2022 · 9 comments
Open

Is it possible to use autocomplete for the spike libraries? #29

TravelTrader opened this issue Mar 6, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@TravelTrader
Copy link

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.

@PeterStaev PeterStaev added the enhancement New feature or request label Mar 7, 2022
@PeterStaev
Copy link
Owner

Hey @TravelTrader , this is on my wish list too, but so far did not find a good way to achieve this...

@TravelTrader
Copy link
Author

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?

@PeterStaev
Copy link
Owner

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.

@TravelTrader
Copy link
Author

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.

@PeterStaev
Copy link
Owner

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.

@Neko1993
Copy link

Neko1993 commented May 30, 2022

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.

@BlockOG
Copy link
Contributor

BlockOG commented Jun 25, 2022

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)

@PeterStaev PeterStaev pinned this issue Oct 17, 2022
@GSG-Robots
Copy link

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.

@Ruimtewese
Copy link

@GSG-Robots and @PeterStaev the suggested work around using the 'spike.py' file also works with a 'mindstorms.py' file in the root directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants