Add error message when there are no definitions/references queries available.#389
Merged
jcreedcmu merged 1 commit intogithub:masterfrom May 26, 2020
Merged
Conversation
dabce32 to
8cadd3d
Compare
aeisenberg
approved these changes
May 21, 2020
| if (queries.length === 0) { | ||
| throw new Error("Couldn't find any queries for qlpack"); | ||
| vscode.window.showErrorMessage( | ||
| `No ${nameOfKeyType(keyType)} queries (tagged "${tagOfKeyType(keyType)}") could be found in the current library path. It might be necessary to upgrade the CodeQL libraries.` |
Contributor
There was a problem hiding this comment.
This is fine, though I wonder if the message could link out to some instructions on how to do that. Not really necessary for this to go through.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Turns out we were already raising an exception, but the
DefinitionProvider/ReferencesProviderhelpfully silently swallows raised exceptions. (well, they get logged to console, but that's as good as silent from the average user's perspective). I don't see any way to suppress the 'zero definitions/references found' popup, but at least we can clarify why zero were found with this message.I included the specific tag that's being looked for by the extension, since I think it might potentially help advanced users debug what's going on in the event that the issue is not merely upgrading, but the queries being missing or improperly located or something because of some future refactoring.
Fixes #387.