mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
individual file handling
This commit is contained in:
@ -18,6 +18,18 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
initialized = false;
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('memfs.addFile', _ => {
|
||||
if (initialized) {
|
||||
memFs.writeFile(vscode.Uri.parse(`memfs:/file.txt`), Buffer.from('foo'), { create: true, overwrite: true });
|
||||
}
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('memfs.deleteFile', _ => {
|
||||
if (initialized) {
|
||||
memFs.delete(vscode.Uri.parse('memfs:/file.txt'));
|
||||
}
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('memfs.init', _ => {
|
||||
if (initialized) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user