Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose import projects command #746

Merged
merged 2 commits into from
May 20, 2020
Merged

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Dec 15, 2018

@snjeza snjeza changed the title Recognize new maven, gradle, eclipse project(s) after first init [WIP] Recognize new maven, gradle, eclipse project(s) after first init Apr 8, 2019
@snjeza snjeza changed the title [WIP] Recognize new maven, gradle, eclipse project(s) after first init Recognize new maven, gradle, eclipse project(s) after first init Jul 9, 2019
@jdneo
Copy link
Collaborator

jdneo commented Mar 13, 2020

Just an idea come up in my mind: how about prompt users to import if we detect the workspace contains valid project?

Take an example of the C# extension, when user opens a C# project folder, it will pop up a dialog to ask user if he want's to add required assets for build/debug:
Screen Shot 2020-03-13 at 9 49 35 AM

We can do the same thing, the Java Language Server can run in syntax mode by default, if it detects there is any build configuration files, then asks user to import it as a Java project. We can benefit from this experience by:

@snjeza
Copy link
Contributor Author

snjeza commented Mar 13, 2020

Just an idea come up in my mind: how about prompt users to import if we detect the workspace contains valid project?

See f2aa7af#diff-04c6e90faac2675aa89e2176d2eec7d8R132

@fbricon
Copy link
Collaborator

fbricon commented Apr 15, 2020

It doesn't work: If I have a multimodule Maven project, add a new module under the parent project, import doesn't find anything

@fbricon
Copy link
Collaborator

fbricon commented Apr 15, 2020

The succession of merge commits is just a huge mess.
Please rebase against master to have a simple commit.

Signed-off-by: Sheng Chen <sheche@microsoft.com>
@jdneo
Copy link
Collaborator

jdneo commented Apr 16, 2020

@fbricon The commits are rebased, could you please try again?

I tried both multi-module Maven/Gradle, both can detect new sub-module and generate .classpath and .project. The newly added test case also imitates such scenario.

@jdneo
Copy link
Collaborator

jdneo commented Apr 23, 2020

@fbricon If still not working, is it possible to share the project to let me diagnostic?

@fbricon
Copy link
Collaborator

fbricon commented May 18, 2020

I opened an empty folder, then in vscode's terminal, I did gradle init, then tried to import the generated project:

Screen Shot 2020-05-18 at 6 55 54 PM

Copy link
Collaborator

@fbricon fbricon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import command should activate vscode-java

package.json Outdated
@@ -553,6 +553,11 @@
"title": "Update project configuration",
"category": "Java"
},
{
"command": "java.project.import",
"title": "Import Java projects in workspacce",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workspace

Signed-off-by: Sheng Chen <sheche@microsoft.com>
@fbricon
Copy link
Collaborator

fbricon commented May 19, 2020

So this time, when calling the command, the extension activated, importing the project as part of the server startup, but ended up failing:
Screen Shot 2020-05-19 at 3 00 12 PM

@fbricon
Copy link
Collaborator

fbricon commented May 19, 2020

I keep calling the import new project command, now the server is started, but still see the "No delegateCommandHandler for java.project.import" error

@fbricon
Copy link
Collaborator

fbricon commented May 19, 2020

Sorry, looks like a PEBCAK. I didn't rebuild the proper server branch

@fbricon fbricon merged commit 87c79e5 into redhat-developer:master May 20, 2020
@fbricon fbricon changed the title Recognize new maven, gradle, eclipse project(s) after first init Expose import projects command May 20, 2020
@fbricon fbricon added this to the Mid May 2020 milestone May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants