In the new VS Code debugger (which is mostly working well for me (and which I like much better than the old IDE)), I can't figure out where syntax errors are reported.
I'm more of a C++ guy and make a lot of little syntax errors when writing Python code. Every time I make such an error the following happens:
And then nothing. It doesn't start the debugger. It doesn't report an error message (or any problems). Just nothing.
Then I stare at the code until I see the syntax error, fix it, repeat the same process and the debugger starts and steps to "main". As my code size grows this is becoming unworkable; staring works better on a short test program than on a longer more product oriented program.
It must be generating an error message like "unexpected semicolon on line 31", but I don't know where to look.
Solved! Go to Solution.
Solved by Nilesh.Mohite. Go to Solution.
Hi Mr. KennethOfLeesburg
Please consider checking (using outside to F360 docs) linting processes in Python environment.
In VSCode the process can be activated from <View><Command Palette...>. Type at the prompt <Lint...>
and you will see available options.
Regards
MichaelT
Hi @KennethOfLeesburg ,
You can follow method suggested by @MichaelT_123 .
Same thing you can achieve by setting flag "python.linting.pylintEnabled" to true in settings.json file present in the .vscode directory as shown in screenshot"Enableflag.png".
And if you have not installed pylint, vscode will ask you to install the same with a poup message.
Once setup is done, pylint will start showing you the warnings in the 'PROBLEMS' window of vscode after you save the changes as shown in example "DemoWarning.png".
For further your reference -
Currently pylint is also showing warning for import of adsk.core,adsk.fusion & adsk.cam modules even-though we have added the extra def paths to the vscode (Still script will run successfully). That's why we are setting "python.linting.pylintEnabled" flag to "false" before opening sripts to avoid confusion. We are working on addressing this issue.
If my answer helped you, please use ACCEPT SOLUTION .
Also be generous with Likes! Thank you and enjoy!
VSCode only supports one directory in the PythonPath so it raises exceptions on import adsk.core.
Asked my son about it (he's a computer genius, not like his dad).
So it seems, all that is needed is to add a comment after the import to tell Pylint what to do.
with this sort of line, the pylintEnabled can be set to true:
import adsk.core, adsk.fusion # pylint: disable=import-error
Thanks for the reply.
We will surely look in to it.
Special thanks to your son for his help.
If my answer helped you, please use ACCEPT SOLUTION .
Also be generous with Likes! Thank you and enjoy!
Can't find what you're looking for? Ask the community or share your knowledge.