From 03b5b73d8ab77a4823a2a6fb07fc1d31ab4e1932 Mon Sep 17 00:00:00 2001 From: Jens Fischer Date: Mon, 21 Dec 2020 17:31:59 +0100 Subject: [PATCH] Update to 1.51 https://github.com/microsoft/vscode/compare/1.50.1...1.51.0 --- README.md | 2 +- doc.hxml | 2 +- haxelib.json | 4 ++-- src/Vscode.hx | 3 ++- src/vscode/CommentThread.hx | 6 ++++++ src/vscode/DocumentFilter.hx | 6 +++--- src/vscode/DocumentSelector.hx | 2 +- src/vscode/ExtensionContext.hx | 24 ++++++++++++++++++++---- src/vscode/ThemeIcon.hx | 13 ++++++++++++- 9 files changed, 48 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1abd07d9..35f7bce3 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This extern library makes it possible to write extensions for [Visual Studio Code](https://code.visualstudio.com/) using [Haxe](https://haxe.org/). -VS Code API version: **1.50** +VS Code API version: **1.51** **NOTE**: Requires Haxe 4 or later diff --git a/doc.hxml b/doc.hxml index b5a67987..22849e17 100644 --- a/doc.hxml +++ b/doc.hxml @@ -6,4 +6,4 @@ -xml out/js.xml --next --cmd haxelib run dox -i out -o out -in "^[vV]scode*" --title "Haxe externs for Visual Studio Code - API documentation" -D version 1.50.1 -D themeColor 0x141419 -D textColor 0xFFFFFF -D logo "https://avatars3.githubusercontent.com/u/19169749?v=3&s=100" -D source-path https://github.com/vshaxe/vscode-extern/blob/master/src/ -D website "https://github.com/vshaxe/" +-cmd haxelib run dox -i out -o out -in "^[vV]scode*" --title "Haxe externs for Visual Studio Code - API documentation" -D version 1.51.0 -D themeColor 0x141419 -D textColor 0xFFFFFF -D logo "https://avatars3.githubusercontent.com/u/19169749?v=3&s=100" -D source-path https://github.com/vshaxe/vscode-extern/blob/master/src/ -D website "https://github.com/vshaxe/" diff --git a/haxelib.json b/haxelib.json index ed03b261..04193656 100644 --- a/haxelib.json +++ b/haxelib.json @@ -3,8 +3,8 @@ "description": "Visual Studio Code extern library", "url": "https://github.com/vshaxe/vscode-extern", "license": "MIT", - "version": "1.50.1", - "releasenote": "Update to VSCode 1.50", + "version": "1.51.0", + "releasenote": "Update to VSCode 1.51", "classPath": "src", "contributors": ["nadako", "Gama11"], "dependencies": { diff --git a/src/Vscode.hx b/src/Vscode.hx index 88b5c3bd..d1428339 100644 --- a/src/Vscode.hx +++ b/src/Vscode.hx @@ -307,7 +307,8 @@ extern class VscodeCommands { * Text editor commands are different from ordinary [commands](#commands.registerCommand) as * they only execute when there is an active editor when the command is called. Also, the * command handler of an editor command has access to the active editor and to an - * [edit](#TextEditorEdit)-builder. + * [edit](#TextEditorEdit)-builder. Note that the edit-builder is only valid while the + * callback executes. * * @param command A unique identifier for the command. * @param callback A command handler function with access to an [editor](#TextEditor) and an [edit](#TextEditorEdit). diff --git a/src/vscode/CommentThread.hx b/src/vscode/CommentThread.hx index ec1b4a6e..91469bab 100644 --- a/src/vscode/CommentThread.hx +++ b/src/vscode/CommentThread.hx @@ -26,6 +26,12 @@ typedef CommentThread = { */ var collapsibleState:CommentThreadCollapsibleState; + /** + * Whether the thread supports reply. + * Defaults to true. + */ + var canReply:Bool; + /** * Context value of the comment thread. This can be used to contribute thread specific actions. * For example, a comment thread is given a context value as `editable`. When contributing actions to `comments/commentThread/title` diff --git a/src/vscode/DocumentFilter.hx b/src/vscode/DocumentFilter.hx index 11bf5d7a..860db25b 100644 --- a/src/vscode/DocumentFilter.hx +++ b/src/vscode/DocumentFilter.hx @@ -15,16 +15,16 @@ typedef DocumentFilter = { /** * A language id, like `typescript`. */ - var ?language:String; + final ?language:String; /** * A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ - var ?scheme:String; + final ?scheme:String; /** * A [glob pattern](#GlobPattern) that is matched on the absolute path of the document. Use a [relative pattern](#RelativePattern) * to filter documents to a [workspace folder](#WorkspaceFolder). */ - var ?pattern:GlobPattern; + final ?pattern:GlobPattern; } diff --git a/src/vscode/DocumentSelector.hx b/src/vscode/DocumentSelector.hx index c552a6be..e8e16bb3 100644 --- a/src/vscode/DocumentSelector.hx +++ b/src/vscode/DocumentSelector.hx @@ -12,6 +12,6 @@ package vscode; * @example * let sel:DocumentSelector = { scheme: 'file', language: 'typescript' }; */ -typedef DocumentSelector = EitherType>; +typedef DocumentSelector = EitherType>; typedef DocumentSelectorSimple = EitherType; diff --git a/src/vscode/ExtensionContext.hx b/src/vscode/ExtensionContext.hx index 47d5b43a..e399d56b 100644 --- a/src/vscode/ExtensionContext.hx +++ b/src/vscode/ExtensionContext.hx @@ -18,7 +18,23 @@ typedef ExtensionContext = { * A memento object that stores state in the context * of the currently opened [workspace](#workspace.workspaceFolders). */ - var workspaceState(default, null):Memento; + var workspaceState(default, null):Memento & { + + /** + * Set the keys whose values should be synchronized across devices when synchronizing user-data + * like configuration, extensions, and mementos. + * + * Note that this function defines the whole set of keys whose values are synchronized: + * - calling it with an empty array stops synchronization for this memento + * - calling it with a non-empty array replaces all keys whose values are synchronized + * + * For any given set of keys this function needs to be called only once but there is no harm in + * repeatedly calling it. + * + * @param keys The set of keys whose values are synced. + */ + function setKeysForSync(keys:Array):Void; + }; /** * A memento object that stores state independent @@ -46,7 +62,7 @@ typedef ExtensionContext = { * Get the absolute path of a resource contained in the extension. * * *Note* that an absolute uri can be constructed via [`Uri.joinPath`](#Uri.joinPath) and - * [`extensionUri`](#ExtensionContent.extensionUri), e.g. `vscode.Uri.joinPath(context.extensionUri, relativePath);` + * [`extensionUri`](#ExtensionContext.extensionUri), e.g. `vscode.Uri.joinPath(context.extensionUri, relativePath);` * * @param relativePath A relative path to a resource contained in the extension. * @return The absolute path of the resource. @@ -75,7 +91,7 @@ typedef ExtensionContext = { * Use [`workspaceState`](#ExtensionContext.workspaceState) or * [`globalState`](#ExtensionContext.globalState) to store key value data. */ - @:deprecated("Use [storagePath](#ExtensionContent.storageUri) instead.") + @:deprecated("Use [storageUri](#ExtensionContext.storageUri) instead.") var storagePath(default, null):Null; /** @@ -97,7 +113,7 @@ typedef ExtensionContext = { * * Use [`globalState`](#ExtensionContext.globalState) to store key value data. */ - @:deprecated("Use [globalStoragePath](#ExtensionContent.globalStorageUri) instead.") + @:deprecated("Use [globalStorageUri](#ExtensionContext.globalStorageUri) instead.") var globalStoragePath(default, null):String; /** diff --git a/src/vscode/ThemeIcon.hx b/src/vscode/ThemeIcon.hx index 1658dbcc..dc6c03ed 100644 --- a/src/vscode/ThemeIcon.hx +++ b/src/vscode/ThemeIcon.hx @@ -20,9 +20,20 @@ extern class ThemeIcon { */ static var Folder(default, never):ThemeIcon; + /** + * The id of the icon. The available icons are listed in https://microsoft.github.io/vscode-codicons/dist/codicon.html. + */ + var id(default, null):String; + + /** + * The optional ThemeColor of the icon. The color is currently only used in [TreeItem](#TreeItem). + */ + var color(default, null):Null; + /** * Creates a reference to a theme icon. * @param id id of the icon. The available icons are listed in https://microsoft.github.io/vscode-codicons/dist/codicon.html. + * @param color optional `ThemeColor` for the icon. The color is currently only used in [TreeItem](#TreeItem). */ - function new(id:String); + function new(id:String, ?color:ThemeColor); }