Skip to content

Commit

Permalink
use proposed api for autoclosing
Browse files Browse the repository at this point in the history
  • Loading branch information
colombod committed Jul 26, 2023
1 parent fc216b0 commit d0fb7fd
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 11 deletions.
12 changes: 5 additions & 7 deletions src/polyglot-notebooks-vscode-insiders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"author": "Microsoft Corporation",
"license": "MIT",
"enabledApiProposals": [
"notebookMessaging"
"notebookMessaging",
"languageConfigurationAutoClosingPairs"
],
"preview": false,
"//version": "%description.version%",
"version": "42.42.42",
"engines": {
"vscode": "^1.78.0"
"vscode": "^1.81.0"
},
"bugs": {
"url": "https://github.com/dotnet/interactive/issues"
Expand Down Expand Up @@ -219,7 +220,7 @@
},
"dotnet-interactive.requiredInteractiveToolVersion": {
"type": "string",
"default": "1.0.435502",
"default": "1.0.437401",
"description": "%description.requiredInteractiveToolVersion%"
}
}
Expand Down Expand Up @@ -490,9 +491,6 @@
"polyglot-notebook-comment": [
"comment"
],
"polyglot-notebook-string-quoted-docstring": [
"string.quoted.docstring"
],
"polyglot-notebook-constant-language": [
"constant.language"
],
Expand Down Expand Up @@ -847,4 +845,4 @@
"vscode-uri": "3.0.6",
"@vscode/l10n": "0.0.10"
}
}
}
23 changes: 23 additions & 0 deletions src/polyglot-notebooks-vscode-insiders/src/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,11 @@ declare module 'vscode' {
*/
kind?: QuickPickItemKind;

/**
* The icon path or {@link ThemeIcon} for the QuickPickItem.
*/
iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;

/**
* A human-readable string which is rendered less prominent in the same line. Supports rendering of
* {@link ThemeIcon theme icons} via the `$(<name>)`-syntax.
Expand Down Expand Up @@ -16299,6 +16304,24 @@ declare module 'vscode' {
*/
createTestItem(id: string, label: string, uri?: Uri): TestItem;

/**
* Marks an item's results as being outdated. This is commonly called when
* code or configuration changes and previous results should no longer
* be considered relevant. The same logic used to mark results as outdated
* may be used to drive {@link TestRunRequest.continuous continuous test runs}.
*
* If an item is passed to this method, test results for the item and all of
* its children will be marked as outdated. If no item is passed, then all
* test owned by the TestController will be marked as outdated.
*
* Any test runs started before the moment this method is called, including
* runs which may still be ongoing, will be marked as outdated and deprioritized
* in the editor's UI.
*
* @param item Item to mark as outdated. If undefined, all the controller's items are marked outdated.
*/
invalidateTestResults(items?: TestItem | readonly TestItem[]): void;

/**
* Unregisters the test controller, disposing of its associated tests
* and unpersisted results.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

declare module 'vscode' {

// https://github.com/microsoft/vscode/issues/173738

export interface LanguageConfiguration {
autoClosingPairs?: {
open: string;
close: string;
notIn?: string[];
}[];
}
}
3 changes: 3 additions & 0 deletions src/polyglot-notebooks-vscode/do-version-upgrade.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ try {

$stablePackageJsonContents.scripts.package = $stablePackageJsonContents.scripts.package.Replace("--pre-release","").Trim()

# ensure the stable is using the available proposed apis
$stablePackageJsonContents.enabledApiProposals = @("notebookMessaging")

$stablePackageJsonContents | ConvertTo-Json -depth 100 | Out-File "$stableDirectory\package.json"

# copy grammar files
Expand Down
5 changes: 1 addition & 4 deletions src/polyglot-notebooks-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
},
"dotnet-interactive.requiredInteractiveToolVersion": {
"type": "string",
"default": "1.0.435502",
"default": "1.0.437401",
"description": "%description.requiredInteractiveToolVersion%"
}
}
Expand Down Expand Up @@ -490,9 +490,6 @@
"polyglot-notebook-comment": [
"comment"
],
"polyglot-notebook-string-quoted-docstring": [
"string.quoted.docstring"
],
"polyglot-notebook-constant-language": [
"constant.language"
],
Expand Down
4 changes: 4 additions & 0 deletions src/polyglot-notebooks-vscode/update-api.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ try {
function DownloadVsCodeApi([string] $branchName, [string] $destinationDirectory, [bool] $isInsiders = $false) {
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/microsoft/vscode/$branchName/src/vscode-dts/vscode.d.ts" -OutFile "$PSScriptRoot\$destinationDirectory\vscode.d.ts"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/microsoft/vscode/$branchName/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts" -OutFile "$PSScriptRoot\$destinationDirectory\vscode.proposed.notebookMessaging.d.ts"
if ($isInsiders) {
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/microsoft/vscode/$branchName/src/vscode-dts/vscode.proposed.languageConfigurationAutoClosingPairs.d.ts" -OutFile "$PSScriptRoot\$destinationDirectory\vscode.proposed.languageConfigurationAutoClosingPairs.d.ts"
}

}

# stable
Expand Down

0 comments on commit d0fb7fd

Please sign in to comment.