Skip to content

Conversation

@KonerDev
Copy link
Member

Changes

  • Reuse the same LspProject and CustomLanguageServerDefinitions if the parent path is the same or the definition has already been created
  • Refactor close project dialog to always use CloseConfirmationDialog
  • Use appropriate name (instead of 0, use Storage)

@github-actions
Copy link

github-actions bot commented Oct 19, 2025

PR Summary

This PR enhances LSP project management by introducing caching for LspProject instances and CustomLanguageServerDefinitions, ensuring that the same project and server definitions are reused when the parent path or definition already exists. Additionally, it refactors the project closing dialogs across the application to consistently use a shared CloseConfirmationDialog component, improving UI consistency and using more appropriate naming conventions like getAppropriateName() for projects.

Changes

File Summary
core/main/src/main/java/com/rk/compose/filetree/Drawer.kt Refactored the project closing mechanism within the DrawerContent composable. The local state closeProjectDialog was simplified to a boolean, and the custom AlertDialog was replaced with a reusable CloseConfirmationDialog component, improving consistency and using a more appropriate project name.
core/main/src/main/java/com/rk/libcommons/editor/BaseLspConnector.kt Implemented caching for LspProject and CustomLanguageServerDefinition instances. The connect method now reuses existing LspProject objects based on the project path and CustomLanguageServerDefinition objects based on both project path and file extension, preventing redundant object creation.
core/main/src/main/java/com/rk/xededitor/ui/components/FileActionDialog.kt Updated the FileActionDialog to use the getAppropriateName() extension function when displaying the project name in the CloseConfirmationDialog. The CloseConfirmationDialog composable was also refactored to accept projectName instead of fileName for clarity and consistency.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

LGTM!

Review Summary

Commits Considered (2)
  • 70208f6: fix(main): refactor and use proper name
  • d7a3657: fix(main): reuse the same LspProject
Files Processed (3)
  • core/main/src/main/java/com/rk/compose/filetree/Drawer.kt (4 hunks)
  • core/main/src/main/java/com/rk/libcommons/editor/BaseLspConnector.kt (3 hunks)
  • core/main/src/main/java/com/rk/xededitor/ui/components/FileActionDialog.kt (5 hunks)
Actionable Comments (0)
Skipped Comments (1)
  • core/main/src/main/java/com/rk/compose/filetree/Drawer.kt [309-309]

    possible bug: "Potential NullPointerException with currentProject"

@RohitKushvaha01 RohitKushvaha01 merged commit 6ff72b3 into Xed-Editor:main Oct 19, 2025
@KonerDev KonerDev deleted the fix/projects branch October 19, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants