Add support for multiple-file prisma schema #76
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.
This PR introduces support for split Prisma schemas by automatically merging .prisma files located within the schema directory. This enhancement improves the visualization of schemas in the graph, allowing for a more organized and flexible schema structure.
Changes Made:
Auto-Merging Functionality: Added logic to publishSchema in packages/extension-shared/extension/views/panel.ts to check for .prisma files within the schema directory and merge them if found.
Async Method Update: Converted publishSchema to an async method to utilize workspace.findFiles and workspace.fs.readFile for file operations.
Type Adjustment: Added void to the call of MainPanel.publishSchema to prevent compilation errors without affecting existing functionality.
Impact:
No Regression: The changes do not affect current functionality.
Improved Support: Enables proper handling of split schema files, enhancing the user experience for those organizing schemas in multiple files within the schema directory.
Testing:
The changes have been tested to ensure correct merging and display of split schemas. Further testing is welcome to confirm functionality across different setups.
Conclusion:
This PR enhances the Prisma schema handling, offering better support for split schemas. I appreciate your consideration and look forward to your feedback.
Thank you for your attention, and I hope this improvement can be included in an upcoming release.
Best regards,
Togo01