MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / saveDocument

Function saveDocument

src/util.ts:215–228  ·  view source on GitHub ↗
(document: vscode.TextDocument)

Source from the content-addressed store, hash-verified

213
214
215export async function saveDocument(document: vscode.TextDocument): Promise<boolean> {
216 if (document.isUntitled) {
217 void vscode.window.showErrorMessage('Document is unsaved. Please save and retry running R command.');
218
219 return false;
220 }
221
222 const isSaved: boolean = document.isDirty ? (await document.save()) : true;
223 if (!isSaved) {
224 void vscode.window.showErrorMessage('Cannot run R command: document could not be saved.');
225 }
226
227 return isSaved;
228}
229
230// shows a quick pick asking the user for confirmation
231// returns true if the user confirms, false if they cancel or dismiss the quickpick

Callers 1

previewRmdMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected