-
Notifications
You must be signed in to change notification settings - Fork 744
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
Refactor LS Workspace Manger #41185
Merged
Merged
Refactor LS Workspace Manger #41185
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #41185 +/- ##
=============================================
+ Coverage 0.00% 76.34% +76.34%
- Complexity 0 52482 +52482
=============================================
Files 9 2881 +2872
Lines 35 198407 +198372
Branches 0 25793 +25793
=============================================
+ Hits 0 151478 +151478
- Misses 35 38570 +38535
- Partials 0 8359 +8359
☔ View full report in Codecov by Sentry. |
malinthar
added
the
Team/LanguageServer
Language Server Implementation related issues. #Compiler
label
Aug 11, 2023
...ver-core/src/main/java/org/ballerinalang/langserver/workspace/BallerinaWorkspaceManager.java
Outdated
Show resolved
Hide resolved
Can you check the renaming scenario? i.e. rename a file in the generated folder into an existing file in the root folder. |
mindula
reviewed
Aug 14, 2023
...ngserver-core/src/test/java/org/ballerinalang/langserver/workspace/TestWorkspaceManager.java
Outdated
Show resolved
Hide resolved
...ngserver-core/src/test/java/org/ballerinalang/langserver/workspace/TestWorkspaceManager.java
Outdated
Show resolved
Hide resolved
...langserver-core/src/test/resources/project/pkg_with_duplicate_files2/generated/mod1/mod1.bal
Outdated
Show resolved
Hide resolved
mindula
approved these changes
Aug 15, 2023
KavinduZoysa
approved these changes
Aug 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
$subject
Fixes #39097
Approach
With the introduction of the
generated
module there is a risk of having duplicate files (same file path internally) in a project as depicted in the following image.When a user creates a duplicate document, the user should be notified about it.
The ProjectAPI is able to identify the duplicate document when a project is created (loaded) using the ProjectLoader.loadProject() method.
If there are duplicate files the ProjectAPI throws an ProjectException.
The ProjectAPI throws an ProjectException
This PR refactors the workspace manager to create a new project if the project is erroneous or a new file is created so that the ProjectAPI is able to identify and notify the user about duplicate files.
Samples
Check List