forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
saveEditor
proposed API for running untitled Python files (#21183)
Closes #21182
- Loading branch information
Kartik Raj
authored
May 4, 2023
1 parent
4112b04
commit 6bdada0
Showing
6 changed files
with
72 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
// https://github.com/microsoft/vscode/issues/178713 | ||
|
||
declare module 'vscode' { | ||
|
||
export namespace workspace { | ||
|
||
/** | ||
* Saves the editor identified by the given resource and returns the resulting resource or `undefined` | ||
* if save was not successful. | ||
* | ||
* **Note** that an editor with the provided resource must be opened in order to be saved. | ||
* | ||
* @param uri the associated uri for the opened editor to save. | ||
* @return A thenable that resolves when the save operation has finished. | ||
*/ | ||
export function save(uri: Uri): Thenable<Uri | undefined>; | ||
|
||
/** | ||
* Saves the editor identified by the given resource to a new file name as provided by the user and | ||
* returns the resulting resource or `undefined` if save was not successful or cancelled. | ||
* | ||
* **Note** that an editor with the provided resource must be opened in order to be saved as. | ||
* | ||
* @param uri the associated uri for the opened editor to save as. | ||
* @return A thenable that resolves when the save-as operation has finished. | ||
*/ | ||
export function saveAs(uri: Uri): Thenable<Uri | undefined>; | ||
} | ||
} |