vscode linters underlines entire class - visual-studio-code

I'm using vscode in two different environments - a cloud based VM (using remote-ssh) and a docker container (using remote-container).
I have pylint set up on both.
For some reason, when the linter finds and issue on the VM it underlines the entire scope of that issue. For example if I have a class with an issue, the entire class would be underlined.
On the docker environment however only the first letter of the class is underlined. This is much better.
I tried to understand where the difference comes from... went through the settings.json file of both environments and both workspaces but I can't seem to find any difference.
Anyone have any idea what setting affects this?
In the image below, the top code is from the VM, the bottom is from the docker

There's an open issue in pylint regarding this : https://github.com/PyCQA/pylint/issues/5466. It's scheduled to be in 2.13.0. Downgrading to 2.12.1 solve the issue but also remove other end of line end of column information introduced in https://github.com/PyCQA/pylint/issues/5336

downgrading from pylint==2.12.2 to pylint==2.12.1 seems to have solved the issue

Related

Strange source command when start Julia REPL

I am a bit fresh to Julia (and stack overflow), so it might be a dummy question. I am using VS code in ubuntu 18.04.
Every time I start Julia REPL from VS code (Ctrl+shift+P, then "Julia: Start REPL"), the Julia REPL starts with a strange command "source /home/$user_name/bin/activate" and then an error (of course source is not defined in Julia) :
ERROR: UndefVarError: source not defined
Stacktrace:
[1] top-level scope
# REPL[1]:1
This problem was shown a couple of weeks ago but it does not affect my code at least for now. I have tried to search the problem but haven't found any similar questions. Any hints on what's going on? Many thanks!
Edit:
I think I might have used Conda somewhere.
Do "which Julia", I got:
/home/$user_name/julia-1.7.2/bin//julia
There is no "/home/$user_name/.julia/config/startup.jl" file, all the directories under "/home/$user_name/.julia/" are as follow:
artifacts compiled dev logs prefs scratchspaces
clones conda environments packages registries
Then I found a "startup.jl" file under "$JULIA_INSTALL_FOLDER\etc\julia\startup.jl", with following content (seems like not helping on my problem).
# This file should contain site-specific commands to be executed on Julia startup;
# Users may store their own personal commands in `~/.julia/config/startup.jl`.
Solved by following #SundarR's suggestion.
The problem was caused by the VSCode-Python extension installed.
Please see the comment above for the details and thanks again!

vscode extension: deprecation warning `Buffer()`, how to diagnose

I am rebuilding my comment highlighter in to a new extension.
However I now run now in to an issue where I get the following warning:
(node:4904) [DEP0005] DeprecationWarning:
Buffer() is deprecated due to security and usability issues.
Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
So far I can find in my extension I never use the function Buffer()
I think that it comes from the vscode module.
When the warning occurs block comment highlighting stops working.
This issue is breaking for my extension in development mode.
However my old extension has the same issue in development mode and released version.
Only in the released version doesn't report of the warning.
I am sorry for not including a minimal, reproducible example.
UPDATE:
In the latest release of my comment highlighter I have fixed block comment highlighting. At least I have fixed what was broken on my end.
The (node:4904) [DEP0005] DeprecationWarning keeps breaking my extension on rare occasions, this happens in all my environments.
Restarting vscode or rebooting the operating system can sometimes fix it. I have noticed that other extensions break as well when my extension is broken.
Operating systems I run:
Windows 10
Ubuntu 20 LTS
On both OSes I run nvm to manage node and npm versions.
I currently have 2 computers both dual booted with the named OSes
The issue occurs on both computers.
Here are the steps I used to help diagnose what is causing that Buffer deprecation warning.
Uninstall your extension. You may have to reload vscode after this.
Terminal: export NODE_OPTIONS=--throw-deprecation
Terminal: code-insiders --install-extension arturodent.find-and-transform
(or code --install-extension arturodent.find-and-transform if not on Insiders)
(replace with your extension id found in the package.json)
That should re-install the extension with a stack trace about the deprecation warning.
Obviously, if your extension directly used new Buffer() you can fix it.
If you imported/required an extension that uses new Buffer() you have a couple of options: look for an alternative, fork it or file an issue with that repository.
In my case, neither of the above was the issue. You can see that fd-slicer is the problem. And that is a dependency of yauzl. yauzl is used by vscode itself, not by me or by my extension's dependencies.
There are issues filed on fd-slicer (maintainer has no interest in fixing this, PR to fix) and on yauzl urging to switch to a forked fd-slicer2 which hasn't been merged yet (PR to fix - consider upvoting). And on vscode: buffer warning, yauzl.
My node version: v15.9.0
For me, this Buffer warning is currently an irritant only, and does not affect the functionality of my extension fortunately.
I encountered a somewhat similar incident while trying to create my first extension. So launching the Command Palette - Ctrl + Shift + P and selecting >Developer: Reload Window helped.
I hope you have been able to successfully overcome this issue as I have not seen many answers in online forums relating to this type of warning. VS Code is having trouble referencing your node module as you may have either and outdated version of node or double installation causing broken symlinks. This is usually fixed by uninstalling and reinstalling node using brew a couple of times then unlinking and relinking node once the broken symlinks are gone. The following video helps to explain just how to do this.
https://www.youtube.com/watch?v=DAnf4XUUjkg
After that simply restart your IDE and try launching VS code again! Hope this helps.

