Report errors if location provider fails #4588
Closed
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.
Setting up the location provider in the most recent version of the VSCode extension is nearly impossible because if you don't do it perfectly (define the script using the right relative path, know which CWD the script will run in, use the right argument, parse it correctly, return the location in the correct format...) it simply fails silently with no hint as to what went worng.
Adding this logging will at least enable folks to debug what's happening in the Relay LSP Output panel, if they set the log level correctly.
The other option would be to simply return an error if there is a location provider provided and it errors trying to derive location info. I'm not sure how fallible we except these to be (I happen to know our Hack version has known issues where certain fields/types can't really get resolved).
Test Plan:
Screen.Recording.2024-01-18.at.10.16.18.PM.mov