Why does vscode pylint miss obvious errors? - visual-studio-code

I have a python file open in Visual Studio Code with an obvious error (using an undefined variable) but the pylint issues listed under 'Problems' show only a long list of minor convention issues.
Running pylint manually on it (separately from vscode) spots the error fine. The error is not explicitly excluded by any vscode pylint-related configs as far as I can see.

Eventually I discovered this was due to the following default setting in vscode:
"python.linting.maxNumberOfProblems": 100
Editing this config to a higher number (e.g. 1000) made the error show up.
Evidently this limit is applied blindly to the pylint output in the order the problems are found, so if enough minor issues precede an error then the error will be hidden - not ideal.

Related

Elixir: VS Code ExUnit cannot find Mix

I cannot load or run my tests, from within VS Code.
I'm a new user to Elixir, and to VS Code. I'm running Lubuntu 21.10 (Impish). I've downloaded Erlang/OTP 25 (.deb), and Elixir 1.14 (precompiled binary in /usr/share/elixir), and can get anything I need running in a Bash terminal. Again, in a standard QTerminal window,
erl, iex, mix, elixir, etc. all work fine.
In VS Code, however, I get some errors. I feel stupid, but I'm coming from Sublime Text, so please forgive me.
In the left pane of VS Code, ExUnit shows an error (red):
Clicking on this error gives me this, on the bottom right pane. The command line options, passed to mix test, seem to be the default configuration:
This result is bizarre to me, because I can open the integrated terminal, execute /bin/sh, and then run the exact mix test line that's displayed:
/usr/share/elixir/bin has been added to my PATH variable, in ~/.bashrc, ~/.profile, and /etc/environment.
However, I am further confused by all tests being excluded, and wonder if there's some connection to the core issue:
Note that I can run my tests just fine, using different command line options. I've tried adding tags, but that didn't fix the problem.
I tried Google'ing this, and played around with my settings. Here is what I have configured in the "User" settings.json, and I made sure nothing overrides this in "Workspace" settings:
Changing the useNativeTesting setting doesn't solve the problem.
On another (?) note, I get a "failed to run elixir" upon VS Code startup:
Again, I have no problem running commands from a Linux terminal, or from a terminal within VS Code.
Plot twist: If I remove the precompiled Elixir 1.14, and downgrade to an older version, via apt, the problem goes away. But Lubuntu 21.10 doesn't offer Elixir 1.14, and I'm really into using the new dbg() feature.
But for now, I cannot load or run my tests, from within VS Code, apparently because Mix cannot be found.
Thanks to Daniel Imms, from the VS Code team, for answering my question on Twitter:
"Try moving where ever you init mix and elixir (.bashrc?) into your .bash_profile and then logging out and in again or restarting. I'm guessing it's in your bashrc which doesn't run in non-interactive sessions like in tasks."

How to fix pylint "unrecognized-option" error in VS Code?

After an incident I have reinstalled the default Python extension in VS code (for Windows 10) and pylint started to perform in a very strange way for any python file in my project (see an example below):
Pylint obviously works here as lines 4, 5 and 7 are shown as correct ones, while lines 1, 9, 10 and 11 are marked as containing errors.
But the list of these errors looks quite mysterious for me: I can not understand how any pylint option may be unrecognized or bad in a fresh unchanged installation?
Any suggestion how to fix the problem?
Add --disable=E0015 argument to the Python "Pylint Args" configuration.
The issue is in your configuration file or the option used to launch pylint, old-octal-literal does not exists anymore and pylint 2.14.0 started to warn about this kind of thing. See https://github.com/PyCQA/pylint/issues/6794.

How to show all (-Wall) warnings in VSCode

I am using Visual Studio Code with the C/C++ extension. IntelliSense shows some errors but definitely not all of them, I tried settings the following setting:
"C_Cpp.default.compilerArgs": ["${default}", "-Wall"]
But is has no effect. The only thing that's some improvement is adding a build task: when I run it the warnings and errors it generates are displayed inline in VSCode. This workaround is still suboptimal: I need to build to get the errors while I would like to get as soon as I finish typing them (like it already is the case for other errors both in VSCode and other editors I know).
How can I fix this issue ?

bizarre problem in visual studio code with renaming a file (F2) - goes out of edit mode

When I highlight a file and hit F2, the file is normally replaced with an edit box where you can rename it.
After a few seconds, the edit box goes away and you need to quickly type the different file name (every time). I'm not sure what could cause this - any idea?
I'm on Ubuntu 20.04.1 LTS, Visual Studio code 1.52.1
Thanks
This looks like a bug reported in a few issues since v1.52 that all point to this one:
https://github.com/microsoft/vscode/issues/111652
also https://github.com/microsoft/vscode/issues/112555 and https://github.com/microsoft/vscode/issues/112438
It is reported in 111652 as fixed in the Insiders' Build. Can you test it there? I can't reproduce in Stable Build, W10.

Keybindings "value is not accepted" (after the 1.40 update)

I have several entries in my keybindings.json file. Yesterday, shortly after updating to the October VSCode release, I tried adding a few new keybindings through the "Keyboard shortcuts" widget via the Command Palette, but encountered the following error:
I checked for errors in my keybindings.json file (full copy here), and all I have are entries like the one below.
What's strange about this:
I only have warnings, yet VSCode complains about errors
All of these errors are tied to emacs-mcx from this extension (for reference I opened an issue with them here just in case)
With this in mind:
How does VSCode check for values that it can accept? (the warning says "Value is not accepted")
Can I tell VSCode to ignore those problematic entries? (there is no syntax error per se)
If all I have are warnings, why does VSCode complain about errors in the file?
This was apparently a bug that VSCode resolved here after I created an issue tied to this question (coming out in the October recovery release)
This is because the parser needs option allowTrailingComma to be set to true. It was default to true before.
#aeschli Looks like this was added in last milestone and not adopted
in keybindings service.
Patch here