Skip to content

Commit 030fd19

Browse files
committed
Fix circular dependency in getSetting
1 parent 69dd437 commit 030fd19

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { ExportNotesWebview } from './webviews/export-notes/exportNotesWebview';
99
import { commentController } from './controllers/comments';
1010
import { reactionHandler } from './handlers/reaction';
1111
import { saveNotesToFileHandler } from './handlers/saveNotesToFile';
12+
import { getSetting } from './utils';
1213
import {
13-
getSetting,
1414
saveNoteComment,
1515
setNoteStatus,
1616
syncNoteMapWithRemote,

src/helpers.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { RemoteDb } from './persistence/remote-db';
66
import { v4 as uuidv4 } from 'uuid';
77
import { Deserializer } from './persistence/serialization/deserializer';
88
import { saveNotesToFile } from './persistence/local-db';
9+
import { getSetting } from './utils';
910

1011
export const saveNoteComment = (
1112
thread: vscode.CommentThread,
@@ -152,10 +153,4 @@ export const syncNoteMapWithRemote = (
152153
});
153154

154155
saveNotesToFile(noteMap);
155-
};
156-
157-
export const getSetting = (settingName: string, defaultValue?: any) => {
158-
return vscode.workspace
159-
.getConfiguration('security-notes')
160-
.get(settingName, defaultValue);
161-
};
156+
};

src/utils/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,9 @@ export const fullPathToRelative = (aPath: string, basePath?: string) => {
5959
}
6060
return path.relative(getWorkspacePath(), aPath);
6161
};
62+
63+
export const getSetting = (settingName: string, defaultValue?: any) => {
64+
return vscode.workspace
65+
.getConfiguration('security-notes')
66+
.get(settingName, defaultValue);
67+
};

0 commit comments

Comments
 (0)