I am working on an application on a remote host. I am trying to use Visual Studio Code for debugging the application and have been asked to 'Create a Project from Existing Code' in Visual Studio. I am using Ubuntu and after bit of digging I realised that I need 'Visual studio IDE' and not 'Visual studio code' if I want some of the features. I want to know if it is possible to Create a project from existing code in VS-code.
I'm an experienced developer but just getting familiar with using VSCode with Java, so I might not have the details correct here. All I can provide is my recent experience and observations. It seems all of this has been consistent for about a year, so this is not new detail that's only been available after the original question and self-accepted answer.
Important: While checking my facts AFTER writing everything here, and double-checking to ensure I properly understood comments and assertions here, I found that @revolution was using C++, not Java. Grrrrr, missed that. OK. The question and applied tags were about VSCode, not tagged as specifically C++. My notes here confirm that VSCode is capable of doing what the OP asked ... This is the correct answer to this question. The OP did not ask specifically about C++. The answer to his question is Yes, VSCode can do that. The answer to the question that he actually wanted to ask "can VSCode do that with C++?" ... I don't know. Sorry. In summary, I hope others stumbling on this thread will benefit from the notes here.
My goal here is to correct some assertions in this thread:
Actually we can create projects and workspaces in VSCode using extensions. Refs: https://code.visualstudio.com/docs/languages/java
https://code.visualstudio.com/docs/java/java-project
https://blog.usejournal.com/visual-studio-code-for-java-the-ultimate-guide-2019-8de7d2b59902
Please excuse the links, there are numerous similar pages, search for "VSCode Java Extensions" if required."
VSCode Projects as discussed here are Java-specific:
To the original question about creating a project from existing code, that's how I stumbled onto this page:
In VSCode, you create a New project from F1 and Create Java Project. I don't think we can integrate a project into an existing folder (yet). What I've done is to create a new project and then manually re-incorporate existing code into it. This is a huge pain, especially with a .git folder, the need to delete/replace the src folder, and the need to manually modify the .classpath XML file with new "lib" details. (I'm guessing someone in the FOSS world is/will be addressing some of that.)
After all of that shuffling is done, be sure to save the new project, save it into a workspace, exit the app and come back in to reload everything. Yes, this does seem to be required, I think because it's required in Eclipse, this environment is using Eclipse code, and that code has details that require a reload after manipulations like this.
Since @revolution was focused on debugging :
VSCode with these Java Extensions does support debugging with breakpoints, watches, step-in/out, and other features similar to Visual Studio. (See refs above.) There is even a Hot option to allow modifying code while stepping through it. Having used VS since it was first introduced I'll confirm VSCode is nowhere near as powerful a debugger, but it gets the job done.
RE: "I am working on an application on a remote host." The VSCode extension does support remote debugging but I have not yet used that advertised feature and cannot comment on its use.
Again, I hope this answer is helpful to someone, if not to the OP who accepted his own incorrect answer.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments