Skip to content

Commit

Permalink
fix: don't throw error if no provider exists
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Jul 23, 2020
1 parent b3130e6 commit 8f087ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/goToDefinition.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ export async function getDefinitions(
const position = targetPosition || editor.getCursorBufferPosition();

const provider = providerRegistry.getProviderForEditor(editor);
if (!provider) {
return;
}
const result = await provider.getDefinition(editor, position);

return result && result.definitions;
Expand Down

0 comments on commit 8f087ef

Please sign in to comment.