@@ -8,6 +8,7 @@ import { cloneDeep, isEqual } from "lodash";
8
8
import * as fs from "node:fs" ;
9
9
import * as path from "node:path" ;
10
10
import * as vscode from "vscode" ;
11
+ import { vscodeGetConfigurationString } from "../VscodeConfiguration" ;
11
12
import VscodeEnabledHatStyleManager , {
12
13
ExtendedHatStyleMap ,
13
14
} from "../VscodeEnabledHatStyleManager" ;
@@ -40,23 +41,20 @@ const hatConfigSections = [
40
41
"cursorless.individualHatAdjustments" ,
41
42
] ;
42
43
43
- /**
44
- * Maintains the VSCode decoration type objects corresponding to each hat style.
45
- * This class is responsible for the actual svgs / colors used to render the
46
- * hats. The decision about which hat styles should be available is up to
47
- * {@link VscodeEnabledHatStyles}
48
- */
49
-
50
- const SETTING_SECTION_HAT_SHAPES_DIR = "cursorless.private" ;
51
- const SETTING_NAME_HAT_SHAPES_DIR = "hatShapesDir" ;
52
- const hatShapesDirSettingId = `${ SETTING_SECTION_HAT_SHAPES_DIR } .${ SETTING_NAME_HAT_SHAPES_DIR } ` ;
44
+ const hatShapesDirSettingId = "cursorless.private.hatShapesDir" ;
53
45
54
46
interface SvgInfo {
55
47
svg : string ;
56
48
svgHeightPx : number ;
57
49
svgWidthPx : number ;
58
50
}
59
51
52
+ /**
53
+ * Maintains the VSCode decoration type objects corresponding to each hat style.
54
+ * This class is responsible for the actual svgs / colors used to render the
55
+ * hats. The decision about which hat styles should be available is up to
56
+ * {@link VscodeEnabledHatStyles}
57
+ */
60
58
export default class VscodeHatRenderer {
61
59
private decorationMap ! : HatDecorationMap ;
62
60
private disposables : vscode . Disposable [ ] = [ ] ;
@@ -124,10 +122,7 @@ export default class VscodeHatRenderer {
124
122
125
123
private async updateHatsDirWatcher ( ) {
126
124
this . hatsDirWatcherDisposable ?. dispose ( ) ;
127
-
128
- const hatsDir = vscode . workspace
129
- . getConfiguration ( SETTING_SECTION_HAT_SHAPES_DIR )
130
- . get < string > ( SETTING_NAME_HAT_SHAPES_DIR ) ! ;
125
+ const hatsDir = vscodeGetConfigurationString ( hatShapesDirSettingId ) ;
131
126
132
127
if ( hatsDir ) {
133
128
await this . updateShapeOverrides ( hatsDir ) ;
0 commit comments