Update includes when files are renamed
The server advertises willRename and answers workspace/willRenameFiles with a WorkspaceEdit. A bounded core resolves quoted includes against the document directory and replaces only the spelling (relative stays relative, absolute stays absolute, angle includes untouched), with registered tests. EditorDiagnostics converts the byte edits to negotiated positions for every open overlay; a real stdio session returned the extra.hpp -> renamed.hpp edit.
This commit is contained in:
1 parent
158125ace5
commit
b0b48d961c
12 files changed
+277
-5
No files matched your search
@@ -79,6 +79,25 @@ the upgraded snapshot (keeping `snapshot.prev.json`) and rewrites a legacy
|
||||
about 25-30s in a Debug build (it passed VBS at ~27s); the full CMake run then
|
||||
passed 18/18.
|
||||
|
||||
## December 5 include updates on file rename
|
||||
|
||||
`include/vls/features/IncludeUpdate.hpp` finds quoted include directives that
|
||||
resolve from the document's directory to a renamed path and returns byte-offset
|
||||
edits replacing only the spelling (relative stays relative, `./` is preserved,
|
||||
absolute stays absolute; angle includes are never touched because their search
|
||||
roots are unknown), with registered `vls_feature_tests` cases. The server
|
||||
advertises `willRename` alongside the other file operations and answers
|
||||
`workspace/willRenameFiles` through `EditorDiagnostics::renamed_files`, which
|
||||
converts the edits to negotiated positions with each open overlay.
|
||||
|
||||
Real stdio session: renaming `extra.hpp` to `renamed.hpp` while `main.cpp`
|
||||
includes it returned
|
||||
```
|
||||
willRenameFiles: {"changes": {"file:///.../main.cpp": [{"newText": "renamed.hpp",
|
||||
"range": {"end": {"character": 19, "line": 0}, "start": {"character": 10, "line": 0}}}]}}
|
||||
```
|
||||
All 18 native suites and all 18 CMake tests passed.
|
||||
|
||||
## December 5 workspace file operations
|
||||
|
||||
The server advertises `workspace.fileOperations` (`didCreate`, `didRename`,
|
||||
|
||||
Reference in new issue
Block a user