Closed thanhph111 closed 3 years ago
I've got the same problem. MacOS and Linux. 😭
settingsSync.keybindingsPerPlatform
options was enabled.Version: 1.59.0
Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
Date: 2021-08-04T23:14:40.191Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin x64 20.5.0
Version: 1.59.0
Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
Date: 2021-08-04T23:13:20.182Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Linux x64 5.10.56-1-MANJARO
…And I’ve got the same problem between macOS and Windows☹️ Now that seals it, I think 😂
I had settingsSync.keybindingsPerPlatform
set as well. The issue still remained after multiple spam-clicks, frustrated glares (at the checkbox), and a few hopeful restarts between the two OSes (why not).
21A5304g
)1.59.0
2021-08-04T23:14:40.191Z
13.1.7
91.0.4472.124
14.16.0
9.1.269.36-electron.0
Darwin x64 21.0.0
21H1
, Build 19043.1165
)1.59.0 (system setup)
2021-08-04T23:13:12.822Z
13.1.7
91.0.4472.124
14.16.0
9.1.269.36-electron.0
Windows_NT x64 10.0.19043
@thanhph111 I think that checks second box too, then (😄+☹️)
@thanhph111 I think that checks second box too, then (😄+☹️)
Thanks for reminding me, checking the box is always the easy part 😆.
Also occurs for me between Windows and Mac.
Version: 1.59.1 (user setup) Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa Date: 2021-08-19T11:56:46.957Z Electron: 13.1.7 Chrome: 91.0.4472.124 Node.js: 14.16.0 V8: 9.1.269.36-electron.0 OS: Windows_NT x64 10.0.19042
VS Code version: Code 1.59.1 (3866c3553be8b268c8a7f8c0482c0c0177aa8bfa, 2021-08-19T11:56:46.957Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No Remote OS version: Linux x64 5.4.72-microsoft-standard-WSL2 Remote OS version: Linux x64 5.4.72-microsoft-standard-WSL2 Remote OS version: Linux x64 5.4.72-microsoft-standard-WSL2 Remote OS version: Linux x64 5.4.72-microsoft-standard-WSL2
Version: 1.59.0 Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8 Date: 2021-08-04T23:14:40.191Z (2 wks ago) Electron: 13.1.7 Chrome: 91.0.4472.124 Node.js: 14.16.0 V8: 9.1.269.36-electron.0 OS: Darwin x64 19.6.0
As a workaround, I combined my Windows and Mac keybindings and added a when "when": "isWindows"
and "when": "isMac"
to each binding.
@lramos15 Unfortunately this is caused by the following change - https://github.com/microsoft/vscode/commit/a08a485a914d9a221d198c13a8208ca9f851cc31#diff-aa2d2ba960a74c22e50720f94dc2fbd26020905ef1692a8c37e2d7099d80651fR334. This switched off settingsSync.keybindingsPerPlatform
by default, which means keyboard shortcuts are synced across platforms by default.
Fixed it. But please aware that this will cause conflicts for existing users when syncing keyboard shortcuts because the default value is changed to sync per platform and therefore sync will ask user to accept right changes.
Note: You can safely accept the merge when you are asked to resolve conflicts because of this.
@lramos15 Unfortunately this is caused by the following change - a08a485#diff-aa2d2ba960a74c22e50720f94dc2fbd26020905ef1692a8c37e2d7099d80651fR334. This switched off
settingsSync.keybindingsPerPlatform
by default, which means keyboard shortcuts are synced across platforms by default.
Oh no, sorry! This was part of my work to try and slowly transition the configuration service to not be templated for better runtime type safety and I just assumed !!
would return the same boolean value and would be safe in converting non boolean values to boolean ones
The !!
boolean conversion is not the issue. If I am reading the code correctly, the issue is you changed the type from boolean | undefined
to boolean
. Specifically, by converting settingsSync.keybindingsPerPlatform
from undefined
to false
it now acts as if it is explicitly set to false
, rather than being treated as unset, and prevents the default value of true
from being used (the !== undefined
check will always return true).
Aside: This could be more simply written using the nullish coalescing operator:
return Boolean(
this.configurationService.inspect('settingsSync.keybindingsPerPlatform').userValue ??
this.configurationService.inspect('sync.keybindingsPerPlatform').userValue ??
this.configurationService.getValue('settingsSync.keybindingsPerPlatform')
);
Also, this means there is a simple workaround: Explicitly set "settingsSync.keybindingsPerPlatform": true
in your user settings JSON file.
Describe
I updated to version 1.59.0 on Ubuntu a few days ago, nothing happened. However, when I did it on Windows today, it shows a conflict trying to merge keybindings. I realized it was because the VSCode didn't recognize the differences between platforms when I tried to re-enable
settingsSync.keybindingsPerPlatform
(which was enabled at first).Checklist
Steps to Reproduce:
settingsSync.keybindingsPerPlatform
is enabled.Expected behaviour
VSCode should respect platform-specific keyboard shortcuts.
System info