Allow LSP test_file to autofill didOpen params from previous splits #5078
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.
Currently file tests for LSP must provide carbon source code as an escaped string within notify params, i.e.
This works fine for simple, single line files but gets annoying when working with more complicated files which are necessary when testing more complicated features e.g. goto-definition
This PR extends file_test_base to be able to parse the notify/call params and inject files from the test_file's splits into the JSON input. I purposely avoid using the clangd types and manually parse the llvm::json::Value here to avoid introducing a depdendency on clangd to the generic file_test_base, but happy to change if we think that is fine. Also happy to accept other suggestions on alternative methods to achieve same result.