Is there a VSCode configuration variable for the bundled extensions folder? - visual-studio-code

I'm authoring an extension and running it in the debugger, which is mostly working smoothly.
But I'd like to disable debugging other extensions while I'm debugging mine.
I've been able to disable debugging for installed extensions using this, in my launch.json:
skipFiles: [
"${env:HOME}/.vscode/extensions/**"
]
(Incidentally, I don't know whether that's the right location on Windows -- it might be -- but I'm on macOS. It's probably correct for Linux also.)
But I can't seem to disable it for bundled extensions without hard-coding my VSCode installation location:
skipFiles: [
// Below does not work for some reason
"${execPath}/../../Resources/app/extensions/**",
// Below works if we have correctly guessed the install location
"${env:HOME}/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/**"
]
I dumped the VSCode environment and I have a bunch of variables that look fairly unreliable, like VSCODE_GIT_ASKPASS_MAIN, that basically lead me to the same problem. I'm not sure why the execPath variable above doesn't work, but even if it did, it'd be macOS-specific. My other solution requires me to guess the install location (which I guess I could try to do with versions for Windows / macOS / Linux and dealing with common installation locations for those, but even this would not be foolproof).
Is there another, more directly applicable configuration variable I could use for this purpose? My question is similar to this one, but in that one the need was to access an extension's own path from its implementation; mine is from the launch.json configuration file (and I want the path for all extensions, not my extension).

Related

how to install tabnine manually without ethernet (vs code extension)

Trying to install tabnine vs code extension from a pc with ethernet to a desktop without ethernet access.
I tried to manually install the extension by copying its files from .vscode/extensions folder.
after doing so I received this error:
"tabnine extension was unable to download its dependencies"
any ideas how to solve it?
While this is more a case-by-case question (as many extensions have special dependencies), I am trying to offer some background information for you reference.
Why an extension needs separate downloads
Many reasons but typical ones are,
Make the main downloads from VS Code Marketplace small
Host OS dependent dependencies (language server/debugger or others) externally so that at runtime the extension downloads only for a specific OS.
Many extensions can utilize the new platform specific packaging mode of vsce, but not for old extensions out of maintenance.
Is there a common way for extension authors to specify such separate downloads?
No. VS Code does not have a standard here, so extension authors can do whatever they like.
Tabnine specific
Now back to your question. To learn what tabnine extension wants to download and where on disk those files should be put, your only option is to ask its developer(s) or dig into the source code.
Side Notes
I did internalize many similar extensions for my clients under the product Scarborough for VS Code, so I would like to kindly inform you that many extensions were never designed to work in an environment without internet access. So you might need more hacking than you initially thought.
may be have a problem with your IP location only using vpn and reload

develop and debug multiple VSCode extensions at once

I am currently developing some custom VSCode extensions and would like to have separate optional extensions that build on a core extension. Currently it is a bit of a hassle to develop these congruently and I am currently aware of the following options:
1) Develop the extensions separately with separate debug instances
The downside here is that until the extensions is published or moved to your ~/.vscode/extensions folder the two extensions have no knowledge of the development versions of each other, making the debugging and rapid additions quite difficult.
2) Move extensions into ~/.vscode/extensions folder
The downside with this is that there is constant window reloading, sometimes it can be tricky to know when the main process has fully loaded the updated version and it has definitely been less convenient than the experience when developing one extension
3) Merge the two extensions into one extension
This makes debugging and rapid feature builds easier, but goes against some of the original modularization i was hoping for, so i haven't switch to this as of yet.
My question is, is there a better way people have found to accomplish this apart from the above 3 options i'm aware of? I've combed quite a bit through google, forums, and the vscode docs looking for options or other people hitting the same situation but haven't found anything as of yet.
From the VSCode docs, it appears that --extensionDevelopmentPath "might" support multiple paths somehow, but i have yet to find anything conclusive or with examples of that to get it to work.
One method that I have used is to pull in the 'core' extension in as a submodule into a subdirectory, for example, .dependencies. Remember to npm install the 'core' extension from within its directory.
Then I would adjust your package.json on the working extension to use the following scripts:
"scripts": {
...truncated for brevity...
"compile:core": "tsc -p .dependencies/{dep-folder}"
"compile:me": "tsc -p ./"
"compile": "npm run compile:core && npm run compile:me"
...truncated for brevity...
}
Finally, add the following to your launch.json which will override VSCode's default extension folder to your .dependencies folder.
"args": [
"--extensions-dir=${workspaceFolder}/.dependencies"
"--extensionDevelopmentPath=${workspaceFolder}"
]

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.

How can you launch VSCode with multiple extensionDevelopmentPath sources?

I'm trying to test local changes of omnisharp-vscode in conjunction with my own local extension. I can't for the life of me figure out how to boot the VSCode experimental instance with more than 1 extension.
I've tried:
Providing multiple extensionDevelopmentPath arguments when booting
vscode
Running omnisharp-vscode and then opening and running my other extension in the experimental instance.
None of the above have worked for me.
The easiest solution would probably be to simply move one (or both) extensions into your .vscode/extensions directory. This might require you to remove the marketplace installs of those extensions if present. Even though "development installations" of extensions like this are not officially supported yet, they work just fine regardless.

something wrong with environment variables, won't build: using Netbeans writing C/C++

there's definitely something wrong with setting up my environment variables.
I had messed around with it when I was trying to do an android app.
now i'm trying to set up netbeans, but it won't build.
when I first tried to build, tool selection came out, and it had looked for cygwin bin files in D: instead of C:, so I manually browsed for each file.
i found g++ make etc. however, I couldn't find gfortran.exe.
now, a message says that it can't find shell, and asks me to install cygwin.
this is what i have in my path:
D:\DAC driver and stuff\;%JAVA_HOME%\bin;
D:\matlab\MATLAB\runtime\win64;
D:\matlab\MATLAB\bin;C:\cygwin64\bin
and yes, cygwin is in C:\cygwin64
this is a picture of everything i have in my environment variables:
http://i567.photobucket.com/albums/ss114/samio_130/cake/pictwoo.png
edit: i think i deleted something from 'path'! should there be something infront of what i currently have??
%JAVA_HOME%\bin is no legit. Everything after it doesn't count, fix is in link.
http://forums.netbeans.org/viewtopic.php?p=151733#151733