@@ -7,14 +7,15 @@ import { Resource } from './reactions/resource';
77import { ImportToolResultsWebview } from './webviews/importToolResultsWebview' ;
88import { commentController } from './controllers/comments' ;
99import { reactionHandler } from './handlers/reaction' ;
10+ import { saveNotesToFileHandler } from './handlers/saveNotesToFile' ;
1011import {
1112 getSetting ,
1213 saveNoteComment ,
1314 setNoteStatus ,
1415 syncNoteMapWithRemote ,
1516} from './helpers' ;
1617import { RemoteDb } from './persistence/remote-db' ;
17- import { loadCommentsFromFile , saveCommentsToFile } from './persistence/local-db' ;
18+ import { loadNotesFromFile , saveNotesToFile } from './persistence/local-db' ;
1819
1920const noteMap = new Map < string , vscode . CommentThread > ( ) ;
2021let remoteDb : RemoteDb | undefined ;
@@ -53,6 +54,13 @@ export function activate(context: vscode.ExtensionContext) {
5354 // reaction handler
5455 commentController . reactionHandler = reactionHandler ;
5556
57+ // save notes to file handler
58+ context . subscriptions . push (
59+ vscode . commands . registerCommand ( 'security-notes.saveNotesToFile' , ( ) =>
60+ saveNotesToFileHandler ( noteMap ) ,
61+ ) ,
62+ ) ;
63+
5664 // create note button
5765 context . subscriptions . push (
5866 vscode . commands . registerCommand (
@@ -222,7 +230,7 @@ export function activate(context: vscode.ExtensionContext) {
222230 ) ;
223231
224232 // load persisted comments from file
225- const persistedThreads = loadCommentsFromFile ( ) ;
233+ const persistedThreads = loadNotesFromFile ( ) ;
226234 persistedThreads . forEach ( ( thread ) => {
227235 noteMap . set ( thread . contextValue ? thread . contextValue : '' , thread ) ;
228236 } ) ;
@@ -239,5 +247,5 @@ export function activate(context: vscode.ExtensionContext) {
239247
240248export function deactivate ( context : vscode . ExtensionContext ) {
241249 // persist comments in file
242- saveCommentsToFile ( noteMap ) ;
250+ saveNotesToFile ( noteMap ) ;
243251}
0 commit comments