Conversation
|
Hi! Just FYI, it's already possible to customise this (albeit a little hacky) using a library such as https://github.com/be5invis/vscode-custom-css. Here is the css styles I use myself: You can find the full reference in my dotfiles. |
|
Thanks for the suggestion - I am not interested in tweaking my CSS, though, since that's going to require more ongoing maintenance as things break due to future changes. |
71
left a comment
There was a problem hiding this comment.
Thanks for the PR! One thing to keep in mind for this PR: #338 adds "namespaced modes" like helix/normal. We should take this into account when changing the formatting of the mode IMO (e.g. would be nice to show/hide the prefix helix/).
package.json
Outdated
| ], | ||
| "markdownDeprecationMessage": "Built-in modes are deprecated. Use `#dance.modes#` instead." | ||
| }, | ||
| "dance.activeModeDisplayStyle": { |
There was a problem hiding this comment.
I'm fine with this name, but I wonder if we should try to match the CSS property text-transform, since it accomplishes something very similar. Something like activeModeDisplayTextTransform?
package.json
Outdated
| "as-is", | ||
| "uppercase", | ||
| "lowercase" | ||
|
|
package.json
Outdated
|
|
||
| ], | ||
| "default": "as-is", | ||
| "description": "Controls how the active mode is formmated in the status bar.", |
There was a problem hiding this comment.
| "description": "Controls how the active mode is formmated in the status bar.", | |
| "description": "Controls how the active mode is formatted in the status bar.", |
package.json
Outdated
| "default": "as-is", | ||
| "description": "Controls how the active mode is formmated in the status bar.", | ||
| "enumDescriptions": [ | ||
| "Display the name with its original formmatting.", |
There was a problem hiding this comment.
| "Display the name with its original formmatting.", | |
| "Display the name with its original formatting.", |
|
Tangential, but i tackle the "oops i forgot which mode im in" by customizing the cursor - are the defaults reasonable here do you think? |
Very interesting! I'm not sure if that should be a separate setting, since the menu would start getting very long if we start getting into exponential combinations of possible settings. There'd be 5 menu entries at the moment (2x2 plus "as-is"), at a minimum. I addressed all the other feedback, although I can't figure out how to run tests locally. |
71
left a comment
There was a problem hiding this comment.
@tylerlaprade Thanks for the changes! You should be able to run the tests from VS Code, in "Run and Debug > Run all tests". I recommend launching the extension with "Launch extension" instead though.
I'm not sure what you intended, though: the configuration is documented as being set per-mode, but the code you added reads a global property instead.
@71, that's right, I intended it to be global. Open to suggestions or edits if the documentation isn't clear! |
package.build.ts
Outdated
| "as-is", | ||
| "uppercase", | ||
| "lowercase", | ||
|
|
There was a problem hiding this comment.
nit: remove empty line
package.build.ts
Outdated
| + "non-directional, like Kakoune.", | ||
| ], | ||
| }, | ||
| activeModeDisplayTextTransform: { |
There was a problem hiding this comment.
This defines activeModeDisplayTextTransform as a property set on modes, not a global configuration. You need to move this below and name it "dance.activeModeDisplayTextTransform" instead.
src/state/editors.ts
Outdated
| switch (vscode.workspace.getConfiguration(extensionName) | ||
| .get<string>("activeModeDisplayTextTransform")) { |
There was a problem hiding this comment.
This is a good way to get the key, but to avoid reading the configuration every time the mode changes (which can occur pretty often), I would instead use observePreference() in src/state/extension.ts to keep a field of Extension in sync with the configuration, and then read from _extension in notifyDidBecomeActive().
|
Thanks @71 for your patience and feedback, and sorry for the delay. As a newcomer to extension development, seeing everything "just work" when I pressed I've addressed all your comments. I'm still not able to run the tests, though, as I don't see the command you mentioned, and
I did, however, launch the extension locally and confirmed it works, checking the behavior of all three of the options.
|




I always wish I could show the mode in the status bar in uppercase so that I notice it more. This is how Vim does it, I believe. Rather than making a simple boolean, I made it an enum so other display modes can be added in the future. This would be helpful for someone who has a lot of custom modes and wants to change how they're displayed.
This is my first time working on a VSCode extension, so feedback is very welcome. I wasn't sure how to build. I ran
npm i, but it change the yarn file and added far more topackage-lock.jsonthan I expected, so I reverted it. I also didn't touch any validation of the setting (although I did add adefaultto the switch case to handle unrecognized values).