-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for config flags to settings UI (+ technical explanation flag system) #270
Labels
Comments
SchoofsKelvin
added
enhancement
New feature or request
webview
Features/issues related to WebView-based UI
labels
Jul 1, 2021
This was referenced Sep 18, 2021
Open
This was referenced Oct 19, 2021
This was referenced Nov 21, 2021
Closed
This was referenced Jul 6, 2022
Closed
This was referenced Apr 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
If you're here just to see how to enable flags, check the
How to add flags as a user
section in the explanation belowFeature request
Add two new sections to the webview:
sshfs.flags
) can be viewed/added/changed/removed.We might also want to give the user the choice whether to edit the "global" flags in User Settings, Workspace settings, ...
Some notes regarding this:
true
/false
or just remove it (thus using the default)Only allowing the user to pick existing flags (and limit what type of value they can enter) is more than fine though.
Technical explanation about the flag system
The flag system got added in 83d6cd0 and expanded upon in 218188a and 9de1d03. It allows the user to quickly toggle certain features/fixes in the extension, both globally or per-config. We can also make the extension automatically enable/disable flags (yet allow it to be overridden by the user), as shown here for
DF-GE
that fixes #239:Extension auto-enabling
DF-GE
vscode-sshfs/src/config.ts
Lines 389 to 405 in 87d2cf8
And a simple example of the extension checking a boolean flag:
Extension checking
DF-GE
vscode-sshfs/src/connect.ts
Lines 266 to 273 in 87d2cf8
Here's more information regarding flags:
How to add flags as a user
For managing flags globally, the user can edit the
sshfs.flags
setting in VS Code's User Settings. For example:For a per-config basis, the user requires to edit the JSON-representation of the config. This is usually under
sshfs.configs
in the User Settings, but could be in other places if you configured it that way, e.g. the workspace settings:Parsing of flags
Flags are case-insensitive, and are basically represented as strings, where the resulting flag value depends on the format:
Boolean flags (e.g.
DEBUG_SSH2
in 06bce85) will on top of that convert non-boolean values (e.g.null
and"something"
) to booleans on very simple rules:null
, we returntrue
(thus the presence of a (non-false) flag counts astrue
)true
,t
,yes
ory
, we returntrue
false
,f
,no
orn
, we returnfalse
This allows the user to simply add e.g.
DEBUG_SSH2
(or+DEBUG_SSH2
orDEBUG_SSH=true
etc) to enable debugging of the ssh2 library, while also supporting-CHECK_HOME
(orCHECK_HOME=no
etc) to disable that enabled-by-default flag.List of currently available flags
vscode-sshfs/src/config.ts
Lines 370 to 384 in 87d2cf8
check up-to-date list at https://github.com/SchoofsKelvin/vscode-sshfs/blob/master/src/config.ts
The text was updated successfully, but these errors were encountered: