Skip to content

feat: Support new file contribution - #533

Merged
Sheng Chen (jdneo) merged 3 commits into
mainfrom
cs/newFile
Aug 20, 2021
Merged

Sheng Chen (jdneo) merged 3 commits into
mainfrom
cs/newFile

Conversation

@jdneo

@jdneo Sheng Chen (jdneo) commented Aug 10, 2021 •

Copy link
Copy Markdown
Member
  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

@Eskibear

Copy link
Copy Markdown
Member

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

@jdneo

Copy link
Copy Markdown
Member Author

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.

@jdneo

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Member

why Linux-UI failed, is it unstable?

@jdneo

Copy link
Copy Markdown
Member Author

Yes it's unstable

@jdneo
Sheng Chen (jdneo) merged commit f25fdfe into main Aug 20, 2021
@jdneo
Sheng Chen (jdneo) deleted the cs/newFile branch August 20, 2021 02:58
@jdneo

Copy link
Copy Markdown
Member Author

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