github
<a href="https://github.com/williamthome/zotonic-ls/commit/<a class=hub.com/williamthome/zotonic-ls/commit/<a class="double-link" href="https://git"><a class=hub.com/williamthome/zotonic-ls/commit/<a class="double-link" href="https://git"><a class=hub.com/williamthome/zotonic-ls/commit/b7306dcd6cfd924d34f4531c4d7ab5facac25355">b7306dcd6<a href="https://github.com/williamthome/zotonic-ls/commit/b7306dcd6cfd924d34f4531c4d7ab5facac25355">">&lt;a href=&quot;https://github.com/williamthome/zotonic-ls/commit/</a><a class="double-link" href="https://github.com/williamthome/zotonic-ls/commit/&lt;a class=&quot;double-link&quot; href=&quot;https://git">&lt;a class=</a>hub.com/williamthome/zotonic-ls/commit/b7306dcd6cfd924d34f4531c4d7ab5facac25355">b7306dcd6</a><a href="https://github.com/williamthome/zotonic-ls/commit/b7306dcd6cfd924d34f4531c4d7ab5facac25355">&lt;a href=&quot;https://github.com/williamthome/zotonic-ls/commit/b7306dcd6cfd924d34f4531c4d7ab5fa</a>cac25355">">Merge </a><a class="double-link" href="https://github.com/williamthome/zotonic-ls/commit/<a class="double-link" href="https://github.com/williamthome/zotonic-ls/commit/<a class="double-link" href="https://github.com/williamthome/zotonic-ls/commit/90cc3e3de27535e29d66b41ff9b9aa06816040c6">90cc3e3de</a><a href="https://github.com/williamthome/zotonic-ls/commit/b7306dcd6cfd924d34f4531c4d7ab5facac25355">&quot;&gt;90cc3e3de&lt;/a&gt;&quot;&gt;90cc3e3de&lt;/a&gt;&lt;a href=&quot;https://github.com/williamthome/zotonic-ls/commit/b7306dcd6cfd924d34f4531c4d7ab5facac25</a>355"> into </a><a class="double-link" href="https://github.com/williamthome/zotonic-ls/commit/<a class="double-link" href="https://github.com/williamthome/zotonic-ls/commit/3ef1d7a57">3ef1d7a57">3ef1d7a57</a>
68 of 106 branches covered (64.15%)
Branch coverage included in aggregate %.
467 of 1237 new or added lines in 46 files covered. (37.75%)
463 of 1237 relevant lines covered (37.43%)
2.61 hits per line
NEW
|
import { |
|
NEW
|
GetUserChoiceCommand, |
× |
NEW
|
OnChoiceSelectedCommand, |
× |
NEW
|
} from '@/domain/commands'; |
× |
NEW
|
import { window } from 'vscode'; |
× |
NEW
|
|
× |
NEW
|
export function buildGetUserChoiceCommand(): GetUserChoiceCommand {
|
× |
NEW
|
return async function getUserChoice(args: {
|
× |
NEW
|
choices: string[]; |
× |
NEW
|
onChoiceSelected: OnChoiceSelectedCommand;
|
× |
NEW
|
}) { |
× |
NEW
|
const quickPick = window.createQuickPick();
|
× |
NEW
|
quickPick.items = args.choices.map((choice) => ({ |
× |
NEW
|
label: choice,
|
× |
NEW
|
})); |
× |
NEW
|
quickPick.onDidChangeSelection(async ([{ label }]) => { |
× |
NEW
|
const i = args.choices.indexOf(label);
|
× |
NEW
|
const choice = args.choices[i];
|
× |
NEW
|
await args.onChoiceSelected(choice); |
× |
NEW
|
quickPick.hide(); |
× |
NEW
|
}); |
× |
NEW
|
quickPick.show(); |
× |
NEW
|
}; |
× |
NEW
|
} |
× |