Skip to content

Add error message when there are no definitions/references queries available.#389

Merged
jcreedcmu merged 1 commit intogithub:masterfrom
jcreedcmu:jcreed/no-defs-err
May 26, 2020
Merged

Add error message when there are no definitions/references queries available.#389
jcreedcmu merged 1 commit intogithub:masterfrom
jcreedcmu:jcreed/no-defs-err

Conversation

@jcreedcmu
Copy link
Copy Markdown
Contributor

@jcreedcmu jcreedcmu commented May 21, 2020

Turns out we were already raising an exception, but the DefinitionProvider/ReferencesProvider helpfully 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.

@jcreedcmu jcreedcmu force-pushed the jcreed/no-defs-err branch from dabce32 to 8cadd3d Compare May 21, 2020 18:46
@jcreedcmu jcreedcmu requested a review from aeisenberg May 21, 2020 18:46
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.`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jcreedcmu jcreedcmu merged commit fccec96 into github:master May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better error message when there are no definitions/references queries.

2 participants