Skip to content

Commit 958ebdd

Browse files
committed
move api out of proposed, #1800
1 parent 9ac1af4 commit 958ebdd

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

src/vs/vscode.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -7477,6 +7477,19 @@ declare module 'vscode' {
74777477
*/
74787478
export function getLanguages(): Thenable<string[]>;
74797479

7480+
/**
7481+
* Set (and change) the [language](#TextDocument.languageId) that is associated
7482+
* with the given document.
7483+
*
7484+
* *Note* that calling this function will trigger the [`onDidCloseTextDocument`](#workspace.onDidCloseTextDocument) event
7485+
* followed by the [`onDidOpenTextDocument`](#workspace.onDidOpenTextDocument) event.
7486+
*
7487+
* @param document The document which language is to be changed
7488+
* @param languageId The new language identifier.
7489+
* @returns A thenable that resolves with the updated document.
7490+
*/
7491+
export function setTextDocumentLanguage(document: TextDocument, languageId: string): Thenable<TextDocument>;
7492+
74807493
/**
74817494
* Compute the match between a document [selector](#DocumentSelector) and a document. Values
74827495
* greater than zero mean the selector matches the document.

src/vs/vscode.proposed.d.ts

-20
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@ declare module 'vscode' {
1111
export function sampleFunction(): Thenable<any>;
1212
}
1313

14-
//#region Joh - https://github.com/Microsoft/vscode/issues/1800
15-
16-
export namespace languages {
17-
18-
/**
19-
* Set (and change) the [language](#TextDocument.languageId) that is associated
20-
* with the given document.
21-
*
22-
* *Note* that calling this function will trigger the [`onDidCloseTextDocument`](#languages.onDidCloseTextDocument) event
23-
* followed by the [`onDidOpenTextDocument`](#languages.onDidOpenTextDocument) event.
24-
*
25-
* @param document The document which language is to be changed
26-
* @param languageId The new language identifier.
27-
* @returns A thenable that resolves with the updated document.
28-
*/
29-
export function setTextDocumentLanguage(document: TextDocument, languageId: string): Thenable<TextDocument>;
30-
}
31-
32-
//#endregion
33-
3414
//#region Joh - read/write in chunks
3515

3616
export interface FileSystemProvider {

src/vs/workbench/api/node/extHost.api.impl.ts

-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ export function createApiFactory(
270270
return extHostLanguages.getLanguages();
271271
},
272272
setTextDocumentLanguage(document: vscode.TextDocument, languageId: string): Thenable<vscode.TextDocument> {
273-
checkProposedApiEnabled(extension);
274273
return extHostLanguages.changeLanguage(document.uri, languageId);
275274
},
276275
match(selector: vscode.DocumentSelector, document: vscode.TextDocument): number {

0 commit comments

Comments
 (0)