From 721f50cc37f91095cedf1acfe63c88bdfc38b4f7 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Thu, 7 Jan 2016 11:19:29 -0500 Subject: [PATCH] Add XPath History Cleanup --- src/Extension.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Extension.ts b/src/Extension.ts index df1e1f3..622e72b 100644 --- a/src/Extension.ts +++ b/src/Extension.ts @@ -8,6 +8,7 @@ export var GlobalState: vsc.Memento; export var WorkspaceState: vsc.Memento; const LANG_XML: string = 'xml'; +const MEM_QUERY_HISTORY: string = 'xpathQueryHistory'; export function activate(ctx: vsc.ExtensionContext) { // expose global and workspace state to the entire extension @@ -26,4 +27,12 @@ export function activate(ctx: vsc.ExtensionContext) { vsc.languages.registerDocumentFormattingEditProvider(LANG_XML, new XmlDocumentFormattingEditProvider()), vsc.languages.registerDocumentRangeFormattingEditProvider(LANG_XML, new XmlRangeFormattingEditProvider()) ); +} + +export function deactivate() { + // clean up xpath history + let memento: vsc.Memento = WorkspaceState || GlobalState; + let history = memento.get(MEM_QUERY_HISTORY, []); + history.splice(0); + memento.update(MEM_QUERY_HISTORY, history); } \ No newline at end of file