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

feat: Support new file contribution #533

Merged
merged 3 commits into from
Aug 20, 2021
Merged

feat: Support new file contribution #533

merged 3 commits into from
Aug 20, 2021

Conversation

jdneo
Copy link
Member

@jdneo jdneo commented Aug 10, 2021

  1. If there is a active text editor and it's uri belongs to a workspace folder, then generate a new class at the same folder
  2. Otherwise, ask user to select target project (if multiple) and package
  3. If no project is opened, ask user to create a new project

resolve microsoft/vscode-java-pack#706

@jdneo jdneo added the enhancement New feature or request label Aug 10, 2021
@jdneo jdneo added this to the 0.18.7 milestone Aug 10, 2021
@Eskibear
Copy link
Member

LGTM, and suggest to support full qualified class name in future?

@jdneo
Copy link
Member Author

jdneo commented Aug 12, 2021

Change the logic to:

  1. If current active editor is on the project source path, create a file under the directory of the active editor
  2. Otherwise, create an untitled file with a simple new Java class snippet.

Eskibear
Eskibear previously approved these changes Aug 12, 2021
@jdneo
Copy link
Member Author

jdneo commented Aug 12, 2021

Appended a commit. Now if there is no active text editor but having one source path, the source path will be returned as the package path. This is useful in invisible projects.

@Eskibear
Copy link
Member

why Linux-UI failed, is it unstable?

@jdneo
Copy link
Member Author

jdneo commented Aug 13, 2021

Yes it's unstable

@jdneo jdneo merged commit f25fdfe into main Aug 20, 2021
@jdneo jdneo deleted the cs/newFile branch August 20, 2021 02:58
@jdneo
Copy link
Member Author

jdneo commented Aug 24, 2021

We might need to revisit this feature once we can get the selected file path from the file explorer. See: microsoft/vscode#3553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: "create new file" could be more intuitive and convenient
2 participants