-
-
Notifications
You must be signed in to change notification settings - Fork 88
Sort VSCode settings to put common settings first #813
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
Conversation
README.md
Outdated
- `cursorless.hatSettings.hatEnablement.shapes`: Whether to enable particular hat shapes. | ||
- `cursorless.hatSettings.hatPenalties.colors`: How much to penalize each hat color. You will probably want to set this one to the number of syllables in the given style. Cursorless will then sort every style combination by number of syllables to refer to it. | ||
- `cursorless.hatSettings.hatPenalties.shapes`: How much to penalize each hat shape. You will probably want to set this one to the number of syllables in the given style. Cursorless will then sort every style combination by number of syllables to refer to it. | ||
- `cursorless.hatSettings.maximumHatStylePenalty`: The maximum allowed penalty for a hat style. Any hat style whose penalty is greater than this amount will not be used. A hat style penalty is defined to be the shape penalty plus the colour penalty. Setting this value less than or equal to zero is treated as no maximum. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these names change then we need some migration code for those that have modified these settings. I don't see any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a crack at this one! Good direction, but as @auscompgeek mentions, this PR will break everyone's Cursorless who has used any hat settings 😅. You'll need to modify the code that reads the settings to be able to handle the old as well as the new paths
package.json
Outdated
@@ -335,14 +345,16 @@ | |||
}, | |||
"additionalProperties": false | |||
}, | |||
"cursorless.maximumHatStylePenalty": { | |||
"cursorless.hatSettings.hatPenalties.maximumHatStylePenalty": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't really have any impact on hat penalties, so I don't think I'd put it in that group
"cursorless.hatSettings.hatPenalties.maximumHatStylePenalty": { | |
"cursorless.hatSettings.maximumHatStylePenalty": { |
src/core/Decorations.ts
Outdated
const userSizeAdjustment = vscode.workspace | ||
.getConfiguration("cursorless") | ||
.getConfiguration("cursorless.hatSettings") | ||
.get<number>(`hatSizeAdjustment`)!; | ||
|
||
const userVerticalOffset = vscode.workspace | ||
.getConfiguration("cursorless") | ||
.getConfiguration("cursorless.hatSettings") | ||
.get<number>(`hatVerticalOffset`)!; | ||
|
||
const userIndividualAdjustments = vscode.workspace | ||
.getConfiguration("cursorless") | ||
.getConfiguration("cursorless.hatSettings") | ||
.get<IndividualHatAdjustmentMap>("individualHatAdjustments")!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can prob add a new function like the following and use it in all the above places:
function getHatSetting<T>(name: string): T | undefined {
return (
vscode.workspace.getConfiguration("cursorless.hatSettings").get<T>(name) ??
vscode.workspace.getConfiguration("cursorless").get<T>(name)
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second, thought, though, I'm not sure we want to group the hat settings. The hat enablement settings are far more common than the other ones. I think probably better to arrange settings by how likely they are to be used, rather than category. Here's the order I'd suggest:
- Cursorless: Hat Size Adjustment
- Cursorless: Hat Vertical Offset
- Cursorless › Hat Enablement: Colors
- Cursorless › Hat Enablement: Shapes
- Cursorless › Colors: Light
- Cursorless › Colors: Dark
Then after that I think they're all less common so doesn't matter as much
d8e8d69
to
761eefc
Compare
@pokey done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks!
closes #389
I've taken the liberty to also group the hat settings. let me know if I should revert it!
For some reason one of the hat settings still shows up first. I've looked into the vscode docs but wasn't able to find anything on it.I am guessing it is a bug in vscode. But maybe I also made a mistake somewhere.