-
-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor to Ruff-inspired two-layer file architecture w/Salsa #188
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
Merged
Conversation
This file contains hidden or 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
… opened The core issue was that when a file was opened in the LSP, if it had already been read from disk, Salsa would return cached content instead of reading from the overlay system. This happened because opening a file didn't bump its revision, so Salsa had no reason to invalidate its cache. Key changes: - Created Buffers abstraction to encapsulate shared buffer storage - Fixed Session::open_document() to bump revision when file already exists - Added comprehensive integration tests to verify overlay behavior - Refactored WorkspaceFileSystem to use Buffers instead of raw DashMap This ensures that overlays always take precedence over disk content, fixing the issue where LSP edits weren't being reflected in template parsing.
- Added comprehensive module-level documentation to all djls-workspace modules - Consolidated scattered URL/path conversion utilities into paths module - Added documentation explaining the 'why' for key types and abstractions - Added #[must_use] annotations to constructors and getters - Focused on explaining architecture and design decisions rather than obvious behavior
- Added [] cross-references between related types - Fixed parameter naming consistency (lsp_uri -> uri) - Added Returns sections to document when functions return None - Added example to url_to_path function - Linked Buffers <-> WorkspaceFileSystem relationship - Linked LanguageId -> FileKind conversion
Fixed unclosed HTML tag warnings by adding backticks around: - Generic types like Arc<DashMap> - Type names in documentation like StorageHandle<Database> - The word 'Arc' when referring to the type
The documentation was completely out of sync with the code: - Referenced 'overlays in Session using Arc<DashMap>' when they're now in Buffers - Mentioned 'LspFileSystem' which was renamed to WorkspaceFileSystem - Was overly verbose without being helpful - 'vomit of words' Rewrote to be concise and accurate: - Correctly describes the current two-layer architecture - Focuses on the critical revision dependency trick - Removes outdated implementation details - Uses proper cross-references
- Removed references to 'LspFileSystem' (now WorkspaceFileSystem) - Removed verbose 'overlay' explanations (now using Buffers abstraction) - Simplified struct field documentation to be accurate and concise - Removed unnecessary mentions of 'Ruff's pattern' everywhere The documentation now accurately reflects the current implementation without verbose explanations of outdated architecture.
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.
No description provided.