Support identifier location in inlay hints #2435
Open
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.
In Strada, identifiers had symbols, and when we synthesized an identifier in a type node, we'd store a symbol in it, which we would later use in inlay hints to obtain a location for an identifier in the inlay hint label parts.
This PR adapts that for Corsa, but instead of attaching a symbol to an identifier, we now have to store this information in a separate map that is provided to the node builder implementation.
All inlay hint existing diffs are now good changes as far as I can tell. The newly accepted diffs are due to a few cases where Strada couldn't provide a symbol for an identifier but Corsa can.
I also had to add code to avoid converting bundled file names to URIs in the tests, as that would cause a crash, and I left a
!!!for possibly avoiding type node reuse in inlay hints once that's implemented, because I think otherwise we can't easily keep track of the mapping of identifiers to symbols.