Skip to content

Commit 514f1ff

Browse files
committed
Fix set matchOnLabel hack on vscode 1.74
1 parent cf0ddeb commit 514f1ff

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

client/commander.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ async function commandInput(client, cmd="", value="", completions) {
4242
const input = vscode.window.createQuickPick()
4343
try {
4444
input.placeholder = cmd.trim() || "PyXT Command"
45-
// Disable filter on value change
46-
// https://github.com/microsoft/vscode/issues/142941
47-
input._pendingUpdate["matchOnLabel"] = false
45+
disableMatchOnLabel(input)
4846
input.sortByLabel = false
4947
input.ignoreFocusOut = true
5048
input.pyxt_cmd = cmd
@@ -63,6 +61,21 @@ async function commandInput(client, cmd="", value="", completions) {
6361
}
6462
}
6563

64+
function disableMatchOnLabel(input) {
65+
// Disable filter on value change
66+
// https://github.com/microsoft/vscode/issues/142941
67+
// TODO PR for https://github.com/microsoft/vscode/issues/83425
68+
// This used to work, but broke in VS Code 1.74.0
69+
//input._pendingUpdate["matchOnLabel"] = false
70+
Object.values(input).forEach(obj => {
71+
if (typeof obj !== 'object') return
72+
if (obj.hasOwnProperty("id") && obj.type === "quickPick"
73+
&& obj.placeholder === input.placeholder) {
74+
obj["matchOnLabel"] = false
75+
}
76+
})
77+
}
78+
6679
function dispatch(result, client, cmd, value) {
6780
if (!result) {
6881
return Promise.resolve()

0 commit comments

Comments
 (0)