We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45a1e74 commit 318bdd7Copy full SHA for 318bdd7
src/commands/importIdentifier.ts
@@ -42,7 +42,10 @@ const doImport = async (arg: { mod: string; package: string }): Promise<void> =>
42
const edit = new vscode.WorkspaceEdit();
43
44
const lines = document.getText().split('\n');
45
- const moduleLine = lines.findIndex(line => line.startsWith('module'));
+ const moduleLine = lines.findIndex(line => {
46
+ const lineTrimmed = line.trim();
47
+ return lineTrimmed === 'where' || lineTrimmed.endsWith(' where') || lineTrimmed.endsWith(')where');
48
+ });
49
const revInputLine = lines.reverse().findIndex(l => l.startsWith('import'));
50
const nextInputLine = revInputLine !== -1 ? lines.length - 1 - revInputLine : moduleLine === -1 ? 0 : moduleLine + 1;
51
0 commit comments