File Utils plugin - command 'fileutils.duplicateFile' not found - visual-studio-code

I am using FIle Utils plugin (https://marketplace.visualstudio.com/items?itemName=sleistner.vscode-fileutils) for Visual Studio Code.
When I try to >File Duplicate, Visual Code says "command 'fileutils.duplicateFile' not found".
I uninstall the plugin then re-install it, does not work.
I closed Visual Code, restarted mac, clear Visual Clear Editor History.
I still can not use the plugin to duplicate file or rename file.

Update VSCode to the latest version will fix the issue. I posted in File Utils github issue

For me following worked
Uninstall extension
Close VSCode
Open VSCode and install extension
Should start working

Related

VSCode: Attempted to update project that is not loaded

I am using VSC for Unity v2019.4. I have the package from package manager installed. Also I have installed dotnet. The thing is that when I open VSC (through Unity) it shows in the output:
Attempted to update project that is not loaded: C:\workspaces\Unity\MyGame\Assembly-CSharp.csproj.
am able to use the editor, but the Intellisense is not working. I also have tried to change the omnisharp version to latest and it is still not working.
You can try a few things in order to make Visual Studio Code works properly with Unity.
First of all make sure that the editor package is installed in your project via Package Manager. Latest version should be installed.
Just to be sure it's better to close the project, delete Library folder and all .csproj and .sln files.
Then you can open your project in Unity again, wait it to load and try to remember to open scripts not by double clicking, but instead use right click in Project window and select Open C# Project. This will load the scripts without any issues.
In case anyone is still having this problem, try to install .net framework 4.7.1
Try uninstalling then reinstalling vs code and dotnet latest version. Also make sure vs code is installed in a folder with permissions to edit. If not it will not save any files until you run as admin

How to fix vsce not packaging code changes into .vsix file

I'm developing an extension in vscode, and using vsce to package it into a .vsix file.
I noticed a typo in my description in my extension's package.json, noticeable when the extension is installed and loaded in the extension tab. So I fixed it and re-ran vsce package in ~/extension_name/client/ and re-installed the extension, but the typo remains.
I've double checked I'm not installing the wrong .vsix file. I've ran npm install in ~/extension_name/client/. I've even committed my changes to a branch in git, downloaded that branch and packaged it, no luck.
Do I need to run another command to get vsce to realise there are changes to include? How can I determine what version of the code vsce is packaging up?
I've had the same issue in the past, where I repackaged an extension with the same version and it didn't get installed properly.
VSCode installs extensions to ~/.vscode/extensions, so you can inspect the code in your extension's directory there. I think VSCode is just failing to overwrite the existing extension there, so try deleting the extension within that folder and then installing the .vsix again.
To see the contents of the .vsix file, you can change the file extension to .zip. (See https://blogs.msdn.microsoft.com/quanto/2009/05/26/what-is-a-vsix/)
For VSCode extensions, there should be an 'extension' folder inside it which has all of your code.

How can I fix "build failed, do you want to continue"? In Visual Studio Code

I got an error when trying to debug Java code in Visual Studio Code.
The error is below
build failed, do you want to continue?
I have tried clearing the workspace, but it doesn't work. How can I fix this issue?
The problem was solved.
I resolved this issue by clearing the workspace cache in Visual Studio Code. Here is a link to the relevant page: Visual Studio Code Clean Workspace Directory. I had renamed a number of folders, class names and packages.
Apparently the Red Hat Developer plugin managed to get out of sync. The .classpath file was out of sync with the POM file. Wiping out the workspace cache caused the plugin to recreate project data from the Maven specification. The problem was solved. I am not sure, but if anyone from the Red Hat project reads this, it looks to me like a bug, or deficiency. In any event it can be worked around.
Original answer:
I think Liu Bei was not clear enough. I am experiencing the same issue. I have a project that builds perfectly in Maven and when I launch the debugger in Visual Studio Code this notification appears in the lower right-hand corner of the Visual Studio Code window.
Obviously the "Debugger for Java" extension thinks there is a build problem. However there are no errors reported in the PROBLEMS, OUTPUT, DEBUG CONSOLE or TERMINAL tabs.
The project builds, and packages in Maven just fine and it can be debugged in attach mode which is tedious at best.
There is something going on in Visual Studio Code that's not being reported anywhere that I can find. I suspect the RedHat Visual Studio Code plugin for Java is in the mix, but I need help figuring out how to work around the issue.
I have to say that we are spending way too much time resolving issues with tools and dependencies and not enough time on the app. The project we are working on is intended for open source distribution. The Spring Framework seems ideal for our purposes, but the tooling, not so much. We are not very far into the project and I am already receiving pressure to switch to ASP.NET Core.
I really need a little help...
This didn't work for me, but I found out what did.
First of all, looking at the Java Dependencies plugin gave me a hint that something was out of sync. The name of my application (artifact) did not match the name in the Java Dependencies tree view.
This was fixed by clearing the Visual Studio Code workspaceStorage folder completely!
This folder was in my case located in (Windows 10):
C:\Users\<myuser>\AppData\Roaming\Code\User\workspaceStorage
If you can't find it at this location, simply search for the folder workspaceStorage.
Next press Ctrl + Shift + P (in my case) to open the Visual Studio Code action prompt. Then choose the command:
Java: Open Java Language Server Log File
This will open a log file which is normally not displayed when building your Java code, and will tell you exactly what went wrong with the build.
In my case it was a conflict as I had two AppConfig.java files, one in main and one in test. Maven handles this fine, but apparently the Visual Studio Code Java builder does not.
Obviously these are bugs in the plugins which I will report to the GitHub contributors, but for now we will have to live with a little manual work.
Still I hope this helps all of you frustrated Visual Studio Code Java developers out there.
It worked for me to change the user setting in file setting.json to "java.debug.settings.forceBuildBeforeLaunch": false in Visual Studio Code, which will disable the check before run/debug.
Build failed error in Visual Studio Code
This error occurs because in your workspace folder the other source code has some errors in it.
So create a new folder and make it as a workspace folder and then write your codes in that folder and run it.
I had that error also and it worked for me, so check for yours.
Using OS X, I managed to overcome this problem. You can either access it from your Terminal or simply use a
shortcut (Command + Shift + C).
Select Base System and Library. Look for the Java folder and click on the Java Virtual Machines folder.
Check if is there the actual version of JDK (most up to date). I've noticed that I had two JDK folders one probably inherited from a previously installation and the most up-to-date Java 15. I dragged 'jdk-14' to the waste bin. Enter password, close finder and restart Visual Studio Code.
It works fine now!
For me, the problem was that I created a folder within a folder for arranging my Java program files with the reference to data structures. In the log file, it was showing that the .java file in the inner folder was not on its project's build path.
Just after deleting that folder and completely deleting all the files in the workspace folder manually in the location C:\Users<myuser>\AppData\Roaming\Code\User\workspaceStorage, this problem was solved!
I fixed this problem by doing the following steps:
Step 1: Opening Visual Studio Code settings (bottom left) https://i.stack.imgur.com/xPlkj.png
Step 2: Searching "Java debug" and selecting Java Debugger under Extensions https://i.stack.imgur.com/797M3.png
Step 3: Find Force Build Before Launch and uncheck it https://i.stack.imgur.com/igtRa.png
And you're done!
First of all, check carefully the errors on Visual Studio Code log and try to not get biased by the community common errors. To do this, press Ctrl + Shift + P to open the Visual Studio Code action prompt. Then choose the command:
Java: Open Java Language Server Log File
By doing this you can find the exact exception that is happening. In my case, I had two exceptions:
java.lang.NoClassDefFoundError: javax/annotation/processing/AbstractProcessor
And
java.lang.NoClassDefFoundError: com.demo.myapplication
So, I was biased to think that error was related to the Java version or stuff like that, but it was related to a Lombok extension installed in Visual Studio Code.
In the end, I found this thread and tested this solution and it worked like a charm.
Here is the solution explained by him:
Finally I got it working. The issue is with the additional argument -Xbootclasspath added by the Lombok extension to the java.jdt.ls.vmargs. I figured it out by integrating the Lombok with eclipse and opened the eclipse.ini file for the changes.
I uninstalled the vscode-lombok extension;
I downloaded the lombok.jar (version 1.18.6) file from https://projectlombok.org/download;
In Visual Studio Code, in settings.json, for java.jdt.ls.vmargs key, I added the argument
-javaagent:"PATH_TO_DOWNLOADED_LOMBOK_JAR_FILE"
A last necessary step (missed by the GitHub guy) is to reinstall the Lombok extension.
I had the same problem.
I just downloaded this provided for Visual Studio Code,
Extension Pack for Java.
Click on the link, download and open it. It will automatically configure Visual Studio Code for Java.

No ESLint configuration found for Visual Studio Code

I have installed the ESLint plugin for Visual Studio Code editor and it shows that it is installed also but still I see the error: No ESLint configuration found for Visual Studio Code at the top of the editor window as shown in the screenshot below:
Can anyone help me to know is there anything that I am missing here.
You are missing .eslintrc.* file. Which can be in different format js, json, yaml... There are two available methods to create configuration file
Manually, just create file and add rules
use init command $ ./node_modules/.bin/eslint --init or eslint --init if you have ESLint installed globally. Then follow instructions and after edit created file to your liking.
More info:
http://eslint.org/docs/user-guide/configuring
https://github.com/eslint/eslint

Cannot open solution file in Visual Studio Code

I have installed the Visual Studio Code on Windows. When I try to open a solution file in VS Code it opens the solution file, instead of opening all projects in solution. Is there a way to open existing project solutions in VS Code?
When you open a folder in VSCode, it will automatically scan the folder for typical project artifacts like project.json or solution files. From the status bar in the lower left side you can switch between solutions and projects.
Use vscode-solution-explorer extension:
This extension adds a Visual Studio Solution File explorer panel in Visual Studio Code. Now you can navigate into your solution following the original Visual Studio structure.
https://github.com/fernandoescolar/vscode-solution-explorer
Thanks #fernandoescolar
VSCode is a code editor, not a full IDE. Think of VSCode as a notepad on steroids with IntelliSense code completion, richer semantic code understanding of multiple languages, code refactoring, including navigation, keyboard support with customizable bindings, syntax highlighting, bracket matching, auto indentation, and snippets.
It's not meant to replace Visual Studio, but making "Visual Studio" part of the name in VSCode will of course confuse some people at first.
But you can open the folder with the .SLN in to edit the code in the project, which will detect the .SLN to select the library that provides Intellisense.
In the VSCode Marketplace look up and install vscode-solution-explorer