Duplicate hints while typing expression in Visual Studio Code - 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.

Related

Can't Find certain extensions in CODE-OSS(Open source variant of Visual Studio Code)

I have been using Code-OSS in manjaro linux for some months now and this is the first time I am encountering this. (After I reinstalled manjaro) When I search for e.g, Java Extension Pack or Intellisense I don't get any result in the extension marketplace. I don't know if it's the problem of my setup or everyone is experiencing this. If you know of a solution please tell me.
Thanks in advance
This can be fixed by adding following to product.json:
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items"
}
This can also be fixed by copying product.json from an official build (in the .zip archvie, product.json is under /usr/share/code/resources/app/product.json which contains above lines). Depending on your distribution, exact location may vary.
More information: https://github.com/Microsoft/vscode/issues/1557
As an alternative to manually editing product.json or building whole visual-studio-code-bin from AUR you can use different AUR package - code-marketplace - that patches product.json from Code OSS package (code)
Thank you #Clay for responding. I saw that post prior to me posting this question. Those bits of json code were already in my product.json file but still I was not able to get the extensions. Then I built the VISUAL STUDIO CODE (visual-studio-code-bin) from AUR and now its working normally as expected. I don't know what's the reason behind this,but that's how I fixed it.
Also if someone is reading this and wanna know about the different variants of VSCode then here is the archWiki page for VSCode.
For anyone using the lscr.io/linuxserver/code-server docker container like me, the .json is located at /app/code-server/lib/vscode/product.json.
I've encountered this using OSS Code on Manjaro as well, trying to install the Azure Resource Manager Tools extension. Not sure if this was an option when this question was posted, but you can download the extension (.vsix) file if possible, then bring up 'quick open' in OSS Code using Ctrl+Shift+P, search for "VSIX" and choose "Extensions: install from VSIX" to locate and install the downloaded .vsix file.
After this, the extension was installed and usable in OSS Code, and is also configurable in the extension manager panel.

Not able to download language packs for extensions other than core extensions

I have two different TYPO3 9.5.20 installations.
The problem is: In one of both I'm not able to download the German language packages, while on the other it works fine. Both seem to have the same configuration and folder structure.
The not-working installation is telling me 1 language pack not available while trying to download for a single extension.
I tried disabling all non-core extensions except for the ones I want to download the language packages, but that didn't help either.
I was able to download translations for the core-extensions, but all others don't seem to work.
Any ideas where I could look for the problem and compare the two installations or what could cause the problem?
The problem was the enabled feauture newTranslationServer in my LocalConfiguration.php.
This caused TYPO3 to use the translationBaseUrl https://localize.typo3.org/xliff/ instead of https://extensions.typo3.org/fileadmin/l10n/ what resulted in a 404 for all non-core extensions.
I don't know how the configuration got there, but it wasn't on purpose so I disabled it. Maybe this can help someone else.

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.

Team foundation server on the Mac with Vim

I'm using Vim on a Mac for front-end development and was recently hired at the company that uses Team Foundation Server as their version control system.
I would hate to have to switch to using Visual Studio on Windows because I'm so used to Vim and the Mac.
I found this and was hoping that would be a possible solution. I would still like to avoid editing code in Eclipse. However I wouldn't mind opening Eclipse to do version control stuff.
I'm very unfamiliar with Eclipse and Team Foundation Server (not VCS in general) and I need some advice on how to actually use it.
I'm able to connect to the server and find the project I have to work on, but from here I'm lost. This is the window I'm stuck at.
Anyone who are in a similar situation and could offer some help?
You've done the hard bit I think, firstly you should be able to safely ignore the Work Item and Build "folders" unless someone explicity tells you to use work items, at which point they can show you what you need to know as it works exactly the same as in Visual Studio.
If you double click on the Source Control folder it will open a new window which will show you the source "tree". To be able to Get, Checkout and add source files to the tree you'll need to set up a workspace. Once you've done this then you can get the code and check out.
With Team Explorer Everywhere You also have the option of using the tf command line in the Mac terminal. This would eliminate the need for eclipse. (I'm assuming that as a Vim user you're not afraid to use the terminal)
Another option might be svnBridge however I think you need the server version if you're using a Mac, and this requires a site to be installed in the TFS application server which might not be an option.
Finally TFS now offers support for integration with GIT.

Builtin functions and values being tagged as undefined

False, isinstance, list, int, setattr, range, and many others are being tagged as undefined. I"m running Aptana Studio 3 version 3.2.
I have run both of the interpreter updates:
- Window / Preferences / Interpreter - Python / Apply
- Properties / PyDev - PYTHONPATH / Apply
cleared error markers, etc. Nothing seems to work.
...Thanks,
...Ken
I am curious as to what happened, but my patience gave way to irritation, so I re-installed from scratch and all is well. I'm guessing the latest update from Aptana ate something that disagreed with it, but it's hard to tell. I did save the previous install in case someone has an idea for me to test.
Usually this means that PyDev was not able to create a shell/sockets to the shell (usually meaning you either have some firewall enabled blocking the communication or you have a misconfiguration in your pythonpath).
So, it'd be nice if you could share if you have something in your error log in that old installation -- but if it's all working on your new, I'm not sure it's worth the time :)
Also related: http://pydev.org/faq.html#PyDevFAQ-WhenIdoacodecompletion%2CPyDevhangs%2CwhatcanIdo%3F
I had this same problem and switched to pycharm. It's wonderful!