diff --git a/README.md b/README.md index 1bf8058..fe40696 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ esbuild or something similar should be used. ( https://deno.land/x/esbuild ) import { ExtensionContext, importVsCodeApi, -} from "https://deno.land/x/vscode@1.85.0/mod.ts"; +} from "https://deno.land/x/vscode@1.86.0/mod.ts"; export function activate(context: ExtensionContext) { const vscode = importVsCodeApi(); diff --git a/example/build.ts b/example/build.ts index 12863e4..c9113e9 100644 --- a/example/build.ts +++ b/example/build.ts @@ -32,7 +32,7 @@ const build = async (): Promise => { write: false, bundle: true, format: "cjs", - target: ["node18"], + target: ["node20"], }); for (const esbuildResultFile of esbuildResult.outputFiles ?? []) { diff --git a/gen/Cargo.lock b/gen/Cargo.lock index 951e42f..00fd30b 100644 --- a/gen/Cargo.lock +++ b/gen/Cargo.lock @@ -38,9 +38,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ast_node" @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.2" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "better_scoped_tls" @@ -99,21 +99,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" @@ -227,9 +227,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -248,36 +248,36 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-task", @@ -352,9 +352,9 @@ checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -423,9 +423,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -468,9 +468,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" @@ -511,15 +511,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" @@ -696,9 +696,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf_generator" @@ -762,9 +762,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -780,9 +780,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -857,9 +857,9 @@ checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64", "bytes", @@ -879,9 +879,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -920,18 +922,27 @@ version = "0.38.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee020b1716f0a80e2ace9b03441a749e402e86712f15f16fe8a8f75afac732f" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", "windows-sys", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "schannel" @@ -994,18 +1005,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.181" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3e73c93c3240c0bda063c239298e633114c69a888c3e37ca8bb33f343e9890" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.181" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be02f6cb0cd3a5ec20bbcfbcbd749f57daddb1a0882dc2e46a6c236c90b977ed" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", @@ -1014,9 +1025,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -1043,9 +1054,9 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -1213,7 +1224,7 @@ version = "0.107.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6528f3dd33e11eae9d7fe9fee4a79d5bbd211c74426ab2eec64dc82bd2eb74d" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "is-macro", "num-bigint", "scoped-tls", @@ -1325,15 +1336,21 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -1370,18 +1387,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", @@ -1405,9 +1422,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -1517,9 +1534,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-id" @@ -1550,9 +1567,9 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "url" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", diff --git a/gen/Cargo.toml b/gen/Cargo.toml index 9b2617a..330d203 100644 --- a/gen/Cargo.toml +++ b/gen/Cargo.toml @@ -6,10 +6,10 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -tokio = { version = "1.35.0", features = ["macros", "rt-multi-thread"] } -anyhow = "1.0.75" -reqwest = "0.11.22" -thiserror = "1.0.50" +tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } +anyhow = "1.0.79" +reqwest = "0.11.24" +thiserror = "1.0.56" swc_atoms = "0.5.9" swc_common = "0.31.22" swc_ecma_parser = "0.137.16" diff --git a/gen/out.ts b/gen/out.ts index 0619d9e..b828c1f 100644 --- a/gen/out.ts +++ b/gen/out.ts @@ -326,11 +326,11 @@ Returns VSCodeApi only within the vscode extension. * dispose-functions aren't awaited. * @returns Returns a new disposable which, upon dispose, will * dispose all provided disposables. - */ from(...disposableLikes: Array<{ + */ from(...disposableLikes: { /** * Function to clean up resources. */ dispose: () => any; - }>): Disposable; + }[]): Disposable; /** * Creates a new disposable that calls the provided function * on dispose. @@ -1764,7 +1764,7 @@ Returns VSCodeApi only within the vscode extension. * @param command The command to execute. * @param args The command arguments. * @param options Optional options for the started the shell. - */ new(command: string | ShellQuotedString, args: Array, options?: ShellExecutionOptions): ShellExecution; + */ new(command: string | ShellQuotedString, args: (string | ShellQuotedString)[], options?: ShellExecutionOptions): ShellExecution; }; /** * Class used to execute an extension callback as a task. @@ -3113,14 +3113,14 @@ Returns VSCodeApi only within the vscode extension. * Each workspace is identified with a mandatory URI and an optional name. * @returns true if the operation was successfully started and false otherwise if arguments were used that would result * in invalid workspace folder state (e.g. 2 folders with the same URI). - */ updateWorkspaceFolders(start: number, deleteCount: number | undefined | null, ...workspaceFoldersToAdd: Array<{ + */ updateWorkspaceFolders(start: number, deleteCount: number | undefined | null, ...workspaceFoldersToAdd: { /** * The uri of a workspace folder that's to be added. */ readonly uri: Uri; /** * The name of a workspace folder that's to be added. */ readonly name?: string; - }>): boolean; + }[]): boolean; /** * Creates a file system watcher that is notified on file events (create, change, delete) * depending on the parameters provided. @@ -3259,6 +3259,25 @@ Returns VSCodeApi only within the vscode extension. * @returns A thenable that resolves to an array of resource identifiers. Will return no results if no * {@link workspace.workspaceFolders workspace folders} are opened. */ findFiles(include: GlobPattern, exclude?: GlobPattern | null, maxResults?: number, token?: CancellationToken): Thenable; + /** + * Saves the editor identified by the given resource and returns the resulting resource or `undefined` + * if save was not successful or no editor with the given resource was found. + * + * **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. + * @returns A thenable that resolves when the save operation has finished. + */ save(uri: Uri): Thenable; + /** + * 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 or no editor + * with the given resource was found. + * + * **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. + * @returns A thenable that resolves when the save-as operation has finished. + */ saveAs(uri: Uri): Thenable; /** * Save all dirty files. * @@ -3544,7 +3563,8 @@ Returns VSCodeApi only within the vscode extension. */ readonly isCaseSensitive?: boolean; /** * Whether the file system provider is readonly, no modifications like write, delete, create are possible. - */ readonly isReadonly?: boolean; + * If a {@link MarkdownString} is given, it will be shown as the reason why the file system is readonly. + */ readonly isReadonly?: boolean | MarkdownString; }): Disposable; /** * When true, the user has explicitly trusted the contents of the workspace. @@ -3655,7 +3675,7 @@ Returns VSCodeApi only within the vscode extension. * Get all diagnostics. * * @returns An array of uri-diagnostics tuples or an empty array. - */ getDiagnostics(): Array<[Uri, Diagnostic[]]>; + */ getDiagnostics(): [Uri, Diagnostic[]][]; /** * Create a diagnostics collection. * @@ -4480,7 +4500,7 @@ Returns VSCodeApi only within the vscode extension. */ getExtension(extensionId: string): Extension | undefined; /** * All extensions currently known to the system. - */ readonly all: ReadonlyArray>; + */ readonly all: readonly Extension[]; /** * An event which fires when `extensions.all` changes. This can happen when extensions are * installed, uninstalled, enabled or disabled. @@ -6019,10 +6039,10 @@ type ValueOf = T[keyof T]; */ canSelectMany?: boolean; /** * A set of file filters that are used by the dialog. Each entry is a human-readable label, - * like "TypeScript", and an array of extensions, e.g. + * like "TypeScript", and an array of extensions, for example: * ```ts * { - * 'Images': ['png', 'jpg'] + * 'Images': ['png', 'jpg'], * 'TypeScript': ['ts', 'tsx'] * } * ``` @@ -6047,10 +6067,10 @@ type ValueOf = T[keyof T]; */ saveLabel?: string; /** * A set of file filters that are used by the dialog. Each entry is a human-readable label, - * like "TypeScript", and an array of extensions, e.g. + * like "TypeScript", and an array of extensions, for example: * ```ts * { - * 'Images': ['png', 'jpg'] + * 'Images': ['png', 'jpg'], * 'TypeScript': ['ts', 'tsx'] * } * ``` @@ -6410,7 +6430,7 @@ type ValueOf = T[keyof T]; * * We also support returning `Command` for legacy reasons, however all new extensions should return * `CodeAction` object instead. - */ provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult>; + */ provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken): ProviderResult<(Command | T)[]>; /** * Given a code action fill in its {@linkcode CodeAction.edit edit}-property. Changes to * all other properties, like title, are ignored. A code action that has an edit @@ -7102,7 +7122,7 @@ type ValueOf = T[keyof T]; * * @param uri A resource identifier. * @param edits An array of edits. - */ set(uri: Uri, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata]>): void; + */ set(uri: Uri, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata | undefined]>): void; /** * Set (and replace) notebook edits for a resource. * @@ -7114,7 +7134,7 @@ type ValueOf = T[keyof T]; * * @param uri A resource identifier. * @param edits An array of edits. - */ set(uri: Uri, edits: ReadonlyArray<[NotebookEdit, WorkspaceEditEntryMetadata]>): void; + */ set(uri: Uri, edits: ReadonlyArray<[NotebookEdit, WorkspaceEditEntryMetadata | undefined]>): void; /** * Get the text edits for a resource. * @@ -7178,7 +7198,7 @@ type ValueOf = T[keyof T]; * Get all text edits grouped by resource. * * @returns A shallow copy of `[Uri, TextEdit[]]`-tuples. - */ entries(): Array<[Uri, TextEdit[]]>; + */ entries(): [Uri, TextEdit[]][]; }; /** * A snippet string is a template which allows to insert text @@ -8342,7 +8362,7 @@ type ValueOf = T[keyof T]; */ kind: SymbolKind; /** * Tags for this item. - */ tags?: readonly SymbolTag[]; + */ tags?: ReadonlyArray; /** * More detail for this item, e.g. the signature of a function. */ detail?: string; @@ -8593,7 +8613,7 @@ type ValueOf = T[keyof T]; */ __characterPairSupport?: { /** * @deprecated - */ autoClosingPairs: Array<{ + */ autoClosingPairs: { /** * @deprecated */ open: string; @@ -8603,7 +8623,7 @@ type ValueOf = T[keyof T]; /** * @deprecated */ notIn?: string[]; - }>; + }[]; }; } /** @@ -9425,11 +9445,11 @@ type ValueOf = T[keyof T]; * extension is deactivated the disposables will be disposed. * * *Note* that asynchronous dispose-functions aren't awaited. - */ readonly subscriptions: Array<{ + */ readonly subscriptions: { /** * Function to clean up resources. */ dispose(): any; - }>; + }[]; /** * A memento object that stores state in the context * of the currently opened {@link workspace.workspaceFolders workspace}. @@ -9787,7 +9807,7 @@ type ValueOf = T[keyof T]; */ command: string | ShellQuotedString; /** * The shell args. Is `undefined` if created with a full command line. - */ args: Array; + */ args: (string | ShellQuotedString)[]; /** * The shell options used when the command line is executed in a shell. * Defaults to undefined. @@ -10083,7 +10103,7 @@ type ValueOf = T[keyof T]; * @param uri The uri of the folder. * @returns An array of name/type-tuples or a thenable that resolves to such. * @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `uri` doesn't exist. - */ readDirectory(uri: Uri): Array<[string, FileType]> | Thenable>; + */ readDirectory(uri: Uri): [string, FileType][] | Thenable<[string, FileType][]>; /** * Create a new directory (Note, that new files are created via `write`-calls). * @@ -10180,7 +10200,7 @@ type ValueOf = T[keyof T]; * * @param uri The uri of the folder. * @returns An array of name/type-tuples or a thenable that resolves to such. - */ readDirectory(uri: Uri): Thenable>; + */ readDirectory(uri: Uri): Thenable<[string, FileType][]>; /** * Create a new directory (Note, that new files are created via `write`-calls). * @@ -10661,7 +10681,7 @@ type ValueOf = T[keyof T]; * Provider for creating `WebviewView` elements. */ export interface WebviewViewProvider { /** - * Revolves a webview view. + * Resolves a webview view. * * `resolveWebviewView` is called when a view first becomes visible. This may happen when the view is * first loaded or when the user hides and then shows a view again. @@ -11422,7 +11442,7 @@ type ValueOf = T[keyof T]; /** * Ranges in the label to highlight. A range is defined as a tuple of two number where the * first is the inclusive start index and the second the exclusive end index - */ highlights?: Array<[number, number]>; + */ highlights?: [number, number][]; } /** * Checkbox state of the tree item @@ -13903,7 +13923,14 @@ type ValueOf = T[keyof T]; * the generic "run all" button, then the default profile for * {@link TestRunProfileKind.Run} will be executed, although the * user can configure this. + * + * Changes the user makes in their default profiles will be reflected + * in this property after a {@link onDidChangeDefault} event. */ isDefault: boolean; + /** + * Fired when a user has changed whether this is a default profile. The + * event contains the new value of {@link isDefault} + */ onDidChangeDefault: Event; /** * Whether this profile supports continuous running of requests. If so, * then {@link TestRunRequest.continuous} may be set to `true`. Defaults diff --git a/mod.ts b/mod.ts index e38e599..8b3c3e1 100644 --- a/mod.ts +++ b/mod.ts @@ -343,11 +343,11 @@ Returns VSCodeApi only within the vscode extension. * @returns Returns a new disposable which, upon dispose, will * dispose all provided disposables. */ from( - ...disposableLikes: Array<{ + ...disposableLikes: { /** * Function to clean up resources. */ dispose: () => any; - }> + }[] ): Disposable; /** * Creates a new disposable that calls the provided function @@ -1896,7 +1896,7 @@ Returns VSCodeApi only within the vscode extension. * @param options Optional options for the started the shell. */ new ( command: string | ShellQuotedString, - args: Array, + args: (string | ShellQuotedString)[], options?: ShellExecutionOptions, ): ShellExecution; }; @@ -3446,14 +3446,14 @@ Returns VSCodeApi only within the vscode extension. */ updateWorkspaceFolders( start: number, deleteCount: number | undefined | null, - ...workspaceFoldersToAdd: Array<{ + ...workspaceFoldersToAdd: { /** * The uri of a workspace folder that's to be added. */ readonly uri: Uri; /** * The name of a workspace folder that's to be added. */ readonly name?: string; - }> + }[] ): boolean; /** * Creates a file system watcher that is notified on file events (create, change, delete) @@ -3603,6 +3603,25 @@ Returns VSCodeApi only within the vscode extension. maxResults?: number, token?: CancellationToken, ): Thenable; + /** + * Saves the editor identified by the given resource and returns the resulting resource or `undefined` + * if save was not successful or no editor with the given resource was found. + * + * **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. + * @returns A thenable that resolves when the save operation has finished. + */ save(uri: Uri): Thenable; + /** + * 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 or no editor + * with the given resource was found. + * + * **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. + * @returns A thenable that resolves when the save-as operation has finished. + */ saveAs(uri: Uri): Thenable; /** * Save all dirty files. * @@ -3910,7 +3929,8 @@ Returns VSCodeApi only within the vscode extension. */ readonly isCaseSensitive?: boolean; /** * Whether the file system provider is readonly, no modifications like write, delete, create are possible. - */ readonly isReadonly?: boolean; + * If a {@link MarkdownString} is given, it will be shown as the reason why the file system is readonly. + */ readonly isReadonly?: boolean | MarkdownString; }, ): Disposable; /** @@ -4025,7 +4045,7 @@ Returns VSCodeApi only within the vscode extension. * Get all diagnostics. * * @returns An array of uri-diagnostics tuples or an empty array. - */ getDiagnostics(): Array<[Uri, Diagnostic[]]>; + */ getDiagnostics(): [Uri, Diagnostic[]][]; /** * Create a diagnostics collection. * @@ -5023,7 +5043,7 @@ Returns VSCodeApi only within the vscode extension. */ getExtension(extensionId: string): Extension | undefined; /** * All extensions currently known to the system. - */ readonly all: ReadonlyArray>; + */ readonly all: readonly Extension[]; /** * An event which fires when `extensions.all` changes. This can happen when extensions are * installed, uninstalled, enabled or disabled. @@ -6622,10 +6642,10 @@ type ValueOf = T[keyof T]; */ canSelectMany?: boolean; /** * A set of file filters that are used by the dialog. Each entry is a human-readable label, - * like "TypeScript", and an array of extensions, e.g. + * like "TypeScript", and an array of extensions, for example: * ```ts * { - * 'Images': ['png', 'jpg'] + * 'Images': ['png', 'jpg'], * 'TypeScript': ['ts', 'tsx'] * } * ``` @@ -6650,10 +6670,10 @@ type ValueOf = T[keyof T]; */ saveLabel?: string; /** * A set of file filters that are used by the dialog. Each entry is a human-readable label, - * like "TypeScript", and an array of extensions, e.g. + * like "TypeScript", and an array of extensions, for example: * ```ts * { - * 'Images': ['png', 'jpg'] + * 'Images': ['png', 'jpg'], * 'TypeScript': ['ts', 'tsx'] * } * ``` @@ -7037,7 +7057,7 @@ type ValueOf = T[keyof T]; range: Range | Selection, context: CodeActionContext, token: CancellationToken, - ): ProviderResult>; + ): ProviderResult<(Command | T)[]>; /** * Given a code action fill in its {@linkcode CodeAction.edit edit}-property. Changes to * all other properties, like title, are ignored. A code action that has an edit @@ -7809,7 +7829,7 @@ type ValueOf = T[keyof T]; */ set( uri: Uri, edits: ReadonlyArray< - [TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata] + [TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata | undefined] >, ): void; /** @@ -7825,7 +7845,9 @@ type ValueOf = T[keyof T]; * @param edits An array of edits. */ set( uri: Uri, - edits: ReadonlyArray<[NotebookEdit, WorkspaceEditEntryMetadata]>, + edits: ReadonlyArray< + [NotebookEdit, WorkspaceEditEntryMetadata | undefined] + >, ): void; /** * Get the text edits for a resource. @@ -7890,7 +7912,7 @@ type ValueOf = T[keyof T]; * Get all text edits grouped by resource. * * @returns A shallow copy of `[Uri, TextEdit[]]`-tuples. - */ entries(): Array<[Uri, TextEdit[]]>; + */ entries(): [Uri, TextEdit[]][]; }; /** * A snippet string is a template which allows to insert text @@ -9171,7 +9193,7 @@ type ValueOf = T[keyof T]; */ kind: SymbolKind; /** * Tags for this item. - */ tags?: readonly SymbolTag[]; + */ tags?: ReadonlyArray; /** * More detail for this item, e.g. the signature of a function. */ detail?: string; @@ -9441,7 +9463,7 @@ type ValueOf = T[keyof T]; */ __characterPairSupport?: { /** * @deprecated - */ autoClosingPairs: Array<{ + */ autoClosingPairs: { /** * @deprecated */ open: string; @@ -9451,7 +9473,7 @@ type ValueOf = T[keyof T]; /** * @deprecated */ notIn?: string[]; - }>; + }[]; }; } /** @@ -10303,11 +10325,11 @@ type ValueOf = T[keyof T]; * extension is deactivated the disposables will be disposed. * * *Note* that asynchronous dispose-functions aren't awaited. - */ readonly subscriptions: Array<{ + */ readonly subscriptions: { /** * Function to clean up resources. */ dispose(): any; - }>; + }[]; /** * A memento object that stores state in the context * of the currently opened {@link workspace.workspaceFolders workspace}. @@ -10666,7 +10688,7 @@ type ValueOf = T[keyof T]; */ command: string | ShellQuotedString; /** * The shell args. Is `undefined` if created with a full command line. - */ args: Array; + */ args: (string | ShellQuotedString)[]; /** * The shell options used when the command line is executed in a shell. * Defaults to undefined. @@ -10966,7 +10988,7 @@ type ValueOf = T[keyof T]; * @throws {@linkcode FileSystemError.FileNotFound FileNotFound} when `uri` doesn't exist. */ readDirectory( uri: Uri, - ): Array<[string, FileType]> | Thenable>; + ): [string, FileType][] | Thenable<[string, FileType][]>; /** * Create a new directory (Note, that new files are created via `write`-calls). * @@ -11063,7 +11085,7 @@ type ValueOf = T[keyof T]; * * @param uri The uri of the folder. * @returns An array of name/type-tuples or a thenable that resolves to such. - */ readDirectory(uri: Uri): Thenable>; + */ readDirectory(uri: Uri): Thenable<[string, FileType][]>; /** * Create a new directory (Note, that new files are created via `write`-calls). * @@ -11549,7 +11571,7 @@ type ValueOf = T[keyof T]; * Provider for creating `WebviewView` elements. */ export interface WebviewViewProvider { /** - * Revolves a webview view. + * Resolves a webview view. * * `resolveWebviewView` is called when a view first becomes visible. This may happen when the view is * first loaded or when the user hides and then shows a view again. @@ -12372,7 +12394,7 @@ type ValueOf = T[keyof T]; /** * Ranges in the label to highlight. A range is defined as a tuple of two number where the * first is the inclusive start index and the second the exclusive end index - */ highlights?: Array<[number, number]>; + */ highlights?: [number, number][]; } /** * Checkbox state of the tree item @@ -14973,7 +14995,14 @@ type ValueOf = T[keyof T]; * the generic "run all" button, then the default profile for * {@link TestRunProfileKind.Run} will be executed, although the * user can configure this. + * + * Changes the user makes in their default profiles will be reflected + * in this property after a {@link onDidChangeDefault} event. */ isDefault: boolean; + /** + * Fired when a user has changed whether this is a default profile. The + * event contains the new value of {@link isDefault} + */ onDidChangeDefault: Event; /** * Whether this profile supports continuous running of requests. If so, * then {@link TestRunRequest.continuous} may be set to `true`. Defaults