@@ -8,6 +8,7 @@ import { cloneDeep, isEqual } from "lodash";
88import * as fs from "node:fs" ;
99import * as path from "node:path" ;
1010import * as vscode from "vscode" ;
11+ import { vscodeGetConfigurationString } from "../VscodeConfiguration" ;
1112import VscodeEnabledHatStyleManager , {
1213 ExtendedHatStyleMap ,
1314} from "../VscodeEnabledHatStyleManager" ;
@@ -40,23 +41,20 @@ const hatConfigSections = [
4041 "cursorless.individualHatAdjustments" ,
4142] ;
4243
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" ;
5345
5446interface SvgInfo {
5547 svg : string ;
5648 svgHeightPx : number ;
5749 svgWidthPx : number ;
5850}
5951
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+ */
6058export default class VscodeHatRenderer {
6159 private decorationMap ! : HatDecorationMap ;
6260 private disposables : vscode . Disposable [ ] = [ ] ;
@@ -124,10 +122,7 @@ export default class VscodeHatRenderer {
124122
125123 private async updateHatsDirWatcher ( ) {
126124 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 ) ;
131126
132127 if ( hatsDir ) {
133128 await this . updateShapeOverrides ( hatsDir ) ;
0 commit comments