Skip to content

Commit 8f087ef

Browse files
committed
fix: don't throw error if no provider exists
1 parent b3130e6 commit 8f087ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/goToDefinition.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ export async function getDefinitions(
4949
const position = targetPosition || editor.getCursorBufferPosition();
5050

5151
const provider = providerRegistry.getProviderForEditor(editor);
52+
if (!provider) {
53+
return;
54+
}
5255
const result = await provider.getDefinition(editor, position);
5356

5457
return result && result.definitions;

0 commit comments

Comments
 (0)