Add XPath History Cleanup
This commit is contained in:
parent
b7e4fc8c15
commit
721f50cc37
@ -8,6 +8,7 @@ export var GlobalState: vsc.Memento;
|
|||||||
export var WorkspaceState: vsc.Memento;
|
export var WorkspaceState: vsc.Memento;
|
||||||
|
|
||||||
const LANG_XML: string = 'xml';
|
const LANG_XML: string = 'xml';
|
||||||
|
const MEM_QUERY_HISTORY: string = 'xpathQueryHistory';
|
||||||
|
|
||||||
export function activate(ctx: vsc.ExtensionContext) {
|
export function activate(ctx: vsc.ExtensionContext) {
|
||||||
// expose global and workspace state to the entire extension
|
// expose global and workspace state to the entire extension
|
||||||
@ -27,3 +28,11 @@ export function activate(ctx: vsc.ExtensionContext) {
|
|||||||
vsc.languages.registerDocumentRangeFormattingEditProvider(LANG_XML, new XmlRangeFormattingEditProvider())
|
vsc.languages.registerDocumentRangeFormattingEditProvider(LANG_XML, new XmlRangeFormattingEditProvider())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deactivate() {
|
||||||
|
// clean up xpath history
|
||||||
|
let memento: vsc.Memento = WorkspaceState || GlobalState;
|
||||||
|
let history = memento.get<any[]>(MEM_QUERY_HISTORY, []);
|
||||||
|
history.splice(0);
|
||||||
|
memento.update(MEM_QUERY_HISTORY, history);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user