vscode-cpptools
Advanced tools
+53
-26
@@ -8,3 +8,2 @@ /* -------------------------------------------------------------------------------------------- | ||
| import * as vscode from 'vscode'; | ||
| import { CancellationToken } from 'vscode-jsonrpc'; | ||
@@ -20,3 +19,4 @@ /** | ||
| v4 = 4, // 4.x.x | ||
| latest = v4 | ||
| v5 = 5, // 5.x.x | ||
| latest = v5 | ||
| } | ||
@@ -91,3 +91,3 @@ | ||
| */ | ||
| canProvideConfiguration(uri: vscode.Uri, token?: CancellationToken): Thenable<boolean>; | ||
| canProvideConfiguration(uri: vscode.Uri, token?: vscode.CancellationToken): Thenable<boolean>; | ||
@@ -104,3 +104,3 @@ /** | ||
| */ | ||
| provideConfigurations(uris: vscode.Uri[], token?: CancellationToken): Thenable<SourceFileConfigurationItem[]>; | ||
| provideConfigurations(uris: vscode.Uri[], token?: vscode.CancellationToken): Thenable<SourceFileConfigurationItem[]>; | ||
@@ -112,3 +112,3 @@ /** | ||
| */ | ||
| canProvideBrowseConfiguration(token?: CancellationToken): Thenable<boolean>; | ||
| canProvideBrowseConfiguration(token?: vscode.CancellationToken): Thenable<boolean>; | ||
@@ -119,5 +119,7 @@ /** | ||
| * @returns A [WorkspaceBrowseConfiguration](#WorkspaceBrowseConfiguration) with the information required to | ||
| * construct the equivalent of `browse.path` from `c_cpp_properties.json`. | ||
| * construct the equivalent of `browse.path` from `c_cpp_properties.json`. If there is no configuration to report, or | ||
| * the provider indicated that it cannot provide a [WorkspaceBrowseConfiguration](#WorkspaceBrowseConfiguration) | ||
| * then `null` should be returned. | ||
| */ | ||
| provideBrowseConfiguration(token?: CancellationToken): Thenable<WorkspaceBrowseConfiguration>; | ||
| provideBrowseConfiguration(token?: vscode.CancellationToken): Thenable<WorkspaceBrowseConfiguration | null>; | ||
@@ -129,3 +131,3 @@ /** | ||
| */ | ||
| canProvideBrowseConfigurationsPerFolder(token?: CancellationToken): Thenable<boolean>; | ||
| canProvideBrowseConfigurationsPerFolder(token?: vscode.CancellationToken): Thenable<boolean>; | ||
@@ -137,5 +139,7 @@ /** | ||
| * @returns A [WorkspaceBrowseConfiguration](#WorkspaceBrowseConfiguration) with the information required to | ||
| * construct the equivalent of `browse.path` from `c_cpp_properties.json`. | ||
| * construct the equivalent of `browse.path` from `c_cpp_properties.json`. If there is no configuration for this folder, or | ||
| * the provider indicated that it cannot provide a [WorkspaceBrowseConfiguration](#WorkspaceBrowseConfiguration) per folder | ||
| * then `null` should be returned. | ||
| */ | ||
| provideFolderBrowseConfiguration(uri: vscode.Uri, token?: CancellationToken): Thenable<WorkspaceBrowseConfiguration>; | ||
| provideFolderBrowseConfiguration(uri: vscode.Uri, token?: vscode.CancellationToken): Thenable<WorkspaceBrowseConfiguration | null>; | ||
| } | ||
@@ -161,5 +165,15 @@ | ||
| /** | ||
| * The compiler to emulate. | ||
| * The platform, compiler, and architecture variant to emulate. | ||
| * IntelliSenseMode values without a platform variant will resolve to a value that matches | ||
| * the host platform. For example, if the host platform is Windows and the IntelliSenseMode | ||
| * is "clang-x64", then "clang-x64" will resolve to "windows-clang-x64". | ||
| */ | ||
| readonly intelliSenseMode: "msvc-x86" | "msvc-x64" | "msvc-arm" | "msvc-arm64" | | ||
| readonly intelliSenseMode?: "linux-clang-x86" | "linux-clang-x64" | "linux-clang-arm" | "linux-clang-arm64" | | ||
| "linux-gcc-x86" | "linux-gcc-x64" | "linux-gcc-arm" | "linux-gcc-arm64" | | ||
| "macos-clang-x86" | "macos-clang-x64" | "macos-clang-arm" | "macos-clang-arm64" | | ||
| "macos-gcc-x86" | "macos-gcc-x64" | "macos-gcc-arm" | "macos-gcc-arm64" | | ||
| "windows-clang-x86" | "windows-clang-x64" | "windows-clang-arm" | "windows-clang-arm64" | | ||
| "windows-gcc-x86" | "windows-gcc-x64" | "windows-gcc-arm" | "windows-gcc-arm64" | | ||
| "windows-msvc-x86" | "windows-msvc-x64" | "windows-msvc-arm" | "windows-msvc-arm64" | | ||
| "msvc-x86" | "msvc-x64" | "msvc-arm" | "msvc-arm64" | | ||
| "gcc-x86" | "gcc-x64" | "gcc-arm" | "gcc-arm64" | | ||
@@ -171,4 +185,4 @@ "clang-x86" | "clang-x64" | "clang-arm" | "clang-arm64"; | ||
| */ | ||
| readonly standard: "c89" | "c99" | "c11" | "c18" | "c++98" | "c++03" | "c++11" | "c++14" | "c++17" | "c++20" | | ||
| "gnu89" | "gnu99" | "gnu11" | "gnu18" | "gnu++98" | "gnu++03" | "gnu++11" | "gnu++14" | "gnu++17" | "gnu++20"; | ||
| readonly standard?: "c89" | "c99" | "c11" | "c17" | "c++98" | "c++03" | "c++11" | "c++14" | "c++17" | "c++20" | | ||
| "gnu89" | "gnu99" | "gnu11" | "gnu17" | "gnu++98" | "gnu++03" | "gnu++11" | "gnu++14" | "gnu++17" | "gnu++20"; | ||
| /** | ||
@@ -247,4 +261,4 @@ * Any files that need to be included before the source file is parsed. | ||
| */ | ||
| readonly standard?: "c89" | "c99" | "c11" | "c18" | "c++98" | "c++03" | "c++11" | "c++14" | "c++17" | "c++20" | | ||
| "gnu89" | "gnu99" | "gnu11" | "gnu18" | "gnu++98" | "gnu++03" | "gnu++11" | "gnu++14" | "gnu++17" | "gnu++20"; | ||
| readonly standard?: "c89" | "c99" | "c11" | "c17" | "c++98" | "c++03" | "c++11" | "c++14" | "c++17" | "c++20" | | ||
| "gnu89" | "gnu99" | "gnu11" | "gnu17" | "gnu++98" | "gnu++03" | "gnu++11" | "gnu++14" | "gnu++17" | "gnu++20"; | ||
| /** | ||
@@ -271,7 +285,18 @@ * The version of the Windows SDK that should be used. This field defaults to the latest Windows SDK | ||
| function isCppToolsExtension(extension: CppToolsApi | CppToolsExtension): extension is CppToolsExtension { | ||
| return (<CppToolsExtension>extension).getApi !== undefined; | ||
| /** | ||
| * Check if an object satisfies the contract of the CppToolsExtension interface. | ||
| */ | ||
| function isCppToolsExtension(extension: any): extension is CppToolsExtension { | ||
| return extension && extension.getApi; | ||
| } | ||
| /** | ||
| * Check if an object satisfies the contract of the first version of the CppToolsApi. | ||
| * (The first release of the API only had two functions) | ||
| */ | ||
| function isLegacyCppToolsApi(api: any): api is CppToolsApi { | ||
| return api && api.registerCustomConfigurationProvider && api.didChangeCustomConfiguration | ||
| } | ||
| /** | ||
| * Helper function to get the CppToolsApi from the cpptools extension. | ||
@@ -302,4 +327,4 @@ * @param version The desired API version | ||
| let cpptools: vscode.Extension<any> | undefined = vscode.extensions.getExtension("ms-vscode.cpptools"); | ||
| let extension: CppToolsApi | CppToolsExtension; | ||
| let api: CppToolsApi | undefined; | ||
| let extension: CppToolsApi | CppToolsExtension | undefined = undefined; | ||
| let api: CppToolsApi | undefined = undefined; | ||
@@ -321,3 +346,3 @@ if (cpptools) { | ||
| let e: RangeError = <RangeError>err; | ||
| if (e.message && e.message.startsWith("Invalid version")) { | ||
| if (e && e.message && e.message.startsWith("Invalid version")) { | ||
| api = extension.getApi(Version.v1); | ||
@@ -329,18 +354,20 @@ } | ||
| if (!api.getVersion) { | ||
| console.warn(`vscode-cpptools-api version ${version} requested, but is not available in the current version of the cpptools extension. Using version 1 instead.`); | ||
| console.warn(`[vscode-cpptools-api] version ${version} requested, but is not available in the current version of the cpptools extension. Using version 1 instead.`); | ||
| } else if (version !== api.getVersion()) { | ||
| console.warn(`vscode-cpptools-api version ${version} requested, but is not available in the current version of the cpptools extension. Using version ${api.getVersion()} instead.`); | ||
| console.warn(`[vscode-cpptools-api] version ${version} requested, but is not available in the current version of the cpptools extension. Using version ${api.getVersion()} instead.`); | ||
| } | ||
| } | ||
| } else { | ||
| } else if (isLegacyCppToolsApi(extension)) { | ||
| // ms-vscode.cpptools version 0.17.5 | ||
| api = extension; | ||
| if (version !== Version.v0) { | ||
| console.warn(`vscode-cpptools-api version ${version} requested, but is not available in version 0.17.5 of the cpptools extension. Using version 0 instead.`); | ||
| console.warn(`[vscode-cpptools-api] version ${version} requested, but is not available in version 0.17.5 of the cpptools extension. Using version 0 instead.`); | ||
| } | ||
| } else { | ||
| console.warn('[vscode-cpptools-api] No cpptools API was found.') | ||
| } | ||
| } else { | ||
| console.warn("C/C++ extension is not installed"); | ||
| console.warn('[vscode-cpptools-api] C/C++ extension is not installed'); | ||
| } | ||
| return api; | ||
| } |
+21
-14
| import * as vscode from 'vscode'; | ||
| import { CancellationToken } from 'vscode-jsonrpc'; | ||
| /** | ||
@@ -12,3 +11,4 @@ * API version information. | ||
| v4 = 4, | ||
| latest = 4 | ||
| v5 = 5, | ||
| latest = 5 | ||
| } | ||
@@ -75,3 +75,3 @@ /** | ||
| */ | ||
| canProvideConfiguration(uri: vscode.Uri, token?: CancellationToken): Thenable<boolean>; | ||
| canProvideConfiguration(uri: vscode.Uri, token?: vscode.CancellationToken): Thenable<boolean>; | ||
| /** | ||
@@ -87,3 +87,3 @@ * A request to get Intellisense configurations for the given files. | ||
| */ | ||
| provideConfigurations(uris: vscode.Uri[], token?: CancellationToken): Thenable<SourceFileConfigurationItem[]>; | ||
| provideConfigurations(uris: vscode.Uri[], token?: vscode.CancellationToken): Thenable<SourceFileConfigurationItem[]>; | ||
| /** | ||
@@ -94,3 +94,3 @@ * A request to determine whether this provider can provide a code browsing configuration for the workspace folder. | ||
| */ | ||
| canProvideBrowseConfiguration(token?: CancellationToken): Thenable<boolean>; | ||
| canProvideBrowseConfiguration(token?: vscode.CancellationToken): Thenable<boolean>; | ||
| /** | ||
@@ -100,5 +100,7 @@ * A request to get the code browsing configuration for the workspace folder. | ||
| * @returns A [WorkspaceBrowseConfiguration](#WorkspaceBrowseConfiguration) with the information required to | ||
| * construct the equivalent of `browse.path` from `c_cpp_properties.json`. | ||
| * construct the equivalent of `browse.path` from `c_cpp_properties.json`. If there is no configuration to report, or | ||
| * the provider indicated that it cannot provide a [WorkspaceBrowseConfiguration](#WorkspaceBrowseConfiguration) | ||
| * then `null` should be returned. | ||
| */ | ||
| provideBrowseConfiguration(token?: CancellationToken): Thenable<WorkspaceBrowseConfiguration>; | ||
| provideBrowseConfiguration(token?: vscode.CancellationToken): Thenable<WorkspaceBrowseConfiguration | null>; | ||
| /** | ||
@@ -109,3 +111,3 @@ * A request to determine whether this provider can provide a code browsing configuration for each folder in a multi-root workspace. | ||
| */ | ||
| canProvideBrowseConfigurationsPerFolder(token?: CancellationToken): Thenable<boolean>; | ||
| canProvideBrowseConfigurationsPerFolder(token?: vscode.CancellationToken): Thenable<boolean>; | ||
| /** | ||
@@ -116,5 +118,7 @@ * A request to get the code browsing configuration for the workspace folder. | ||
| * @returns A [WorkspaceBrowseConfiguration](#WorkspaceBrowseConfiguration) with the information required to | ||
| * construct the equivalent of `browse.path` from `c_cpp_properties.json`. | ||
| * construct the equivalent of `browse.path` from `c_cpp_properties.json`. If there is no configuration for this folder, or | ||
| * the provider indicated that it cannot provide a [WorkspaceBrowseConfiguration](#WorkspaceBrowseConfiguration) per folder | ||
| * then `null` should be returned. | ||
| */ | ||
| provideFolderBrowseConfiguration(uri: vscode.Uri, token?: CancellationToken): Thenable<WorkspaceBrowseConfiguration>; | ||
| provideFolderBrowseConfiguration(uri: vscode.Uri, token?: vscode.CancellationToken): Thenable<WorkspaceBrowseConfiguration | null>; | ||
| } | ||
@@ -137,9 +141,12 @@ /** | ||
| /** | ||
| * The compiler to emulate. | ||
| * The platform, compiler, and architecture variant to emulate. | ||
| * IntelliSenseMode values without a platform variant will resolve to a value that matches | ||
| * the host platform. For example, if the host platform is Windows and the IntelliSenseMode | ||
| * is "clang-x64", then "clang-x64" will resolve to "windows-clang-x64". | ||
| */ | ||
| readonly intelliSenseMode: "msvc-x86" | "msvc-x64" | "msvc-arm" | "msvc-arm64" | "gcc-x86" | "gcc-x64" | "gcc-arm" | "gcc-arm64" | "clang-x86" | "clang-x64" | "clang-arm" | "clang-arm64"; | ||
| readonly intelliSenseMode?: "linux-clang-x86" | "linux-clang-x64" | "linux-clang-arm" | "linux-clang-arm64" | "linux-gcc-x86" | "linux-gcc-x64" | "linux-gcc-arm" | "linux-gcc-arm64" | "macos-clang-x86" | "macos-clang-x64" | "macos-clang-arm" | "macos-clang-arm64" | "macos-gcc-x86" | "macos-gcc-x64" | "macos-gcc-arm" | "macos-gcc-arm64" | "windows-clang-x86" | "windows-clang-x64" | "windows-clang-arm" | "windows-clang-arm64" | "windows-gcc-x86" | "windows-gcc-x64" | "windows-gcc-arm" | "windows-gcc-arm64" | "windows-msvc-x86" | "windows-msvc-x64" | "windows-msvc-arm" | "windows-msvc-arm64" | "msvc-x86" | "msvc-x64" | "msvc-arm" | "msvc-arm64" | "gcc-x86" | "gcc-x64" | "gcc-arm" | "gcc-arm64" | "clang-x86" | "clang-x64" | "clang-arm" | "clang-arm64"; | ||
| /** | ||
| * The C or C++ standard to emulate. | ||
| */ | ||
| readonly standard: "c89" | "c99" | "c11" | "c18" | "c++98" | "c++03" | "c++11" | "c++14" | "c++17" | "c++20" | "gnu89" | "gnu99" | "gnu11" | "gnu18" | "gnu++98" | "gnu++03" | "gnu++11" | "gnu++14" | "gnu++17" | "gnu++20"; | ||
| readonly standard?: "c89" | "c99" | "c11" | "c17" | "c++98" | "c++03" | "c++11" | "c++14" | "c++17" | "c++20" | "gnu89" | "gnu99" | "gnu11" | "gnu17" | "gnu++98" | "gnu++03" | "gnu++11" | "gnu++14" | "gnu++17" | "gnu++20"; | ||
| /** | ||
@@ -209,3 +216,3 @@ * Any files that need to be included before the source file is parsed. | ||
| */ | ||
| readonly standard?: "c89" | "c99" | "c11" | "c18" | "c++98" | "c++03" | "c++11" | "c++14" | "c++17" | "c++20" | "gnu89" | "gnu99" | "gnu11" | "gnu18" | "gnu++98" | "gnu++03" | "gnu++11" | "gnu++14" | "gnu++17" | "gnu++20"; | ||
| readonly standard?: "c89" | "c99" | "c11" | "c17" | "c++98" | "c++03" | "c++11" | "c++14" | "c++17" | "c++20" | "gnu89" | "gnu99" | "gnu11" | "gnu17" | "gnu++98" | "gnu++03" | "gnu++11" | "gnu++14" | "gnu++17" | "gnu++20"; | ||
| /** | ||
@@ -212,0 +219,0 @@ * The version of the Windows SDK that should be used. This field defaults to the latest Windows SDK |
+27
-11
@@ -7,6 +7,7 @@ /* -------------------------------------------------------------------------------------------- | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -16,2 +17,3 @@ }); | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getCppToolsApi = exports.Version = void 0; | ||
| const vscode = require("vscode"); | ||
@@ -28,8 +30,19 @@ /** | ||
| Version[Version["v4"] = 4] = "v4"; | ||
| Version[Version["latest"] = 4] = "latest"; | ||
| Version[Version["v5"] = 5] = "v5"; | ||
| Version[Version["latest"] = 5] = "latest"; | ||
| })(Version = exports.Version || (exports.Version = {})); | ||
| /** | ||
| * Check if an object satisfies the contract of the CppToolsExtension interface. | ||
| */ | ||
| function isCppToolsExtension(extension) { | ||
| return extension.getApi !== undefined; | ||
| return extension && extension.getApi; | ||
| } | ||
| /** | ||
| * Check if an object satisfies the contract of the first version of the CppToolsApi. | ||
| * (The first release of the API only had two functions) | ||
| */ | ||
| function isLegacyCppToolsApi(api) { | ||
| return api && api.registerCustomConfigurationProvider && api.didChangeCustomConfiguration; | ||
| } | ||
| /** | ||
| * Helper function to get the CppToolsApi from the cpptools extension. | ||
@@ -61,4 +74,4 @@ * @param version The desired API version | ||
| let cpptools = vscode.extensions.getExtension("ms-vscode.cpptools"); | ||
| let extension; | ||
| let api; | ||
| let extension = undefined; | ||
| let api = undefined; | ||
| if (cpptools) { | ||
@@ -80,3 +93,3 @@ if (!cpptools.isActive) { | ||
| let e = err; | ||
| if (e.message && e.message.startsWith("Invalid version")) { | ||
| if (e && e.message && e.message.startsWith("Invalid version")) { | ||
| api = extension.getApi(Version.v1); | ||
@@ -87,19 +100,22 @@ } | ||
| if (!api.getVersion) { | ||
| console.warn(`vscode-cpptools-api version ${version} requested, but is not available in the current version of the cpptools extension. Using version 1 instead.`); | ||
| console.warn(`[vscode-cpptools-api] version ${version} requested, but is not available in the current version of the cpptools extension. Using version 1 instead.`); | ||
| } | ||
| else if (version !== api.getVersion()) { | ||
| console.warn(`vscode-cpptools-api version ${version} requested, but is not available in the current version of the cpptools extension. Using version ${api.getVersion()} instead.`); | ||
| console.warn(`[vscode-cpptools-api] version ${version} requested, but is not available in the current version of the cpptools extension. Using version ${api.getVersion()} instead.`); | ||
| } | ||
| } | ||
| } | ||
| else { | ||
| else if (isLegacyCppToolsApi(extension)) { | ||
| // ms-vscode.cpptools version 0.17.5 | ||
| api = extension; | ||
| if (version !== Version.v0) { | ||
| console.warn(`vscode-cpptools-api version ${version} requested, but is not available in version 0.17.5 of the cpptools extension. Using version 0 instead.`); | ||
| console.warn(`[vscode-cpptools-api] version ${version} requested, but is not available in version 0.17.5 of the cpptools extension. Using version 0 instead.`); | ||
| } | ||
| } | ||
| else { | ||
| console.warn('[vscode-cpptools-api] No cpptools API was found.'); | ||
| } | ||
| } | ||
| else { | ||
| console.warn("C/C++ extension is not installed"); | ||
| console.warn('[vscode-cpptools-api] C/C++ extension is not installed'); | ||
| } | ||
@@ -106,0 +122,0 @@ return api; |
+3
-1
@@ -7,6 +7,7 @@ /* -------------------------------------------------------------------------------------------- | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -16,2 +17,3 @@ }); | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getCppToolsTestApi = exports.Status = void 0; | ||
| const api_1 = require("./api"); | ||
@@ -18,0 +20,0 @@ const vscode = require("vscode"); |
+5
-6
| { | ||
| "name": "vscode-cpptools", | ||
| "version": "4.0.1", | ||
| "version": "5.0.0", | ||
| "description": "Public API for vscode-cpptools", | ||
@@ -11,9 +11,8 @@ "typings": "./out/api.d.ts", | ||
| "devDependencies": { | ||
| "@types/node": "^8.0.46", | ||
| "typescript": "^2.5.3", | ||
| "vscode": "^1.1.37", | ||
| "vscode-jsonrpc": "3.5.0" | ||
| "@types/node": "^14.14.16", | ||
| "@types/vscode": "1.52.0", | ||
| "typescript": "^4.1.3" | ||
| }, | ||
| "scripts": { | ||
| "compile": "node ./node_modules/vscode/bin/install && tsc -p ./" | ||
| "compile": "tsc -p ./" | ||
| }, | ||
@@ -20,0 +19,0 @@ "keywords": [ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
51356
8.67%3
-25%936
6%2
Infinity%