Duplicate hints while typing expression in Visual Studio Code

Why do I have the same suggestions while typing expression?
Example:
I had exactly the same problem. After a week or so, it get really annoying.
basically, as the comments hint to, there are probably multiple linting or intelisense tools. In my case (for python) i had the pylance extension added.
When i disabled this, the problem went away, but features were missing. So i added it back...
For some reason (i dont know why), this fixed the problem !!!
I can only hypothesise that in some way the extension was corrupted. Nevertheless, it worked.
EDIT:
I can also confirm that unchecking this setting appears to work:
Jupyter: Pylance Handles Notebooks
My current system is Windows 11, with python 3.10.
Final edit (8 Dec 2022):
This is resolved here:
Please could you install VS Code 1.74 and the latest Jupyter, PyLance and Python extension and confirm this still exists.
Visual Studio Code provides an API so third-party extensions and built-in modules can contribute suggestions for auto-completion pop-ups. The system is currently designed so suggestions are merely appended—there's no duplicate detection or removal (perhaps because extensions can also take care of sorting suggestions and such algorithm would get on the way). That means that if you have more than one extension or module for a given language you can easily get duplicate entries.
Having several extensions for PHP is not necessarily a bad idea since they can address different needs (for instance, PHP DocBlocker just creates annotations, it doesn't provide auto-completion suggestions) but you have at least two extensions (PHP Intelephense and PHP Intellisense) that do exactly the same things. That's likely to hurt performance (all your workspace files will be scanned several times) and just adds noise.
I suggest you read the extension descriptions carefully to learn what they do exactly and then figure out which ones you need. Remember that extensions can be enabled/disabled in a per-workspace basis.
The following is just my own totally subjective opinion. Among the PHP extensions that provide code intelligence only two of them seem mature enough:
PHP Intelephense
PHP Intellisense
I've tried both. PHP Intelephense works best for me than PHP Intellisense so that's the one I've kept. I've also disabled php.suggest.basic following the installation instructions because basic suggestions didn't add any value to me (they were blind string matching):
Turn off the php.suggest.basic setting for best results.
... as well as taming builtin Emmet support, which was providing really dumb suggestions:
"emmet.showExpandedAbbreviation": "inMarkupAndStylesheetFilesOnly"
YMMV.
TLDR; Installing pre-release version of Jupyter solves (v2022.11...)
Ok, so after some more extensive experimentation I think I found what's causing this in my case. After looking at the processes I noticed that there were two Pylance processes running, and consistently this would only be a problem if I was working in a session with a jupyter notebook open or one that had been opened.
saun89 17740 37.3 0.3 1008004 199492 ? Sl 20:58 0:22 /home/saun89/.vscode-server-insiders/bin/fef85ea792f6627c83024d1df726ca729d8c9cb3/node /home/saun89/.vscode-server-insiders/extensions/ms-python.vscode-pylance-2022.11.32/dist/server.bundle.js --cancellationReceive=file:9178e897a2b78b36bfd167f79b36c3bdad2931d71b --node-ipc --clientProcessId=17651
saun89 18743 257 0.7 1304584 382288 ? Sl 20:59 0:20 /home/saun89/.vscode-server-insiders/bin/fef85ea792f6627c83024d1df726ca729d8c9cb3/node /home/saun89/.vscode-server-insiders/extensions/ms-python.vscode-pylance-2022.11.32/dist/server.bundle.js --cancellationReceive=file:8744a321767eed92821fd737be4dc7dcfb728284e5 --node-ipc --clientProcessId=17651
Pylance basically spins up a service for the workspace, and then spins up a separate service for the notebook.
Output from "Python Language Server" logs:
Disabling Jupyter removes the duplication, and after installing an earlier version of the extension (v2022.4) this appears to have fully resolved the issue. I'm going to go ahead and log the extension bug once I have something reproducible.
As of 11/30/22, Jupyter Extension Pre-Release version v2022.11.1003281132 is the latest version fixes this issue. Click the gear icon next to the extension and you should see "install another version..." Then you can select version v2022.11.1003281132.

Netbeans 8.2 : Scrollbar not following cursor

So i updated from Netbeans 8.0.2 to 8.2 and now i have this very annoying bug : when i move the cursor down, the scrollbar won't auto scroll, so the cursor simply disappears ! I need to manually scroll to get the cursor visible again.
I'm on Mac Os 10.13.4. Anyone had this bug and could fix it ? Otherwise i'll have downgrade to get my things done properly again.
Thanks !
I don't know about MacOS but I have noticed that behavior on Linux too. It happens every time I type an accented character (e.g. á, é).
The solution I've found is adding env XMODIFIERS="" to the beginning of the command line in the .desktop file (the default is XMODIFIERS=#im=ibus on Ubuntu 20.04). Or simply starting it from the command line as XMODIFIERS="" netbeans
I'm posting this a little late because it's becoming increasingly difficult to find old versions of NetBeans after they moved from Oracle to Apache. So if you are stuck with a specific version and can't downgrade/upgrade, this answer might be helpful.
I checked NetBeans bugs and don't see an exact match for your problem, but there are plenty of similar ones. Note that bugs marked as RESOLVED haven't necessarily been applied to the released version of 8.2.
However, you could use a DEV version of NetBeans that would have the fixes applied, and as an added bonus you could also use JDK9 which you can't do on 8.2. That approach might be preferable to downgrading. Also note that the DEV version of NB could run concurrently with 8.2.

Pylint in Sublime Text 2

So, I've been using Sublime for a while as a simple text editor, but I'm venturing into the land of plugins for work and I've run into an issue getting pylint to work. Specifically I have it installed and have the Sublime package manager working, but I'm not sure how to include paths in my sublime settings.
I haven't found very useful documentation on this point, but if you are willing to point me towards it that would be a perfectly acceptable answer. My basic issue is that currently every time I save a file, the following error message shows up:
"Please define the full path to 'lint.py' in the settings"
I understand this error message which is great, I just have no idea where the sublime settings are or what the standard format for defining a path is. Any help would be appreciated.
There are quite complete directions at the SublimeLinter GitHub page that should describe how to set everything up. Briefly, go to Preferences->Package Settings->SublimeLinter->Settings - Default to see where the different settings are defined. Then, open Preferences->Package Settings->SublimeLinter->Settings - User to change anything, as the main settings will be overwritten when the package is updated. Remember that settings files are in JSON format, so you'll need opening and closing curly brackets to enclose settings, and a comma between them:
{
"sublimelinter_delay": 30,
"sublimelinter_mark_style": "none"
}
I haven't gotten the error you have, are you sure you're using the regular SublimeLinter and not the new beta version? I just installed it fresh on my work machine (I've been using it for a while at home) and after restarting ST2 it's working like a charm with Python.
I had the same problem. I found it to be coming from the package "Pylinter". I removed Pylinter and added SublimeLinter, it covers more than python and is well used. I'm enjoying it quite a bit.
From your command line just run:
sudo easy_install pylint
sudo easy_install pep8
After that restart your sublime.
I encounter the same situation today. In my case, that is because I have not installed the 'pylint' in my system yet. It works fine after I installed the 'pylint' through pip.
Just for other people reference.