Closed kevindawson closed 3 years ago
Hi @kevindawson - I either can't reproduce this or I'm not understanding correctly, sorry.
I've started a new Python file in Pico-Go and have configured the project so it's using the Pico-Stub stubs:
settings.json
is as follows:
{
"python.linting.enabled": true,
"python.analysis.typeshedPaths": [
".vscode/Pico-Stub"
],
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "basic",
"python.analysis.extraPaths": [
".vscode/Pico-Stub/stubs"
]
}
First line of the Python file is:
from machine import Pin, ADC
I don't see anything confusing; linting and intellisense all seem fine.
Also, machine.pyi
is already in its own folder:
Sorry if I'm missing something; can you please clarify?
@cpwood pylint & mypy would be my first choice in pycharm. But that is not going to happen soon with rp2.
In vscode I have been having issues with linting & types after switching over to pylance - not my first choice but much easer to use due to your efforts.
rp2-pico-20210313-unstable-v1.14-108-ge98ff3f08.uf2
after re-reading pylance info on git hub I think you need to add the additional settings
there seamed to be an improvement
nb. state.machines are still a pain in the rear at present regardless of which linter is used
the above is just sharing my critique with you
If you'd prefer to use Pylint, this should help. When the stubs weren't part of Pico-Go, this is how I used to do it.
Regarding state machines, I know exactly what you mean. This is the best workaround for now, though I'd prefer to be able to disable linting for a specific method. Not possible at the moment, unfortunately.
@cpwood I was going through that erk-sum process - hence switch to pylance due to your efforts
You need a link on GitHub front page -> http://pico-go.net/docs/start/tips
cool -> #assembly-code-errors - works great nice and quite on the lint errors now
I like a lot of others I expect will go to a projects GitHub as first place to look for info. or read the code works if I have too.
Pylance - gets confused, Pin & ADC with out above
settings.json