Skip to content

Add Java Method Sorter VS Code extension#2

Merged
unknowIfGuestInDream merged 6 commits into
masterfrom
copilot/add-java-code-sorting-plugin
Jan 10, 2026
Merged

Add Java Method Sorter VS Code extension#2
unknowIfGuestInDream merged 6 commits into
masterfrom
copilot/add-java-code-sorting-plugin

Conversation

Copilot AI commented Jan 10, 2026

Copy link
Copy Markdown
Contributor
  • Explore vscode-translation repository structure as reference
  • Explore eclipse-method-sorter plugin for sorting logic
  • Create package.json with proper project settings
  • Create tsconfig.json for TypeScript configuration
  • Create eslint.config.mjs for linting
  • Create .gitignore
  • Create .vscodeignore
  • Create .vscode-test.json
  • Create .vscode directory with extensions.json, launch.json, settings.json, tasks.json
  • Create .github directory with ISSUE_TEMPLATE (bug-report.yml, config.yml, feature-request.yml, general-question.yml)
  • Create .github/workflows (artifact.yml, build.yml, publish.yml, release.yml, sync-gitee.yml)
  • Create .github/CODEOWNERS
  • Create .github/dependabot.yml
  • Create src/extension.ts with Java method sorting functionality
  • Create src/sorter directory with method sorting logic (types.ts, javaParser.ts, javaMethodSorter.ts, index.ts)
  • Create src/test/extension.test.ts for VS Code extension tests
  • Create src/test/sorter.test.ts for unit tests (moved from src/sorter/)
  • Create CHANGELOG.md
  • Create README.md
  • Add icon image
  • Verify lint passes
  • Verify compile passes
  • Verify unit tests pass (5/5)
  • Run security check (CodeQL) - no issues

Features implemented:

  • Sort methods by access level (public, protected, package, private)
  • Separate constructors from other methods
  • Invocation order sorting (depth-first or breadth-first)
  • Lexical (alphabetical) ordering
  • Cluster overloaded methods together
  • Cluster getter and setter methods together
  • Shuffle methods randomly feature
  • Right-click context menu under tlcsdm submenu (matching vscode-translation)
  • Keyboard shortcut (Alt+S)
  • Configuration options in VS Code settings
Original prompt

This section details on the original issue you should resolve

<issue_title>需求</issue_title>
<issue_description>1. 代码结构,项目设置参考https://github.com/tlcsdm/vscode-translation
2. 功能需求和实现参考eclipse插件 https://github.com/tlcsdm/eclipse-method-sorter
3. .github 下issue_template和github action等参考 vscode-translation
4. 右键菜单功能放在共通右键菜单tlcsdm下,id可从vscode-translation获取
5. 这个插件只对java代码排序</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ing vscode-translation

Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
@unknowIfGuestInDream unknowIfGuestInDream marked this pull request as ready for review January 10, 2026 12:58
Copilot AI and others added 2 commits January 10, 2026 13:00
Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Java code sorting functionality to plugin Add Java Method Sorter VS Code extension Jan 10, 2026
@unknowIfGuestInDream

Copy link
Copy Markdown
Contributor

@copilot
sorter.test.ts 有没有用,看起来是个测试类,是不是放错路径了?

Co-authored-by: unknowIfGuestInDream <57802425+unknowIfGuestInDream@users.noreply.github.com>

Copilot AI commented Jan 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot
sorter.test.ts 有没有用,看起来是个测试类,是不是放错路径了?

sorter.test.ts is a unit test file for testing the sorter logic. You're right that it was in the wrong path - it should be in src/test/ following the vscode-translation project structure. Moved it to src/test/sorter.test.ts in commit c72a3e2.

@unknowIfGuestInDream unknowIfGuestInDream merged commit bf7c96b into master Jan 10, 2026
4 checks passed
@unknowIfGuestInDream unknowIfGuestInDream deleted the copilot/add-java-code-sorting-plugin branch January 10, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

需求

2 participants