Finish migrating off Document to ArkFile#1267
Merged
Merged
Conversation
79aae40 to
0b199bf
Compare
DavisVaughan
approved these changes
Jun 12, 2026
Comment on lines
+39
to
+43
| // TODO: this is a stopgap that goes away with `ArkFile`. Once handlers are | ||
| // pure Oak, they return `File`-keyed results (diagnostics, the edit targets | ||
| // in a `WorkspaceEdit`) and the wire URL gets attached at the transport | ||
| // boundary from a map of open editor URLs owned by the LSP layer. In that | ||
| // design the verbatim URL never travels through the analysis layer. |
| pub(crate) fn get_document_mut(&mut self, path: &FilePath) -> anyhow::Result<&mut Document> { | ||
| if let Some(doc) = self.documents.get_mut(path) { | ||
| Ok(doc) | ||
| pub(crate) fn ark_file_mut(&mut self, uri: &Url) -> anyhow::Result<&mut ArkFile> { |
Contributor
There was a problem hiding this comment.
Looks like we only still need this for updating DocumentConfig. I wonder what that will end up being a part of
Comment on lines
+142
to
+144
| pub(crate) fn workspace_uris(state: &WorldState) -> Vec<Url> { | ||
| state | ||
| .documents | ||
| .open_files |
Contributor
There was a problem hiding this comment.
Suggested change
| pub(crate) fn workspace_uris(state: &WorldState) -> Vec<Url> { | |
| state | |
| .documents | |
| .open_files | |
| pub(crate) fn open_file_uris(state: &WorldState) -> Vec<Url> { | |
| state | |
| .open_files |
?
Seems nicer
Contributor
There was a problem hiding this comment.
I imagine this helper may go away eventually too. I guess it depends on how we end up handling config in update_config(), which is currently the only consumer of this
| // origin = "https://github.com/rust-lang/rust-analyzer/blob/master/crates/rust-analyzer/src/lsp/utils.rs" | ||
| // --- | ||
| /// Apply a batch of LSP content changes to `contents`, returning the new text. | ||
| fn apply_content_changes( |
Contributor
There was a problem hiding this comment.
I feeeel like maybe this and its newly added tests at the bottom should just go in its own standalone file. Maybe content.rs or changes.rs or something?
0ec831d to
4cb3904
Compare
0b199bf to
0d8ba4e
Compare
8a00f75 to
26f55c8
Compare
bdb651b to
bcaec36
Compare
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Branched from #1266
Progress towards #1212
With this PR everything now goes through Oak's DB.
Remove Ark's
Documentstructure, along with its copy of the tree-sitter tree, source code, and line index. These are now all accessed via Oak queries onFile.WorldState'sdocumentsfield becomesopen_files: HashMap<FilePath, ArkFile>. (Maybe we should rename toArkOpenFile?)