Compare commits

...
Author SHA1 Message Date
spebl 4fbdcbc0fe alternative approach for copilot docs provider 2024-09-10 13:51:16 -07:00
spebl bd1eb4320f merge from main 2024-09-03 12:51:12 -07:00
Bob Brown 93a20bc2de Update link to glob info (#12671) 2024-08-30 17:03:51 -07:00
Sean McManus 86b698b503 Update changelog and version for 1.22.2. (#12657) 2024-08-29 19:04:49 -07:00
browntarik b7f76c507c Remove intellisenseEngineFallback description (#12655)
* Remove intellisenseEngineFallback description.
* Remove references to includeFallback.
2024-08-29 18:46:25 -07:00
browntarik fcdccd4dff Remove usage of intellisenseEngineFallback setting. (#12600) 2024-08-29 13:54:15 -07:00
Sean McManus f222a97849 Update changelog for 1.22.1 (#12646)
* Update changelog for 1.22.1
2024-08-29 13:32:47 -07:00
Bob Brown 1f426edd13 Address a component governance report on webpack (#12649) 2024-08-28 10:53:10 -07:00
Bob Brown 994e7b9201 Log the values of editor settings that we track (#12635) 2024-08-27 17:04:01 -07:00
Sean McManus 3dc7067c30 Update changelog (2nd time) (#12631) 2024-08-26 13:39:38 -07:00
spebl 3d5b7db9a0 merge from main 2024-08-26 12:51:23 -07:00
Stanislav 49d987d747 Fix show a list local processes, if remote connection failed (useExtendedRemote) (#12623)
* Fix show a list local processes, if remote connection failed (useExtendedRemote)
2024-08-26 12:22:24 -07:00
dependabot[bot] c81120e7c4 Bump micromatch from 4.0.7 to 4.0.8 in /Extension (#12630)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/4.0.8/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.7...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 12:14:52 -07:00
Bob Brown e5ce40bfe1 Log the modified extension settings as part of Log Diagnostics (#12621) 2024-08-26 12:02:03 -07:00
Sean McManus d3cd4fcfd7 Fix vcFormat not working and other case comparison bugs. (#12620) 2024-08-23 11:15:42 -07:00
Colen Garoutte-Carson d8a6a98f4b Switch from LSP hover to HoverProvider (#12612) 2024-08-22 19:26:37 -07:00
Colen Garoutte-Carson 326f7d93b9 Spread out schedules of github actions to avoid 'rate limit' errors (#12616) 2024-08-22 18:10:15 -07:00
Colen Garoutte-Carson fbfddd2158 Prevent AddComment action from adding redundant comments (#12611) 2024-08-21 14:32:58 -07:00
Sean McManus d7bfae6ed1 Update changelog/version for 1.22.0 (#12602)
* Update changelog and version for 1.22.0.
2024-08-21 13:24:07 -07:00
Sean McManus 66b934c6df Update TPN for 1.22.0. (#12601) 2024-08-21 11:44:04 -07:00
Colen Garoutte-Carson 7dcd5a48c0 Remove use of editorconfig module to avoid dependency on one-ini wasm file. (#12579) 2024-08-20 14:38:19 -07:00
Colen Garoutte-Carson a0f863c560 Fix LSP cancellation (#12592) 2024-08-20 14:25:37 -07:00
Garrett SerackandColen Garoutte-Carson 818f7c6899 Update scripts use of spawnSync to work with newer versions of nodejs (#12503)
Co-authored-by: Colen Garoutte-Carson <[email protected]>
2024-08-20 14:10:48 -07:00
Colen Garoutte-Carson cb50bb1b34 Fix addComment action (#12599) 2024-08-20 14:05:45 -07:00
Colen Garoutte-Carson 632454923c Add AddComment GitHub action, and workflows for tagging new debugger issues (#12496) 2024-08-20 13:25:14 -07:00
Bob Brown 06ed83878c Release pipelines for themes and extension pack (#12589) 2024-08-19 16:38:58 -07:00
Sean McManus 4a7fe28adc Update msvc versions for 17.11 (#12583)
* Update msvc versions for 17.11
2024-08-18 06:40:30 -07:00
Sean McManus 0ffdc003fa Fix "Replacement of a substring with itself" warning. (#12546) 2024-08-15 19:18:41 -07:00
browntarik d2bd3e035c Refactor compilerPath logic to reflect settings validation changes (#12556)
* Remove unnesseacary null check and set compilerPathIsExplicit when defaultCompilerPath is null

* Remove unneccessary else statement.

* Refactor changes

* Propogate null usage to reflect null typing for compilerPath.

* Remove normalization of null to undefined.

* Fix linting

* Add null to resolvedCompilerPath

* Update cpp_properties schema
2024-08-15 12:29:06 -07:00
Colen Garoutte-Carson d4c46c725d Update OneLocBuild pipeline (#12573) 2024-08-15 11:59:28 -07:00
Sean McManus 631c522737 Remove debug and ms from TPN (not actually distributed). (#12566) 2024-08-14 18:23:31 -07:00
spebl 28390f1d47 reset vscode version 2024-08-14 14:20:50 -07:00
spebl aa6779c4ef merge from main 2024-08-14 14:17:54 -07:00
spebl c73a589cee fix spacing 2024-08-14 14:09:18 -07:00
spebl db42258d02 'otf docs' -> 'copilot hover' in naming conventions and strings. fixes and cleanup based on feedback. add waiting spinner. 2024-08-14 14:07:34 -07:00
Sean McManus 571f2d57ef Update axios to 1.7.4. (#12564) 2024-08-13 14:04:56 -07:00
Sean McManus 5cec9b93b8 Fix 5 high severity vulnerabilities in .github/actions. (#12562) 2024-08-13 12:17:20 -07:00
Sean McManus da2fcbc88c Fix vsce with cg.yml (#12561)
* Fix vsce via upgrading to node.js 18.
2024-08-12 14:20:27 -07:00
browntarik 3cf9a99864 Add Validation for VS Code Settings (#12454) 2024-08-09 12:18:44 -07:00
spebl 7a4184174b fix settings when copilot models load later and fix showing copilot when editor isnt selected 2024-08-07 18:07:27 -07:00
spebl 7ec62d9ee9 add setting and strings 2024-08-06 23:30:38 -07:00
spebl 433f22dc28 add support for feature flag control 2024-08-06 23:29:33 -07:00
spebl fb310c8ff1 add support for icons in hover 2024-08-06 18:10:48 -07:00
spebl 2667ec5593 add localization support 2024-08-06 12:32:23 -07:00
spebl 93d7bb044a merge from main 2024-08-05 12:49:35 -07:00
spebl 0eac8bf5a3 initial on-the-fly docs implementation for vscode 2024-08-05 12:47:40 -07:00
Sean McManus 99af8d886e Update changelog and version for 1.21.6 (#12539) 2024-08-05 10:38:27 -07:00
Sean McManus b768a5440a Update for 1.21.5. (#12530) 2024-07-30 22:09:47 -07:00
Sean McManus 570862bf64 Update TPN for 1.21.4 (#12518) 2024-07-25 15:17:27 -07:00
Sean McManus 4e09135edc Go back to supporting VS Code 1.67.0 instead of 1.82.0. (#12515) 2024-07-25 14:37:18 -07:00
Sean McManus 15c6bdd613 Update changelog and version for 1.21.3. (#12499) 2024-07-23 19:30:20 -07:00
Bob Brown 7078f4b0bd Enable codeQL for TypeScript (#12490) 2024-07-19 11:30:20 -07:00
Sean McManus 626bb6e388 Change cpp editor.stickyScroll.defaultModel. (#12486) 2024-07-18 18:05:31 -07:00
Sean McManus 01829f8b81 Update 1.21.2 changelog in main. (#12485)
* Update 1.21.2 changelog in main.
* Update version
2024-07-18 21:46:31 +00:00
Colen Garoutte-Carson 9f2e50b2ef Update edge strings for FI (#12487) 2024-07-17 18:25:57 -07:00
90 changed files with 4278 additions and 2797 deletions
+86
View File
@@ -0,0 +1,86 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddComment = void 0;
const ActionBase_1 = require("../common/ActionBase");
const utils_1 = require("../common/utils");
class AddComment extends ActionBase_1.ActionBase {
constructor(github, createdAfter, afterDays, labels, addComment, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
this.github = github;
this.createdAfter = createdAfter;
this.afterDays = afterDays;
this.addComment = addComment;
this.addLabels = addLabels;
this.removeLabels = removeLabels;
this.setMilestoneId = setMilestoneId;
}
async run() {
const updatedTimestamp = this.afterDays ? (0, utils_1.daysAgoToHumanReadbleDate)(this.afterDays) : undefined;
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") +
(this.createdAfter ? `created:>${this.createdAfter} ` : "") +
"is:open is:unlocked");
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
for await (const page of this.github.query({ q: query })) {
for (const issue of page) {
const hydrated = await issue.getIssue();
if (hydrated.open && this.validateIssue(hydrated)
// TODO: Verify updated timestamp
) {
// Don't add a comment if already commented on by an action.
let foundActionComment = false;
for await (const commentBatch of issue.getComments()) {
for (const comment of commentBatch) {
if (comment.author.isGitHubApp) {
foundActionComment = true;
break;
}
}
if (foundActionComment)
break;
}
if (foundActionComment) {
(0, utils_1.safeLog)(`Issue ${hydrated.number} already commented on by an action. Ignoring.`);
continue;
}
if (this.addComment) {
(0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`);
await issue.postComment(this.addComment);
}
if (removeLabelsSet.length > 0) {
for (const removeLabel of removeLabelsSet) {
if (removeLabel && removeLabel.length > 0) {
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
await issue.removeLabel(removeLabel);
}
}
}
if (addLabelsSet.length > 0) {
for (const addLabel of addLabelsSet) {
if (addLabel && addLabel.length > 0) {
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
await issue.addLabel(addLabel);
}
}
}
if (this.setMilestoneId != undefined) {
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
await issue.setMilestone(+this.setMilestoneId);
}
(0, utils_1.safeLog)(`Processing issue ${hydrated.number}.`);
}
else {
if (!hydrated.open) {
(0, utils_1.safeLog)(`Issue ${hydrated.number} is not open. Ignoring`);
}
}
}
}
}
}
exports.AddComment = AddComment;
//# sourceMappingURL=AddComment.js.map
+98
View File
@@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { GitHub } from '../api/api';
import { ActionBase } from '../common/ActionBase';
import { daysAgoToHumanReadbleDate, daysAgoToTimestamp, safeLog } from '../common/utils';
export class AddComment extends ActionBase {
constructor(
private github: GitHub,
private createdAfter: string | undefined,
private afterDays: number,
labels: string,
private addComment: string,
private addLabels?: string,
private removeLabels?: string,
private setMilestoneId?: string,
milestoneName?: string,
milestoneId?: string,
ignoreLabels?: string,
ignoreMilestoneNames?: string,
ignoreMilestoneIds?: string,
minimumVotes?: number,
maximumVotes?: number,
involves?: string
) {
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
}
async run() {
const updatedTimestamp = this.afterDays ? daysAgoToHumanReadbleDate(this.afterDays) : undefined;
const query = this.buildQuery(
(updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") +
(this.createdAfter ? `created:>${this.createdAfter} ` : "") +
"is:open is:unlocked");
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
for await (const page of this.github.query({ q: query })) {
for (const issue of page) {
const hydrated = await issue.getIssue();
if (hydrated.open && this.validateIssue(hydrated)
// TODO: Verify updated timestamp
) {
// Don't add a comment if already commented on by an action.
let foundActionComment = false;
for await (const commentBatch of issue.getComments()) {
for (const comment of commentBatch) {
if (comment.author.isGitHubApp) {
foundActionComment = true;
break;
}
}
if (foundActionComment)
break;
}
if (foundActionComment) {
safeLog(`Issue ${hydrated.number} already commented on by an action. Ignoring.`);
continue;
}
if (this.addComment) {
safeLog(`Posting comment on issue ${hydrated.number}`);
await issue.postComment(this.addComment);
}
if (removeLabelsSet.length > 0) {
for (const removeLabel of removeLabelsSet) {
if (removeLabel && removeLabel.length > 0) {
safeLog(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
await issue.removeLabel(removeLabel);
}
}
}
if (addLabelsSet.length > 0) {
for (const addLabel of addLabelsSet) {
if (addLabel && addLabel.length > 0) {
safeLog(`Adding label on issue ${hydrated.number}: ${addLabel}`);
await issue.addLabel(addLabel);
}
}
}
if (this.setMilestoneId != undefined) {
safeLog(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
await issue.setMilestone(+this.setMilestoneId);
}
safeLog(`Processing issue ${hydrated.number}.`);
} else {
if (!hydrated.open) {
safeLog(`Issue ${hydrated.number} is not open. Ignoring`);
}
}
}
}
}
}
+42
View File
@@ -0,0 +1,42 @@
name: Add Comment and Label
description: Add comment (etc) to issues that are marked with a specified label (etc)
inputs:
token:
description: GitHub token with issue, comment, and label read/write permissions
default: ${{ github.token }}
createdAfter:
description: Creation date after which to be considered.
required: false
afterDays:
description: Days to wait before performing this action (may be 0).
required: false
addComment:
description: Comment to add
labels:
description: items with these labels will be considered. May be "*".
required: true
milestoneName:
description: items with these milestones will be considered (name only, must match ID)
milestoneId:
description: items with these milestones will be considered (id only, must match name)
ignoreLabels:
description: items with these labels will not be considered
ignoreMilestoneNames:
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
ignoreMilestoneIds:
description: items with these milestones will not be considered (IDs only, must match names)
addLabels:
description: Labels to add to issue.
removeLabels:
description: Labels to remove from issue.
minimumVotes:
descriptions: Only issues with at least this many votes will be considered.
maximumVotes:
descriptions: Only issues fewer or equal to this many votes will be considered.
involves:
descriptions: Qualifier to find issues that in some way involve a certain user either as an author, assignee, or mentions.
readonly:
description: If true, changes are not applied.
runs:
using: 'node12'
main: 'index.js'
+20
View File
@@ -0,0 +1,20 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("../common/utils");
const AddComment_1 = require("./AddComment");
const Action_1 = require("../common/Action");
class AddCommentAction extends Action_1.Action {
constructor() {
super(...arguments);
this.id = 'AddComment';
}
async onTriggered(github) {
await new AddComment_1.AddComment(github, (0, utils_1.getInput)('createdAfter') || undefined, +((0, utils_1.getInput)('afterDays') || 0), (0, utils_1.getRequiredInput)('labels'), (0, utils_1.getInput)('addComment') || '', (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999), (0, utils_1.getInput)('involves') || undefined).run();
}
}
new AddCommentAction().run(); // eslint-disable-line
//# sourceMappingURL=index.js.map
+36
View File
@@ -0,0 +1,36 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { OctoKit } from '../api/octokit'
import { getInput, getRequiredInput } from '../common/utils'
import { AddComment } from './AddComment'
import { Action } from '../common/Action'
class AddCommentAction extends Action {
id = 'AddComment';
async onTriggered(github: OctoKit) {
await new AddComment(
github,
getInput('createdAfter') || undefined,
+(getInput('afterDays') || 0),
getRequiredInput('labels'),
getInput('addComment') || '',
getInput('addLabels') || undefined,
getInput('removeLabels') || undefined,
getInput('setMilestoneId') || undefined,
getInput('milestoneName') || undefined,
getInput('milestoneId') || undefined,
getInput('ignoreLabels') || undefined,
getInput('ignoreMilestoneNames') || undefined,
getInput('ignoreMilestoneIds') || undefined,
+(getInput('minimumVotes') || 0),
+(getInput('maximumVotes') || 9999999),
getInput('involves') || undefined
).run();
}
}
new AddCommentAction().run(); // eslint-disable-line
+1 -1
View File
@@ -15,7 +15,7 @@ inputs:
milestoneId:
description: items with these milestones will be considered (id only, must match name)
labels:
description: items with these labels will not be considered. May be "*".
description: items with these labels will be considered. May be "*".
ignoreMilestoneNames:
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
ignoreMilestoneIds:
+1 -1
View File
@@ -19,7 +19,7 @@ inputs:
milestoneId:
description: items with these milestones will be considered (id only, must match name)
labels:
description: items with these labels will not be considered. May be "*".
description: items with these labels will be considered. May be "*".
ignoreMilestoneNames:
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
ignoreMilestoneIds:
+105 -105
View File
@@ -1,106 +1,106 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaleCloser = void 0;
const ActionBase_1 = require("../common/ActionBase");
const utils_1 = require("../common/utils");
class StaleCloser extends ActionBase_1.ActionBase {
constructor(github, closeDays, labels, closeComment, pingDays, pingComment, additionalTeam, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
this.github = github;
this.closeDays = closeDays;
this.closeComment = closeComment;
this.pingDays = pingDays;
this.pingComment = pingComment;
this.additionalTeam = additionalTeam;
this.addLabels = addLabels;
this.removeLabels = removeLabels;
this.setMilestoneId = setMilestoneId;
}
async run() {
const updatedTimestamp = (0, utils_1.daysAgoToHumanReadbleDate)(this.closeDays);
const pingTimestamp = this.pingDays ? (0, utils_1.daysAgoToTimestamp)(this.pingDays) : undefined;
const query = this.buildQuery((this.closeDays ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
for await (const page of this.github.query({ q: query })) {
for (const issue of page) {
const hydrated = await issue.getIssue();
const lastCommentIterator = await issue.getComments(true).next();
if (lastCommentIterator.done) {
throw Error('Unexpected comment data');
}
const lastComment = lastCommentIterator.value[0];
if (hydrated.open && this.validateIssue(hydrated)
// TODO: Verify updated timestamp
) {
if (!lastComment ||
lastComment.author.isGitHubApp ||
pingTimestamp == undefined ||
// TODO: List the collaborators once per go rather than checking a single user each issue
this.additionalTeam.includes(lastComment.author.name) ||
await issue.hasWriteAccess(lastComment.author)) {
if (pingTimestamp != undefined) {
if (lastComment) {
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`);
}
else {
(0, utils_1.safeLog)(`No comments on issue ${hydrated.number}. Closing.`);
}
}
if (this.closeComment) {
(0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`);
await issue.postComment(this.closeComment);
}
if (removeLabelsSet.length > 0) {
for (const removeLabel of removeLabelsSet) {
if (removeLabel && removeLabel.length > 0) {
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
await issue.removeLabel(removeLabel);
}
}
}
if (addLabelsSet.length > 0) {
for (const addLabel of addLabelsSet) {
if (addLabel && addLabel.length > 0) {
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
await issue.addLabel(addLabel);
}
}
}
await issue.closeIssue("not_planned");
if (this.setMilestoneId != undefined) {
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
await issue.setMilestone(+this.setMilestoneId);
}
(0, utils_1.safeLog)(`Closing issue ${hydrated.number}.`);
}
else {
// Ping
if (hydrated.updatedAt < pingTimestamp && hydrated.assignee) {
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Pinging @${hydrated.assignee}`);
if (this.pingComment) {
await issue.postComment(this.pingComment
.replace('${assignee}', hydrated.assignee)
.replace('${author}', hydrated.author.name));
}
}
else {
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Skipping.${hydrated.assignee ? ' cc @' + hydrated.assignee : ''}`);
}
}
}
else {
if (!hydrated.open) {
(0, utils_1.safeLog)(`Issue ${hydrated.number} is not open. Ignoring`);
}
}
}
}
}
}
exports.StaleCloser = StaleCloser;
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaleCloser = void 0;
const ActionBase_1 = require("../common/ActionBase");
const utils_1 = require("../common/utils");
class StaleCloser extends ActionBase_1.ActionBase {
constructor(github, closeDays, labels, closeComment, pingDays, pingComment, additionalTeam, addLabels, removeLabels, setMilestoneId, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
super(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves);
this.github = github;
this.closeDays = closeDays;
this.closeComment = closeComment;
this.pingDays = pingDays;
this.pingComment = pingComment;
this.additionalTeam = additionalTeam;
this.addLabels = addLabels;
this.removeLabels = removeLabels;
this.setMilestoneId = setMilestoneId;
}
async run() {
const updatedTimestamp = this.closeDays ? (0, utils_1.daysAgoToHumanReadbleDate)(this.closeDays) : undefined;
const pingTimestamp = this.pingDays ? (0, utils_1.daysAgoToTimestamp)(this.pingDays) : undefined;
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
for await (const page of this.github.query({ q: query })) {
for (const issue of page) {
const hydrated = await issue.getIssue();
const lastCommentIterator = await issue.getComments(true).next();
if (lastCommentIterator.done) {
throw Error('Unexpected comment data');
}
const lastComment = lastCommentIterator.value[0];
if (hydrated.open && this.validateIssue(hydrated)
// TODO: Verify updated timestamp
) {
if (!lastComment ||
lastComment.author.isGitHubApp ||
pingTimestamp == undefined ||
// TODO: List the collaborators once per go rather than checking a single user each issue
this.additionalTeam.includes(lastComment.author.name) ||
await issue.hasWriteAccess(lastComment.author)) {
if (pingTimestamp != undefined) {
if (lastComment) {
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Closing.`);
}
else {
(0, utils_1.safeLog)(`No comments on issue ${hydrated.number}. Closing.`);
}
}
if (this.closeComment) {
(0, utils_1.safeLog)(`Posting comment on issue ${hydrated.number}`);
await issue.postComment(this.closeComment);
}
if (removeLabelsSet.length > 0) {
for (const removeLabel of removeLabelsSet) {
if (removeLabel && removeLabel.length > 0) {
(0, utils_1.safeLog)(`Removing label on issue ${hydrated.number}: ${removeLabel}`);
await issue.removeLabel(removeLabel);
}
}
}
if (addLabelsSet.length > 0) {
for (const addLabel of addLabelsSet) {
if (addLabel && addLabel.length > 0) {
(0, utils_1.safeLog)(`Adding label on issue ${hydrated.number}: ${addLabel}`);
await issue.addLabel(addLabel);
}
}
}
await issue.closeIssue("not_planned");
if (this.setMilestoneId != undefined) {
(0, utils_1.safeLog)(`Setting milestone of issue ${hydrated.number} to id ${+this.setMilestoneId}`);
await issue.setMilestone(+this.setMilestoneId);
}
(0, utils_1.safeLog)(`Closing issue ${hydrated.number}.`);
}
else {
// Ping
if (hydrated.updatedAt < pingTimestamp && hydrated.assignee) {
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Pinging @${hydrated.assignee}`);
if (this.pingComment) {
await issue.postComment(this.pingComment
.replace('${assignee}', hydrated.assignee)
.replace('${author}', hydrated.author.name));
}
}
else {
(0, utils_1.safeLog)(`Last comment on issue ${hydrated.number} by ${lastComment.author.name}. Skipping.${hydrated.assignee ? ' cc @' + hydrated.assignee : ''}`);
}
}
}
else {
if (!hydrated.open) {
(0, utils_1.safeLog)(`Issue ${hydrated.number} is not open. Ignoring`);
}
}
}
}
}
}
exports.StaleCloser = StaleCloser;
//# sourceMappingURL=StaleCloser.js.map
+2 -2
View File
@@ -33,10 +33,10 @@ export class StaleCloser extends ActionBase {
}
async run() {
const updatedTimestamp = daysAgoToHumanReadbleDate(this.closeDays);
const updatedTimestamp = this.closeDays ? daysAgoToHumanReadbleDate(this.closeDays) : undefined;
const pingTimestamp = this.pingDays ? daysAgoToTimestamp(this.pingDays) : undefined;
const query = this.buildQuery((this.closeDays ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
const query = this.buildQuery((updatedTimestamp ? `updated:<${updatedTimestamp} ` : "") + "is:open is:unlocked");
const addLabelsSet = this.addLabels ? this.addLabels.split(',') : [];
const removeLabelsSet = this.removeLabels ? this.removeLabels.split(',') : [];
+1 -1
View File
@@ -20,7 +20,7 @@ inputs:
milestoneId:
description: items with these milestones will be considered (id only, must match name)
labels:
description: items with these labels will not be considered. May be "*".
description: items with these labels will be considered. May be "*".
required: true
ignoreMilestoneNames:
description: items with these milestones will not be considered (names only, must match IDs). May be "*".
+20 -20
View File
@@ -1,21 +1,21 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("../common/utils");
const StaleCloser_1 = require("./StaleCloser");
const Action_1 = require("../common/Action");
class StaleCloserAction extends Action_1.Action {
constructor() {
super(...arguments);
this.id = 'StaleCloser';
}
async onTriggered(github) {
var _a;
await new StaleCloser_1.StaleCloser(github, +(0, utils_1.getRequiredInput)('closeDays'), (0, utils_1.getRequiredInput)('labels'), (0, utils_1.getInput)('closeComment') || '', +((0, utils_1.getInput)('pingDays') || 0), (0, utils_1.getInput)('pingComment') || '', ((_a = (0, utils_1.getInput)('additionalTeam')) !== null && _a !== void 0 ? _a : '').split(','), (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999), (0, utils_1.getInput)('involves') || undefined).run();
}
}
new StaleCloserAction().run(); // eslint-disable-line
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("../common/utils");
const StaleCloser_1 = require("./StaleCloser");
const Action_1 = require("../common/Action");
class StaleCloserAction extends Action_1.Action {
constructor() {
super(...arguments);
this.id = 'StaleCloser';
}
async onTriggered(github) {
var _a;
await new StaleCloser_1.StaleCloser(github, +(0, utils_1.getRequiredInput)('closeDays'), (0, utils_1.getRequiredInput)('labels'), (0, utils_1.getInput)('closeComment') || '', +((0, utils_1.getInput)('pingDays') || 0), (0, utils_1.getInput)('pingComment') || '', ((_a = (0, utils_1.getInput)('additionalTeam')) !== null && _a !== void 0 ? _a : '').split(','), (0, utils_1.getInput)('addLabels') || undefined, (0, utils_1.getInput)('removeLabels') || undefined, (0, utils_1.getInput)('setMilestoneId') || undefined, (0, utils_1.getInput)('milestoneName') || undefined, (0, utils_1.getInput)('milestoneId') || undefined, (0, utils_1.getInput)('ignoreLabels') || undefined, (0, utils_1.getInput)('ignoreMilestoneNames') || undefined, (0, utils_1.getInput)('ignoreMilestoneIds') || undefined, +((0, utils_1.getInput)('minimumVotes') || 0), +((0, utils_1.getInput)('maximumVotes') || 9999999), (0, utils_1.getInput)('involves') || undefined).run();
}
}
new StaleCloserAction().run(); // eslint-disable-line
//# sourceMappingURL=index.js.map
+4 -4
View File
@@ -12,6 +12,10 @@ let numRequests = 0;
const getNumRequests = () => numRequests;
exports.getNumRequests = getNumRequests;
class OctoKit {
get octokit() {
numRequests++;
return this._octokit;
}
constructor(token, params, options = { readonly: false }) {
this.token = token;
this.params = params;
@@ -23,10 +27,6 @@ class OctoKit {
this.repoName = params.repo;
this.repoOwner = params.owner;
}
get octokit() {
numRequests++;
return this._octokit;
}
getIssueByNumber(number) {
return new OctoKitIssue(this.token, this.params, { number: number });
}
+182 -182
View File
@@ -1,183 +1,183 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionBase = void 0;
const utils_1 = require("./utils");
class ActionBase {
constructor(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
this.labels = labels;
this.milestoneName = milestoneName;
this.milestoneId = milestoneId;
this.ignoreLabels = ignoreLabels;
this.ignoreMilestoneNames = ignoreMilestoneNames;
this.ignoreMilestoneIds = ignoreMilestoneIds;
this.minimumVotes = minimumVotes;
this.maximumVotes = maximumVotes;
this.involves = involves;
this.labelsSet = [];
this.ignoreLabelsSet = [];
this.ignoreMilestoneNamesSet = [];
this.ignoreMilestoneIdsSet = [];
this.ignoreAllWithLabels = false;
this.ignoreAllWithMilestones = false;
this.involvesSet = [];
}
buildQuery(baseQuery) {
var _a, _b, _c, _d, _e, _f;
let query = baseQuery;
(0, utils_1.safeLog)(`labels: ${this.labels}`);
(0, utils_1.safeLog)(`milestoneName: ${this.milestoneName}`);
(0, utils_1.safeLog)(`milestoneId: ${this.milestoneId}`);
(0, utils_1.safeLog)(`ignoreLabels: ${this.ignoreLabels}`);
(0, utils_1.safeLog)(`ignoreMilestoneNames: ${this.ignoreMilestoneNames}`);
(0, utils_1.safeLog)(`ignoreMilestoneIds: ${this.ignoreMilestoneIds}`);
(0, utils_1.safeLog)(`minimumVotes: ${this.minimumVotes}`);
(0, utils_1.safeLog)(`maximumVotes: ${this.maximumVotes}`);
(0, utils_1.safeLog)(`involves: ${this.involves}`);
// Both milestone name and milestone Id must be provided and must match.
// The name is used to construct the query, which does not accept ID.
// The ID is used for comparisons with issue data, which does not include the name.
// TODO: Figure out a way to convert either from milestone name to ID, or vice versa.
// If label inclusion and exclusion are mixed, exclusion will take precedence.
// For example, an issue with both labels A and B will not match if B is excluded, even if A is included.
// If a milestoneName/milestoneId are set, ignoreMilenameName/ignoreMilestoneIds are ignored.
// GitHub does not appear to support searching for all issues with milestones (not lacking a milestone). "-no:milestone" does not work.
// GitHub does not appear to support searching for all issues with labels (not lacking a label). "-no:label" does not work.
// All indicated labels must be present
if (this.labels) {
if (((_a = this.labels) === null || _a === void 0 ? void 0 : _a.length) > 2 && ((_b = this.labels) === null || _b === void 0 ? void 0 : _b.startsWith('"')) && ((_c = this.labels) === null || _c === void 0 ? void 0 : _c.endsWith('"'))) {
this.labels = this.labels.substring(1, this.labels.length - 2);
}
this.labelsSet = (_d = this.labels) === null || _d === void 0 ? void 0 : _d.split(',');
for (const str of this.labelsSet) {
if (str != "") {
query = query.concat(` label:"${str}"`);
}
}
}
// The "involves" qualifier to find issues that in some way involve a certain user.
// It is a logical OR between the author, assignee, and mentions.
if (this.involves) {
this.involvesSet = (_e = this.involves) === null || _e === void 0 ? void 0 : _e.split(',');
for (const str of this.involvesSet) {
if (str != "") {
query = query.concat(` involves:"${str}"`);
}
}
}
if (this.ignoreLabels) {
if (this.ignoreLabels == "*" && !this.labels) { // only if unlabeled
query = query.concat(` no:label`);
this.ignoreAllWithLabels = true;
}
else {
this.ignoreLabelsSet = (_f = this.ignoreLabels) === null || _f === void 0 ? void 0 : _f.split(',');
for (const str of this.ignoreLabelsSet) {
if (str != "") {
query = query.concat(` -label:"${str}"`);
}
}
}
}
if (this.milestoneName) {
query = query.concat(` milestone:"${this.milestoneName}"`);
}
else if (this.ignoreMilestoneNames) {
if (this.ignoreMilestoneNames == "*") {
query = query.concat(` no:milestone`);
this.ignoreAllWithMilestones = true;
}
else if (this.ignoreMilestoneIds) {
this.ignoreMilestoneNamesSet = this.ignoreMilestoneNames.split(',');
this.ignoreMilestoneIdsSet = this.ignoreMilestoneIds.split(',');
for (const str of this.ignoreMilestoneNamesSet) {
if (str != "") {
query = query.concat(` -milestone:"${str}"`);
}
}
}
}
return query;
}
// This is necessary because GitHub sometimes returns incorrect results,
// and because issues may get modified while we are processing them.
validateIssue(issue) {
var _a, _b;
if (this.ignoreAllWithLabels) {
// Validate that the issue does not have labels
if (issue.labels && issue.labels.length !== 0) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to label found after querying for no:label.`);
return false;
}
}
else {
// Make sure all labels we wanted are present.
if ((!issue.labels || issue.labels.length == 0) && this.labelsSet.length > 0) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set. No labels found.`);
return false;
}
for (const str of this.labelsSet) {
if (!issue.labels.includes(str)) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set.`);
return false;
}
}
// Make sure no labels we wanted to ignore are present.
if (issue.labels && issue.labels.length > 0) {
for (const str of this.ignoreLabelsSet) {
if (issue.labels.includes(str)) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having an ignore label set: ${str}`);
return false;
}
}
}
}
if (this.ignoreAllWithMilestones) {
// Validate that the issue does not have a milestone.
if (issue.milestone) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone found after querying for no:milestone.`);
return false;
}
}
else {
// Make sure milestone is present, if required.
if (this.milestoneId != null && ((_a = issue.milestone) === null || _a === void 0 ? void 0 : _a.milestoneId) != +this.milestoneId) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having required milsetone id ${this.milestoneId}. Had: ${(_b = issue.milestone) === null || _b === void 0 ? void 0 : _b.milestoneId}`);
return false;
}
// Make sure a milestones we wanted to ignore is not present.
if (issue.milestone && issue.milestone.milestoneId != null) {
for (const str of this.ignoreMilestoneIdsSet) {
if (issue.milestone.milestoneId == +str) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone ${issue.milestone.milestoneId} found in list of ignored milestone IDs.`);
return false;
}
}
}
}
// Verify the issue has a sufficient number of upvotes
let upvotes = 0;
if (issue.reactions) {
upvotes = issue.reactions['+1'];
}
if (this.minimumVotes != undefined) {
if (upvotes < this.minimumVotes) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having at least ${this.minimumVotes} upvotes. Had: ${upvotes}`);
return false;
}
}
// Verify the issue does not have too many upvotes
if (this.maximumVotes != undefined) {
if (upvotes > this.maximumVotes) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having more than ${this.maximumVotes} upvotes. Had: ${upvotes}`);
return false;
}
}
return true;
}
}
exports.ActionBase = ActionBase;
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionBase = void 0;
const utils_1 = require("./utils");
class ActionBase {
constructor(labels, milestoneName, milestoneId, ignoreLabels, ignoreMilestoneNames, ignoreMilestoneIds, minimumVotes, maximumVotes, involves) {
this.labels = labels;
this.milestoneName = milestoneName;
this.milestoneId = milestoneId;
this.ignoreLabels = ignoreLabels;
this.ignoreMilestoneNames = ignoreMilestoneNames;
this.ignoreMilestoneIds = ignoreMilestoneIds;
this.minimumVotes = minimumVotes;
this.maximumVotes = maximumVotes;
this.involves = involves;
this.labelsSet = [];
this.ignoreLabelsSet = [];
this.ignoreMilestoneNamesSet = [];
this.ignoreMilestoneIdsSet = [];
this.ignoreAllWithLabels = false;
this.ignoreAllWithMilestones = false;
this.involvesSet = [];
}
buildQuery(baseQuery) {
var _a, _b, _c, _d, _e, _f;
let query = baseQuery;
(0, utils_1.safeLog)(`labels: ${this.labels}`);
(0, utils_1.safeLog)(`milestoneName: ${this.milestoneName}`);
(0, utils_1.safeLog)(`milestoneId: ${this.milestoneId}`);
(0, utils_1.safeLog)(`ignoreLabels: ${this.ignoreLabels}`);
(0, utils_1.safeLog)(`ignoreMilestoneNames: ${this.ignoreMilestoneNames}`);
(0, utils_1.safeLog)(`ignoreMilestoneIds: ${this.ignoreMilestoneIds}`);
(0, utils_1.safeLog)(`minimumVotes: ${this.minimumVotes}`);
(0, utils_1.safeLog)(`maximumVotes: ${this.maximumVotes}`);
(0, utils_1.safeLog)(`involves: ${this.involves}`);
// Both milestone name and milestone Id must be provided and must match.
// The name is used to construct the query, which does not accept ID.
// The ID is used for comparisons with issue data, which does not include the name.
// TODO: Figure out a way to convert either from milestone name to ID, or vice versa.
// If label inclusion and exclusion are mixed, exclusion will take precedence.
// For example, an issue with both labels A and B will not match if B is excluded, even if A is included.
// If a milestoneName/milestoneId are set, ignoreMilenameName/ignoreMilestoneIds are ignored.
// GitHub does not appear to support searching for all issues with milestones (not lacking a milestone). "-no:milestone" does not work.
// GitHub does not appear to support searching for all issues with labels (not lacking a label). "-no:label" does not work.
// All indicated labels must be present
if (this.labels) {
if (((_a = this.labels) === null || _a === void 0 ? void 0 : _a.length) > 2 && ((_b = this.labels) === null || _b === void 0 ? void 0 : _b.startsWith('"')) && ((_c = this.labels) === null || _c === void 0 ? void 0 : _c.endsWith('"'))) {
this.labels = this.labels.substring(1, this.labels.length - 2);
}
this.labelsSet = (_d = this.labels) === null || _d === void 0 ? void 0 : _d.split(',');
for (const str of this.labelsSet) {
if (str != "") {
query = query.concat(` label:"${str}"`);
}
}
}
// The "involves" qualifier to find issues that in some way involve a certain user.
// It is a logical OR between the author, assignee, and mentions.
if (this.involves) {
this.involvesSet = (_e = this.involves) === null || _e === void 0 ? void 0 : _e.split(',');
for (const str of this.involvesSet) {
if (str != "") {
query = query.concat(` involves:"${str}"`);
}
}
}
if (this.ignoreLabels) {
if (this.ignoreLabels == "*" && !this.labels) { // only if unlabeled
query = query.concat(` no:label`);
this.ignoreAllWithLabels = true;
}
else {
this.ignoreLabelsSet = (_f = this.ignoreLabels) === null || _f === void 0 ? void 0 : _f.split(',');
for (const str of this.ignoreLabelsSet) {
if (str != "") {
query = query.concat(` -label:"${str}"`);
}
}
}
}
if (this.milestoneName) {
query = query.concat(` milestone:"${this.milestoneName}"`);
}
else if (this.ignoreMilestoneNames) {
if (this.ignoreMilestoneNames == "*") {
query = query.concat(` no:milestone`);
this.ignoreAllWithMilestones = true;
}
else if (this.ignoreMilestoneIds) {
this.ignoreMilestoneNamesSet = this.ignoreMilestoneNames.split(',');
this.ignoreMilestoneIdsSet = this.ignoreMilestoneIds.split(',');
for (const str of this.ignoreMilestoneNamesSet) {
if (str != "") {
query = query.concat(` -milestone:"${str}"`);
}
}
}
}
return query;
}
// This is necessary because GitHub sometimes returns incorrect results,
// and because issues may get modified while we are processing them.
validateIssue(issue) {
var _a, _b;
if (this.ignoreAllWithLabels) {
// Validate that the issue does not have labels
if (issue.labels && issue.labels.length !== 0) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to label found after querying for no:label.`);
return false;
}
}
else {
// Make sure all labels we wanted are present.
if ((!issue.labels || issue.labels.length == 0) && this.labelsSet.length > 0) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set. No labels found.`);
return false;
}
for (const str of this.labelsSet) {
if (!issue.labels.includes(str)) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having a required label set.`);
return false;
}
}
// Make sure no labels we wanted to ignore are present.
if (issue.labels && issue.labels.length > 0) {
for (const str of this.ignoreLabelsSet) {
if (issue.labels.includes(str)) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having an ignore label set: ${str}`);
return false;
}
}
}
}
if (this.ignoreAllWithMilestones) {
// Validate that the issue does not have a milestone.
if (issue.milestone) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone found after querying for no:milestone.`);
return false;
}
}
else {
// Make sure milestone is present, if required.
if (this.milestoneId != null && ((_a = issue.milestone) === null || _a === void 0 ? void 0 : _a.milestoneId) != +this.milestoneId) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having required milsetone id ${this.milestoneId}. Had: ${(_b = issue.milestone) === null || _b === void 0 ? void 0 : _b.milestoneId}`);
return false;
}
// Make sure a milestones we wanted to ignore is not present.
if (issue.milestone && issue.milestone.milestoneId != null) {
for (const str of this.ignoreMilestoneIdsSet) {
if (issue.milestone.milestoneId == +str) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to milestone ${issue.milestone.milestoneId} found in list of ignored milestone IDs.`);
return false;
}
}
}
}
// Verify the issue has a sufficient number of upvotes
let upvotes = 0;
if (issue.reactions) {
upvotes = issue.reactions['+1'];
}
if (this.minimumVotes != undefined) {
if (upvotes < this.minimumVotes) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to not having at least ${this.minimumVotes} upvotes. Had: ${upvotes}`);
return false;
}
}
// Verify the issue does not have too many upvotes
if (this.maximumVotes != undefined) {
if (upvotes > this.maximumVotes) {
(0, utils_1.safeLog)(`Issue ${issue.number} skipped due to having more than ${this.maximumVotes} upvotes. Had: ${upvotes}`);
return false;
}
}
return true;
}
}
exports.ActionBase = ActionBase;
//# sourceMappingURL=ActionBase.js.map
+1135 -912
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -15,7 +15,7 @@
"@octokit/rest": "^19.0.3",
"@slack/web-api": "^6.9.1",
"applicationinsights": "^2.5.1",
"axios": "^1.6.1",
"axios": "^1.6.8",
"uuid": "^8.3.2"
},
"devDependencies": {
+28
View File
@@ -0,0 +1,28 @@
name: Bug - debugger
on:
schedule:
- cron: 50 12 * * * # Run at 12:50 PM UTC (4:50 AM PST, 5:50 AM PDT)
workflow_dispatch:
inputs:
readonly:
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
default: false
jobs:
main:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout Actions
uses: actions/checkout@v2
- name: Install Actions
run: cd ./.github/actions && npm install --production && cd ../..
- name: Add Comment
uses: ./.github/actions/AddComment
with:
readonly: ${{ github.event.inputs.readonly }}
labels: bug,debugger
ignoreLabels: "investigate: costing,investigate,external,by design,question,more info needed,language service,internal"
createdAfter: "2024-07-22"
addComment: "Thank you for reporting this issue. Well let you know if we need more information to investigate it. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated."
@@ -1,7 +1,7 @@
name: By Design closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 0 13 * * * # Run at 1:00 PM UTC (5:00 AM PST, 6:00 AM PDT)
workflow_dispatch:
inputs:
readonly:
+93
View File
@@ -0,0 +1,93 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ "main", "insiders", "release", "vs" ]
pull_request:
branches: [ "main", "insiders", "release", "vs" ]
schedule:
- cron: '29 4 * * 3'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
@@ -1,7 +1,7 @@
name: Enhancement Closer (no milestone)
on:
schedule:
- cron: 50 11 * * * # Run at 11:50 AM UTC (3:50 AM PST, 4:50 AM PDT)
- cron: 40 12 * * * # Run at 12:40 PM UTC (4:40 AM PST, 5:40 AM PDT)
workflow_dispatch:
inputs:
readonly:
@@ -1,7 +1,7 @@
name: Enhancement Closer (Triage)
on:
schedule:
- cron: 40 11 * * * # Run at 11:40 AM UTC (3:40 AM PST, 4:40 AM PDT)
- cron: 30 12 * * * # Run at 12:30 PM UTC (4:30 AM PST, 5:30 AM PDT)
workflow_dispatch:
inputs:
readonly:
+1 -1
View File
@@ -1,7 +1,7 @@
name: Enhancement Reopener
on:
schedule:
- cron: 20 12 * * * # Run at 12:20 PM UTC (4:20 AM PST, 5:20 AM PDT)
- cron: 0 11 * * * # Run at 11:00 AM UTC (3:00 AM PST, 4:00 AM PDT)
workflow_dispatch:
inputs:
readonly:
@@ -1,7 +1,7 @@
name: External closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 10 13 * * * # Run at 1:10 PM UTC (5:10 AM PST, 6:10 AM PDT)
workflow_dispatch:
inputs:
readonly:
@@ -0,0 +1,28 @@
name: Feature Request - debugger
on:
schedule:
- cron: 20 13 * * * # Run at 1:20 PM UTC (5:20 AM PST, 6:20 AM PDT)
workflow_dispatch:
inputs:
readonly:
description: "readonly: Specify true or 1 to prevent changes from being commited to GitHub"
default: false
jobs:
main:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout Actions
uses: actions/checkout@v2
- name: Install Actions
run: cd ./.github/actions && npm install --production && cd ../..
- name: Add Comment
uses: ./.github/actions/AddComment
with:
readonly: ${{ github.event.inputs.readonly }}
labels: feature request,debugger
ignoreLabels: "investigate: costing,investigate,external,by design,question,more info needed,language service,internal"
createdAfter: "2024-07-22"
addComment: "Thank you for your feature request. While we may not be able to implement it immediately, we will monitor community reactions to see how it fits into our backlog. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated."
@@ -1,7 +1,7 @@
name: Investigate closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 30 13 * * * # Run at 1:30 PM UTC (5:30 AM PST, 6:30 AM PDT)
workflow_dispatch:
inputs:
readonly:
@@ -1,7 +1,7 @@
name: Investigate Costing closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 40 13 * * * # Run at 1:40 PM UTC (5:40 AM PST, 6:40 AM PDT)
workflow_dispatch:
inputs:
readonly:
@@ -1,7 +1,7 @@
name: More Info Needed Closer - debugger
on:
schedule:
- cron: 10 11 * * * # Run at 11:10 AM UTC (3:10 AM PST, 4:10 AM PDT)
- cron: 50 13 * * * # Run at 1:50 PM UTC (5:50 AM PST, 6:50 AM PDT)
workflow_dispatch:
inputs:
readonly:
@@ -1,7 +1,7 @@
name: Question Closer - debugger
on:
schedule:
- cron: 20 11 * * * # Run at 11:20 AM UTC (3:20 AM PST, 4:20 AM PDT)
- cron: 0 14 * * * # Run at 2:00 PM UTC (6:00 AM PST, 7:00 AM PDT)
workflow_dispatch:
inputs:
readonly:
+2 -2
View File
@@ -80,9 +80,9 @@ extends:
displayName: Use Yarn 1.x
- task: UseNode@1
displayName: Use Node 16.x
displayName: Use Node 18.x
inputs:
version: 16.x
version: 18.x
- task: CmdLine@2
displayName: Delete .npmrc if it exists
+67 -37
View File
@@ -2,11 +2,14 @@
# Pipeline for VsCodeExtension-Localization build definition
# Runs OneLocBuild task to localize xlf file
# ==================================================================================
resources:
repositories:
- repository: self
clean: true
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
trigger: none
pr: none
@@ -18,45 +21,72 @@ schedules:
- main
always: true
pool:
name: 'AzurePipelines-EO'
demands:
- ImageOverride -equals AzurePipelinesWindows2022compliant
variables:
TeamName: cpptools
Codeql.Language: javascript
steps:
- task: NodeTool@0
inputs:
versionSpec: '18.x'
displayName: 'Install Node.js'
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
stages:
- stage: stage
jobs:
- job: job
templateContext:
outputs:
- output: pipelineArtifact
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
publishLocation: 'Container'
steps:
- task: NodeTool@0
inputs:
versionSpec: '18.x'
displayName: 'Install Node.js'
- task: CmdLine@2
inputs:
script: 'cd Extension && yarn install'
- task: CmdLine@2
inputs:
script: 'cd Extension && yarn install'
- task: CmdLine@2
inputs:
script: 'cd ./Extension && yarn run translations-export && cd ..'
- task: CmdLine@2
inputs:
script: 'cd ./Extension && yarn run translations-export && cd ..'
- task: OneLocBuild@2
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
locProj: 'Build/loc/LocProject.json'
outDir: '$(Build.ArtifactStagingDirectory)'
isCreatePrSelected: false
prSourceBranchPrefix: 'locfiles'
packageSourceAuth: 'patAuth'
patVariable: '$(OneLocBuildPat)'
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-VCPP'
lsBuildXLocPackageVersion: '7.0.30510'
# Requires Azure client 2.x
- task: AzureCLI@2
displayName: 'Set OneLocBuildToken'
enabled: true
inputs:
azureSubscription: '$(AzureSubscription)' # Azure DevOps service connection
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: |
$token = az account get-access-token --query accessToken --resource $(AzureGuid) -o tsv
Write-Host "##vso[task.setvariable variable=AzDO.OneLocBuildToken;issecret=true]${token}"
- task: CmdLine@2
inputs:
script: 'cd Extension && node ./translations_auto_pr.js microsoft vscode-cpptools csigs $(csigsPat) csigs [email protected] "$(Build.ArtifactStagingDirectory)/loc" vscode-extensions-localization-export/vscode-extensions && cd ..'
- task: OneLocBuild@2
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
locProj: 'Build/loc/LocProject.json'
outDir: '$(Build.ArtifactStagingDirectory)'
isCreatePrSelected: false
prSourceBranchPrefix: 'locfiles'
packageSourceAuth: 'patAuth'
patVariable: '$(AzDO.OneLocBuildToken)'
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-VCPP'
lsBuildXLocPackageVersion: '7.0.30510'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: CmdLine@2
inputs:
script: 'cd Extension && node ./translations_auto_pr.js microsoft vscode-cpptools csigs $(csigsPat) csigs [email protected] "$(Build.ArtifactStagingDirectory)/loc" vscode-extensions-localization-export/vscode-extensions && cd ..'
+48
View File
@@ -0,0 +1,48 @@
name: $(date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none
parameters:
- name: verifyVersion
displayName: Attest version in package.json is correct
type: boolean
default: false
- name: verifyReadme
displayName: Attest README.md is updated
type: boolean
default: false
resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
stages:
- stage: package
jobs:
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
- ${{ if not(eq(parameters.verifyVersion, true)) }}:
- 'The version in package.json should be updated before scheduling the pipeline.'
- ${{ if not(eq(parameters.verifyReadme, true)) }}:
- 'README.md should be updated before scheduling the pipeline.'
- template: /Build/package/jobs_package_vsix.yml@self
parameters:
vsixName: cpptools-extension-pack.vsix
srcDir: ExtensionPack
+48
View File
@@ -0,0 +1,48 @@
name: $(date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none
parameters:
- name: verifyVersion
displayName: Attest version in package.json is correct
type: boolean
default: false
- name: verifyReadme
displayName: Attest README.md is updated
type: boolean
default: false
resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
stages:
- stage: package
jobs:
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
- ${{ if not(eq(parameters.verifyVersion, true)) }}:
- 'The version in package.json should be updated before scheduling the pipeline.'
- ${{ if not(eq(parameters.verifyReadme, true)) }}:
- 'README.md should be updated before scheduling the pipeline.'
- template: /Build/package/jobs_package_vsix.yml@self
parameters:
vsixName: cpptools-themes.vsix
srcDir: Themes
+54
View File
@@ -0,0 +1,54 @@
parameters:
- name: vsixName
type: string
default: ''
- name: srcDir
type: string
default: ''
jobs:
- job: package
displayName: Build ${{ parameters.vsixName }}
timeoutInMinutes: 30
cancelTimeoutInMinutes: 1
templateContext:
outputs:
- output: pipelineArtifact
displayName: '${{ parameters.vsixName }}'
targetPath: $(Build.ArtifactStagingDirectory)\vsix
artifactName: vsix
steps:
- checkout: self
- task: UseNode@1
displayName: Use Node 18.x
inputs:
version: 18.x
- task: Npm@0
displayName: Install vsce
inputs:
arguments: --global @vscode/vsce
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
displayName: Use Yarn 1.x
- task: CmdLine@1
displayName: Create Staging Directory
inputs:
filename: mkdir
arguments: $(Build.ArtifactStagingDirectory)\vsix
- task: CmdLine@1
displayName: Run VSCE to package vsix
inputs:
filename: vsce
arguments: package --yarn -o $(Build.ArtifactStagingDirectory)\vsix\${{ parameters.vsixName }}
workingFolder: $(Build.SourcesDirectory)\${{ parameters.srcDir }}
- task: Npm@0
displayName: Uninstall vsce
inputs:
command: uninstall
arguments: --global @vscode/vsce
+43
View File
@@ -0,0 +1,43 @@
name: $(Date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none
resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
pipelines:
- pipeline: vsixBuild
source: '\VC\VSCode\CpptoolsVSIX\Package cpptools-extension-pack'
trigger: true
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
stages:
- stage: Validate
jobs:
- template: /Build/publish/jobs_manual_validation.yml@self
parameters:
notifyUsers: $(NotifyUsers)
releaseBuildUrl: $(ReleaseBuildUrl)
- stage: Release
dependsOn: Validate
jobs:
- template: /Build/publish/jobs_publish_vsix.yml@self
parameters:
vsixName: cpptools-extension-pack.vsix
+43
View File
@@ -0,0 +1,43 @@
name: $(Date:yyyyMMdd)$(rev:.r)
trigger: none
pr: none
resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
pipelines:
- pipeline: vsixBuild
source: '\VC\VSCode\CpptoolsVSIX\Package cpptools-themes'
trigger: true
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
stages:
- stage: Validate
jobs:
- template: /Build/publish/jobs_manual_validation.yml@self
parameters:
notifyUsers: $(NotifyUsers)
releaseBuildUrl: $(ReleaseBuildUrl)
- stage: Release
dependsOn: Validate
jobs:
- template: /Build/publish/jobs_publish_vsix.yml@self
parameters:
vsixName: cpptools-themes.vsix
+19
View File
@@ -0,0 +1,19 @@
parameters:
- name: notifyUsers
type: string
default: ''
- name: releaseBuildUrl
type: string
default: ''
jobs:
- job: WaitForValidation
displayName: Wait for VSIX validation
pool: server
steps:
- task: ManualValidation@0
displayName: "Manual Validation"
inputs:
notifyUsers: $(notifyUsers)
instructions: |
Download and test the vsix from the latest release build: $(releaseBuildUrl)
+44
View File
@@ -0,0 +1,44 @@
parameters:
- name: vsixName
type: string
default: ''
jobs:
- job: Publish
displayName: Publish to Marketplace
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
pipeline: vsixBuild
artifactName: vsix
targetPath: $(Build.StagingDirectory)\vsix
steps:
- task: NodeTool@0
displayName: Use Node 18.x
inputs:
versionSpec: 18.x
- task: Npm@0
displayName: Install vsce
inputs:
arguments: --global @vscode/vsce
- task: AzureCLI@2
displayName: Generate AAD_TOKEN
inputs:
azureSubscription: $(AzureSubscription)
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
$aadToken = az account get-access-token --query accessToken --resource $(AzureGuid) -o tsv
Write-Host "##vso[task.setvariable variable=AAD_TOKEN;issecret=true]$aadToken"
- script: |
vsce publish --packagePath $(Build.StagingDirectory)\vsix\${{ parameters.vsixName }}
displayName: Publish to Marketplace
env:
VSCE_PAT: $(AAD_TOKEN)
+5 -3
View File
@@ -33,8 +33,10 @@ export async function main() {
//verbose(`Installing release version of 'ms-vscode.cpptools'`);
//spawnSync(cli, [...args, '--install-extension', 'ms-vscode.cpptools'], { encoding: 'utf-8', stdio: 'ignore' })
verbose(green('Launch VSCode'));
const ARGS = [...args, ...options.launchArgs.filter(each => !each.startsWith('--extensions-dir=') && !each.startsWith('--user-data-dir=')), `--extensionDevelopmentPath=${$root}`, ...$args ];
verbose(gray(`${cli}\n ${ [...ARGS ].join('\n ')}`));
const ARGS = [...args, ...options.launchArgs.filter(each => !each.startsWith('--extensions-dir=') && !each.startsWith('--user-data-dir=')), `--extensionDevelopmentPath=${$root}`, ...$args ].map(each => (each.indexOf(' ') > -1) && (each.indexOf('"') === -1) ? `"${each}"` : each);
const CLI = cli.indexOf(' ') > -1 && cli.indexOf('"') === -1 ? `"${cli}"` : cli;
spawnSync(cli, ARGS, { encoding: 'utf-8', stdio: 'ignore', env: { ...process.env, DONT_PROMPT_WSL_INSTALL:"1" } });
verbose(gray(`${CLI}\n ${ [...ARGS ].join('\n ')}`));
spawnSync(CLI, ARGS, { encoding: 'utf-8', stdio: 'ignore', env: { ...process.env, DONT_PROMPT_WSL_INSTALL:"1" }, shell: true });
}
+1 -1
View File
@@ -75,7 +75,7 @@ filterStdio();
async function unitTests() {
await assertAnyFolder('dist/test/unit', `The folder '${$root}/dist/test/unit is missing. You should run ${brightGreen("yarn compile")}\n\n`);
const mocha = await assertAnyFile(["node_modules/.bin/mocha.cmd", "node_modules/.bin/mocha"], `Can't find the mocha testrunner. You might need to run ${brightGreen("yarn install")}\n\n`);
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio:'inherit'});
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio:'inherit', shell: true });
verbose(`\n${green("NOTE:")} If you want to run a scenario test (end-to-end) use ${cmdSwitch('scenario=<NAME>')} \n\n`);
return result.status;
}
+80 -14
View File
@@ -1,6 +1,75 @@
# C/C++ for Visual Studio Code Changelog
## Version 1.21.1: July 15, 2024
## Version 1.22.2: August 29, 2024
### Enhancement
* Remove the `C_Cpp.intelliSenseEngineFallback` setting. [#12596](https://github.com/microsoft/vscode-cpptools/issues/12596)
### Bug Fix
* Fix a deadlock when doing "Find All References" and a file is deleted. [#12656](https://github.com/microsoft/vscode-cpptools/issues/12656)
## Version 1.22.1: August 29, 2024
### Enhancement
* Add "Additional Tracked Settings" to `C/C++: Log Diagnostics` output. [PR #12635](https://github.com/microsoft/vscode-cpptools/pull/12635)
### Bug Fixes
* Fix hover over static constexpr variables sometimes not working. [#12284](https://github.com/microsoft/vscode-cpptools/issues/12284)
* Fix completion not giving results in several scenarios. [#12412](https://github.com/microsoft/vscode-cpptools/issues/12412)
* Fix include completion showing results for deleted folders with recursive includes. [#12636](https://github.com/microsoft/vscode-cpptools/issues/12636)
* Fix the `/FU` flag not working for C++/CLI . [#12641](https://github.com/microsoft/vscode-cpptools/issues/12641)
* Fix some crashes with recursive includes. [#12643](https://github.com/microsoft/vscode-cpptools/issues/12643)
* Fix IntelliSense not working on Windows when `C_Cpp.caseSensitiveFileSupport` is `enabled`. [#12648](https://github.com/microsoft/vscode-cpptools/issues/12648)
* Changes that might fix a crash with `translate_encoding_to_utf8`. [#12652](https://github.com/microsoft/vscode-cpptools/issues/12652)
* Fix a random crash during IntelliSense creation.
## Version 1.22.0: August 26, 2024
### Performance Improvements
* Switch to an alternative implementation of recursive includes (that sends all the paths instead of only the "used" paths). [#11780](https://github.com/microsoft/vscode-cpptools/issues/11780)
- Performance improvement: Configuration is no longer blocked on tag parsing of all dependent headers.
- Configuration change: Recursive include paths now take precedence over system include paths (similar to compiler behavior and non-recursive includes). [#11485](https://github.com/microsoft/vscode-cpptools/issues/11485)
* Initialization performance improvements. [#12030](https://github.com/microsoft/vscode-cpptools/issues/12030)
- Some processing is parallelized and started earlier (populating the filename cache, discovering files). [#11954](https://github.com/microsoft/vscode-cpptools/issues/11954), [#12169](https://github.com/microsoft/vscode-cpptools/issues/12169)
- Some compiler configuration queries are cached in the database, and processing of compile_commands.json was improved. [#10029](https://github.com/microsoft/vscode-cpptools/issues/10029), [#12078](https://github.com/microsoft/vscode-cpptools/issues/12078)
* Improve the implementation of file buffers to reduce memory usage.
### Enhancements
* Add modified `C_Cpp` settings to the `C/C++: Log Diagnostics` output. [#11700](https://github.com/microsoft/vscode-cpptools/issues/11700)
* Change the default C/C++ `"editor.stickyScroll.defaultModel"` to `"foldingProviderModel"`. [#12483](https://github.com/microsoft/vscode-cpptools/issues/12483)
* Add better validation for settings. [#12371](https://github.com/microsoft/vscode-cpptools/issues/12371)
* Various IntelliSense parsing updates/fixes.
### Bug Fixes
* Stop logging duplicate compiler path messages. [#12445](https://github.com/microsoft/vscode-cpptools/issues/12445)
* Fix an issue where a file is incorrectly processed as C instead of C++. [#12466](https://github.com/microsoft/vscode-cpptools/issues/12466)
* Fix include path ordering being incorrect if there is a duplicate. [#12525](https://github.com/microsoft/vscode-cpptools/issues/12525)
* Fix a WebAssembly "Out of Memory" error. [#12529](https://github.com/microsoft/vscode-cpptools/issues/12529)
* Fix an error message not being shown if the connection failed with remote attach debugging. [#12547](https://github.com/microsoft/vscode-cpptools/issues/12547)
* Thank you for the contribution. [@MrStanislav0 (Stanislav)](https://github.com/MrStanislav0)
* Fix `-I` not being used if `-iquote` is also used for the same path. [#12551](https://github.com/microsoft/vscode-cpptools/issues/12551)
* Fix issues with relative paths on `nvcc` (CUDA) command lines not being handled correctly. [#12553](https://github.com/microsoft/vscode-cpptools/issues/12553)
* Fix a random crash when a child process is created. [#12585](https://github.com/microsoft/vscode-cpptools/issues/12585)
* Fix a crash on shutdown on macOS with a verbose logging level. [#12567](https://github.com/microsoft/vscode-cpptools/issues/12567)
* Fix some issues with recursive includes handling of symbolic links, multi-root, exclusion changes, and file/folder deletion.
* Fix unnecessary IntelliSense resetting when a new file or folder was created.
* Fix accumulation of stale signature help and completion requests.
* Fix some bugs with include completion.
## Version 1.21.6: August 5, 2024
* Fix a cpptools-srv crash on shutdown. [#12354](https://github.com/microsoft/vscode-cpptools/issues/12354)
## Version 1.21.5: July 31, 2024
### Bug Fixes
* Fix clang-format and clang-tidy not working on Windows 10. [#12289](https://github.com/microsoft/vscode-cpptools/issues/12289)
* Fix a crash with cpptools-srv on certain macOS versions. [#12354](https://github.com/microsoft/vscode-cpptools/issues/12354)
* Fix cpptools crashing on macOS Big Sur or older. [#12511](https://github.com/microsoft/vscode-cpptools/issues/12511)
* Fix debugging on Windows ARM64. [#12520](https://github.com/microsoft/vscode-cpptools/issues/12520)
## Version 1.21.4: July 25, 2024
* Re-enable compatibility with VS Code 1.67.0 (instead of 1.82.0). [#12507](https://github.com/microsoft/vscode-cpptools/issues/12507)
## Version 1.21.3: July 24, 2024
* Fix a crash on Linux ARM OS's. [#12497](https://github.com/microsoft/vscode-cpptools/issues/12497)
## Version 1.21.2: July 12, 2024
### Enhancements
* Add `see` and `sa` to the `C_Cpp.doxygen.sectionTags` setting. [#12384](https://github.com/microsoft/vscode-cpptools/issues/12384)
* Update the vcpkg header database. [PR #12430](https://github.com/microsoft/vscode-cpptools/pull/12430)
@@ -9,30 +78,27 @@
* Various IntelliSense engine updates/fixes.
### Bug Fixes
* Stop logging file watch events for excluded files. [#11455](https://github.com/microsoft/vscode-cpptools/issues/11455)
* Fix a crash if the Ryzen 3000 doesn't have updated drivers. [#12201](https://github.com/microsoft/vscode-cpptools/issues/12201)
* Fix handling of `-isystem` and `-iquote` for IntelliSense configuration. [#12207](https://github.com/microsoft/vscode-cpptools/issues/12207)
* Fix doxygen comment generation when `/**` comments are used. [#12249](https://github.com/microsoft/vscode-cpptools/issues/12249)
* Fix a code analysis crash on Linux if the message is too long. [#12285](https://github.com/microsoft/vscode-cpptools/issues/12285)
* Fix relative paths in `compile_commands.json` to be relative to the `compile_commands.json`'s directory. [#12290](https://github.com/microsoft/vscode-cpptools/issues/12290)
* Fix a tag parser performance regression. [#12292](https://github.com/microsoft/vscode-cpptools/issues/12292)
* Fix a regression with cl.exe system include path detection. [#12293](https://github.com/microsoft/vscode-cpptools/issues/12293)
* Fix code analysis, find all references, and rename from getting the wrong configuration for non-open files on the first run when using a configuration provider. [#12313](https://github.com/microsoft/vscode-cpptools/issues/12313)
* Fix potential crashes. [#12354](https://github.com/microsoft/vscode-cpptools/issues/12354)
* Fix handling of doxygen comment blocks with `*//*` in them. [#12316](https://github.com/microsoft/vscode-cpptools/issues/12316)
* Fix potential crashes during IntelliSense process shutdown. [#12354](https://github.com/microsoft/vscode-cpptools/issues/12354)
* Fix the language status not showing it's busy while the tag parser is initializing. [#12403](https://github.com/microsoft/vscode-cpptools/issues/12403)
* Fix the vcpkg code action not appearing for missing headers available via vcpkg. [#12413](https://github.com/microsoft/vscode-cpptools/issues/12413)
* Fix custom configurations sometimes not getting used. [PR #12427](https://github.com/microsoft/vscode-cpptools/pull/12427)
* Fix a code analysis error when using gcc 14. [#12428](https://github.com/microsoft/vscode-cpptools/issues/12428)
* Fix warning notification showing when `C_Cpp.getIncludes` is disabled. [PR #12470](https://github.com/microsoft/vscode-cpptools/pull/12470)
* Fix a cause of colorization, inactive regions, and inlay hints getting cleared when an update is pending.
* Fix a cause of semantic tokens transiently being placed in the wrong location.
* Fix a potential deadlock when configured using compile commands.
## Version 1.21.0: June 17, 2024
### Bug Fixes
* Stop logging file watch events for excluded files. [#11455](https://github.com/microsoft/vscode-cpptools/issues/11455)
* Fix handling of `-isystem` and `-iquote` for IntelliSense configuration. [#12207](https://github.com/microsoft/vscode-cpptools/issues/12207)
* Fix doxygen comment generation when `/**` comments are used. [#12249](https://github.com/microsoft/vscode-cpptools/issues/12249)
* Fix a code analysis crash on Linux if the message is too long. [#12285](https://github.com/microsoft/vscode-cpptools/issues/12285)
* Fix a regression with cl.exe system include path detection. [#12293](https://github.com/microsoft/vscode-cpptools/issues/12293)
* Fix handling of doxygen comment blocks with `*//*` in them. [#12316](https://github.com/microsoft/vscode-cpptools/issues/12316)
* Fix a crash during IntelliSense process shutdown. [#12354](https://github.com/microsoft/vscode-cpptools/issues/12354)
* Update the default clang/gcc versions used for IntelliSense if an unknown version is found.
* Fix a cause of semantic tokens transiently being placed in the wrong location.
* Update clang-format and clang-tidy from 18.1.2 to 18.1.7 (for the bug fixes).
* Fix a potential deadlock when configured using compile commands.
## Version 1.20.5: May 6, 2024
### Enhancements
+131 -147
View File
@@ -627,32 +627,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
minimatch 9.0.2 - ISC
https://github.com/isaacs/minimatch#readme
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
The ISC License
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@@ -683,7 +657,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
semver 7.6.2 - ISC
semver 7.6.3 - ISC
https://github.com/npm/node-semver#readme
Copyright Isaac Z. Schlueter
@@ -762,12 +736,83 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
---------------------------------------------------------
@microsoft/applicationinsights-channel-js 3.2.2 - MIT
@microsoft/1ds-core-js 4.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
copyright Microsoft 2018
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 Solutions LLC and contributors
The MIT License (MIT)
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@microsoft/1ds-post-js 4.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
copyright Microsoft 2018
copyright Microsoft 2020
copyright Microsoft 2018-2020
copyright Microsoft 2022 Simple
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 Solutions LLC and contributors
The MIT License (MIT)
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@microsoft/applicationinsights-channel-js 3.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 and contributors
Copyright (c) NevWare21 Solutions LLC and contributors
The MIT License (MIT)
@@ -796,12 +841,12 @@ SOFTWARE.
---------------------------------------------------------
@microsoft/applicationinsights-common 3.2.2 - MIT
@microsoft/applicationinsights-common 3.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 and contributors
Copyright (c) NevWare21 Solutions LLC and contributors
The MIT License (MIT)
@@ -830,12 +875,12 @@ SOFTWARE.
---------------------------------------------------------
@microsoft/applicationinsights-core-js 3.2.2 - MIT
@microsoft/applicationinsights-core-js 3.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 and contributors
Copyright (c) NevWare21 Solutions LLC and contributors
The MIT License (MIT)
@@ -893,6 +938,40 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@microsoft/applicationinsights-web-basic 3.3.1 - MIT
https://github.com/microsoft/ApplicationInsights-JS#readme
Copyright (c) Microsoft Corporation
Copyright (c) Microsoft and contributors
Copyright (c) NevWare21 Solutions LLC and contributors
The MIT License (MIT)
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@@ -931,17 +1010,17 @@ SOFTWARE.
---------------------------------------------------------
@nevware21/ts-async 0.5.1 - MIT
@nevware21/ts-async 0.5.2 - MIT
https://github.com/nevware21/ts-async
Copyright (c) 2022 Nevware21
Copyright (c) 2023 Nevware21
Copyright (c) 2024 Nevware21
Copyright (c) NevWare21 and contributors
Copyright (c) 2022 NevWare21 Solutions LLC
Copyright (c) 2023 NevWare21 Solutions LLC
Copyright (c) 2024 NevWare21 Solutions LLC
Copyright (c) NevWare21 Solutions LLC and contributors
MIT License
Copyright (c) 2022 Nevware21
Copyright (c) 2022 NevWare21 Solutions LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -966,18 +1045,17 @@ SOFTWARE.
---------------------------------------------------------
@nevware21/ts-utils 0.11.2 - MIT
@nevware21/ts-utils 0.11.3 - MIT
https://github.com/nevware21/ts-utils
Copyright (c) 2022 NevWare21
Copyright (c) 2022 Nevware21
Copyright (c) 2023 Nevware21
Copyright (c) 2024 Nevware21
Copyright (c) NevWare21 and contributors
Copyright (c) 2022 NevWare21 Solutions LLC
Copyright (c) 2023 NevWare21 Solutions LLC
Copyright (c) 2024 NevWare21 Solutions LLC
Copyright (c) NevWare21 Solutions LLC and contributors
MIT License
Copyright (c) 2022 NevWare21
Copyright (c) 2022 NevWare21 Solutions LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -1002,39 +1080,7 @@ SOFTWARE.
---------------------------------------------------------
@one-ini/wasm 0.1.1 - MIT
https://github.com/one-ini/core#readme
Copyright (c) 2019 Jed Mao
MIT License
Copyright (c) 2019 Jed Mao
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@vscode/extension-telemetry 0.9.6 - MIT
@vscode/extension-telemetry 0.9.7 - MIT
https://github.com/Microsoft/vscode-extension-telemetry#readme
Copyright (c) Microsoft Corporation
@@ -1370,40 +1416,7 @@ THE SOFTWARE.
---------------------------------------------------------
commander 11.1.0 - MIT
https://github.com/tj/commander.js#readme
Copyright (c) 2011 TJ Holowaychuk <[email protected]>
(The MIT License)
Copyright (c) 2011 TJ Holowaychuk <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
comment-json 4.2.3 - MIT
comment-json 4.2.5 - MIT
https://github.com/kaelzhang/node-comment-json#readme
Copyright (c) 2013 kaelzhang
@@ -1489,36 +1502,6 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
editorconfig 2.0.0 - MIT
https://github.com/editorconfig/editorconfig-core-js#readme
Copyright (c) 2012 EditorConfig Team
Copyright © 2012 EditorConfig Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
@@ -1907,6 +1890,7 @@ SOFTWARE.
node-loader 2.0.0 - MIT
https://github.com/webpack-contrib/node-loader
Copyright JS Foundation and other contributors
Copyright JS Foundation and other contributors
@@ -2395,7 +2379,7 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-jsonrpc 8.2.0 - MIT
vscode-jsonrpc 8.1.0 - MIT
https://github.com/Microsoft/vscode-languageserver-node#readme
Copyright (c) Microsoft Corporation
@@ -2417,7 +2401,7 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-languageclient 9.0.1 - MIT
vscode-languageclient 8.1.0 - MIT
https://github.com/Microsoft/vscode-languageserver-node#readme
Copyright (c) Microsoft Corporation
@@ -2439,7 +2423,7 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-languageserver-protocol 3.17.5 - MIT
vscode-languageserver-protocol 3.17.3 - MIT
https://github.com/Microsoft/vscode-languageserver-node#readme
Copyright (c) Microsoft Corporation
@@ -2462,7 +2446,7 @@ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
---------------------------------------------------------
vscode-languageserver-types 3.17.5 - MIT
vscode-languageserver-types 3.17.3 - MIT
https://github.com/Microsoft/vscode-languageserver-node#readme
Copyright (c) Microsoft Corporation
+2 -2
View File
@@ -2953,9 +2953,9 @@
"Neplatná hodnota sady pragma %s pro funkci s omezením AMP",
"Překrývající se specifikátory omezení nejsou povolené.",
"Specifikátory omezení destruktoru musejí pokrývat sjednocení specifikátorů omezení všech konstruktorů.",
null,
"<error>",
"Pro nostdlib se vyžaduje aspoň jedno nucené použití.",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"Unzulässiger Wert für Pragmapaket \"%s\" für die auf AMP begrenzte Funktion.",
"Überlappende Einschränkungsspezifizierer sind unzulässig.",
"Die Einschränkungsspezifizierer des Destruktors müssen die Union der Einschränkungsspezifizierer für alle Konstruktoren abdecken.",
null,
"<error>",
"Für \"nostdlib\" ist mindestens eine erzwungene Verwendung erforderlich.",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"valor de pragma pack %s no válido para la función con restricción amp",
"no se permiten especificadores de restricción superpuestos",
"los especificadores de restricción del destructor deben cubrir la unión de los especificadores de restricción de todos los constructores",
null,
"<error>",
"nostdlib requiere al menos un uso forzado",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"valeur de pragma pack non conforme %s pour la fonction à restriction amp",
"spécificateurs de restriction en chevauchement non autorisés",
"les spécificateurs de restriction du destructeur doivent couvrir l'union des spécificateurs de restriction sur tous les constructeurs",
null,
"<error>",
"nostdlib nécessite au moins un using forcé",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"il valore %s del pacchetto pragma per la funzione con restrizioni AMP non è valido",
"gli identificatori di limitazione sovrapposti non sono consentiti",
"gli identificatori di limitazione del distruttore devono coprire l'unione degli identificatori di limitazione in tutti i costruttori",
null,
"<error>",
"con nostdlib è richiesta almeno un'opzione Forced Using",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"amp 制限関数に無効な pragma pack 値 %s ",
"重複した制限指定子は許可されていません",
"デストラクターの制限指定子は、すべてのコンストラクターの制限指定子の和集合を対象とする必要があります",
null,
"<error>",
"nostdlib には少なくとも 1 つの強制された using が必要です",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"amp 제한 함수의 pragma pack 값 %s이(가) 잘못되었습니다.",
"겹치는 제한 지정자는 사용할 수 없습니다.",
"소멸자의 제한 지정자는 모든 생성자에 대한 제한 지정자의 공용 구조체를 지정해야 합니다.",
null,
"<error>",
"nostdlib에는 한 번 이상의 강제 사용이 필요합니다.",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"niedozwolona wartość dyrektywy pragma pack %s dla funkcji z ograniczeniem amp",
"nakładające się specyfikatory ograniczenia są niedozwolone",
"specyfikatory ograniczenia destruktora muszą obejmować unię specyfikatorów ograniczenia na wszystkich konstruktorach",
null,
"<error>",
"element nostdlib wymaga co najmniej jednego wymuszonego użycia",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"valor do pacote pragma %s ilícito para a função restrita por amp",
"não é permitido sobrepor especificadores restritos",
"os especificadores restritos do destruidor devem conter a união dos especificadores restritos em todos os construtores",
null,
"<error>",
"o nostdlib exige pelo menos um uso forçado",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"Недопустимое значение pragma pack %s для функции со спецификатором ограничения amp.",
"перекрывающиеся описатели restrict запрещены",
"описатели restrict деструктора должны охватывать объединение описателей restrict всех конструкторов",
null,
"<error>",
"для nostdlib требуется по меньшей мере одна директива forced using",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"AMP ile sınırlı işlev için pragma paket değeri (%s) geçersiz",
"örtüşen kısıtlama tanımlayıcılarına izin verilmiyor",
"yıkıcının kısıtlama tanımlayıcıları, tüm oluşturuculardaki kısıtlama tanımlayıcılarının birleşimini kapsamalıdır",
null,
"<error>",
"nostdlib en az bir zorunlu kullanım gerektirir",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"受 AMP 限制的函数的 pragma 包值 %s 非法",
"限制说明符不可重叠",
"析构函数的限制说明符必须包含所有构造函数的限制说明符的联合部分",
null,
"<error>",
"nostdlib 要求至少使用一个强制 using",
null,
"<error-type>",
null,
null,
null,
+2 -2
View File
@@ -2953,9 +2953,9 @@
"AMP 限制涵式中有不合法的 pragma 套件值 %s",
"不允許重疊的限制指定名稱",
"解構函式的限制規範必須涵蓋所有建構函式的限制規範聯集",
null,
"<error>",
"nostdlib 至少需要一個強制 Using",
null,
"<error-type>",
null,
null,
null,
+4 -4
View File
@@ -4,13 +4,13 @@
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1939",
"1941",
"--pack_alignment",
"8",
"-D_MSC_VER=1939",
"-D_MSC_FULL_VER=193933519",
"-D_MSC_VER=1941",
"-D_MSC_FULL_VER=194134120",
"-D_MSC_BUILD=0",
"-D_M_ARM=7"
],
"defaults_op": "merge"
}
}
+4 -4
View File
@@ -4,14 +4,14 @@
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1939",
"1941",
"--pack_alignment",
"8",
"-D_CPPUNWIND=1",
"-D_MSC_VER=1939",
"-D_MSC_FULL_VER=193933519",
"-D_MSC_VER=1941",
"-D_MSC_FULL_VER=194134120",
"-D_MSC_BUILD=0",
"-D_M_ARM64=1"
],
"defaults_op": "merge"
}
}
+18 -18
View File
@@ -1,18 +1,18 @@
{
"defaults": [
"-D_MSC_EXTENSIONS",
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1939",
"--pack_alignment",
"8",
"-D_CPPUNWIND=1",
"-D_MSC_VER=1939",
"-D_MSC_FULL_VER=193933519",
"-D_MSC_BUILD=0",
"-D_M_X64=100",
"-D_M_AMD64=100"
],
"defaults_op": "merge"
}
{
"defaults": [
"-D_MSC_EXTENSIONS",
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1941",
"--pack_alignment",
"8",
"-D_CPPUNWIND=1",
"-D_MSC_VER=1941",
"-D_MSC_FULL_VER=194134120",
"-D_MSC_BUILD=0",
"-D_M_X64=100",
"-D_M_AMD64=100"
],
"defaults_op": "merge"
}
+17 -17
View File
@@ -1,17 +1,17 @@
{
"defaults": [
"-D_MSC_EXTENSIONS",
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1939",
"--pack_alignment",
"8",
"-D_MSC_VER=1939",
"-D_MSC_FULL_VER=193933519",
"-D_MSC_BUILD=0",
"-D_M_IX86=600",
"-D_M_IX86_FP=2"
],
"defaults_op": "merge"
}
{
"defaults": [
"-D_MSC_EXTENSIONS",
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1941",
"--pack_alignment",
"8",
"-D_MSC_VER=1941",
"-D_MSC_FULL_VER=194134120",
"-D_MSC_BUILD=0",
"-D_M_IX86=600",
"-D_M_IX86_FP=2"
],
"defaults_op": "merge"
}
+4 -1
View File
@@ -18,7 +18,10 @@
"compilerPath": {
"markdownDescription": "Full path of the compiler being used, e.g. `/usr/bin/gcc`, to enable more accurate IntelliSense.",
"descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.",
"type": "string"
"type": [
"string",
"null"
]
},
"compilerArgs": {
"markdownDescription": "Compiler arguments to modify the includes or defines used, e.g. `-nostdinc++`, `-m32`, etc. Arguments that take additional space-delimited arguments should be entered as separate arguments in the array, e.g. for `--sysroot <arg>` use `\"--sysroot\", \"<arg>\"`.",
+26 -32
View File
@@ -2,7 +2,7 @@
"name": "cpptools",
"displayName": "C/C++",
"description": "C/C++ IntelliSense, debugging, and code browsing.",
"version": "1.21.1-main",
"version": "1.22.2-main",
"publisher": "ms-vscode",
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
@@ -610,7 +610,7 @@
"scope": "resource"
},
"C_Cpp.inactiveRegionOpacity": {
"type:": "number",
"type": "number",
"default": 0.55,
"markdownDescription": "%c_cpp.configuration.inactiveRegionOpacity.markdownDescription%",
"scope": "resource",
@@ -827,8 +827,8 @@
"items": {
"type": "string"
},
"default": null,
"uniqueItems": true,
"default": null,
"markdownDescription": "%c_cpp.configuration.default.browse.path.markdownDescription%",
"scope": "machine-overridable"
},
@@ -915,16 +915,6 @@
],
"scope": "resource"
},
"C_Cpp.intelliSenseEngineFallback": {
"type": "string",
"enum": [
"enabled",
"disabled"
],
"default": "disabled",
"markdownDescription": "%c_cpp.configuration.intelliSenseEngineFallback.markdownDescription%",
"scope": "resource"
},
"C_Cpp.exclusionPolicy": {
"type": "string",
"enum": [
@@ -1153,6 +1143,7 @@
"scope": "resource"
},
"C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": {
"type": "string",
"enum": [
"newLine",
"sameLine",
@@ -3286,6 +3277,17 @@
"default": false,
"markdownDescription": "%c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription%",
"scope": "application"
},
"C_Cpp.copilotHover": {
"type": "string",
"enum": [
"default",
"enabled",
"disabled"
],
"default": "default",
"markdownDescription": "%c_cpp.configuration.copilotHover.markdownDescription%",
"scope": "window"
}
}
}
@@ -3341,11 +3343,6 @@
"title": "%c_cpp.command.disableErrorSquiggles.title%",
"category": "C/C++"
},
{
"command": "C_Cpp.ToggleIncludeFallback",
"title": "%c_cpp.command.toggleIncludeFallback.title%",
"category": "C/C++"
},
{
"command": "C_Cpp.ToggleDimInactiveRegions",
"title": "%c_cpp.command.toggleDimInactiveRegions.title%",
@@ -5863,10 +5860,6 @@
"command": "C_Cpp.DisableErrorSquiggles",
"when": "config.C_Cpp.intelliSenseEngine =~ /^[dD]efault$/"
},
{
"command": "C_Cpp.ToggleIncludeFallback",
"when": "config.C_Cpp.intelliSenseEngine =~ /^[dD]efault$/"
},
{
"command": "C_Cpp.ToggleDimInactiveRegions",
"when": "config.C_Cpp.intelliSenseEngine =~ /^[dD]efault$/"
@@ -5988,18 +5981,21 @@
"configurationDefaults": {
"[cpp]": {
"editor.wordBasedSuggestions": "off",
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true
"editor.semanticHighlighting.enabled": true,
"editor.stickyScroll.defaultModel": "foldingProviderModel",
"editor.suggest.insertMode": "replace"
},
"[cuda-cpp]": {
"editor.wordBasedSuggestions": "off",
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true
"editor.semanticHighlighting.enabled": true,
"editor.stickyScroll.defaultModel": "foldingProviderModel",
"editor.suggest.insertMode": "replace"
},
"[c]": {
"editor.wordBasedSuggestions": "off",
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true
"editor.semanticHighlighting.enabled": true,
"editor.stickyScroll.defaultModel": "foldingProviderModel",
"editor.suggest.insertMode": "replace"
}
},
"semanticTokenTypes": [
@@ -6502,7 +6498,6 @@
"@vscode/test-electron": "^2.3.10",
"async-child-process": "^1.1.1",
"await-notify": "^1.0.1",
"copy-webpack-plugin": "^12.0.2",
"eslint": "^8.45.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.29.1",
@@ -6523,7 +6518,7 @@
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"vscode-nls-dev": "^4.0.4",
"webpack": "^5.91.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"xml2js": "^0.6.2"
},
@@ -6531,7 +6526,6 @@
"@vscode/extension-telemetry": "^0.9.6",
"chokidar": "^3.6.0",
"comment-json": "^4.2.3",
"editorconfig": "^2.0.0",
"escape-string-regexp": "^2.0.0",
"glob": "^7.2.3",
"minimatch": "^3.0.5",
@@ -6545,7 +6539,7 @@
"ssh-config": "^4.4.4",
"tmp": "^0.2.3",
"vscode-cpptools": "^6.1.0",
"vscode-languageclient": "^9.0.1",
"vscode-languageclient": "^8.1.0",
"vscode-nls": "^5.2.0",
"vscode-tas-client": "^0.1.84",
"which": "^2.0.2"
+8 -9
View File
@@ -17,7 +17,6 @@
"c_cpp.command.switchHeaderSource.title": "Switch Header/Source",
"c_cpp.command.enableErrorSquiggles.title": "Enable Error Squiggles",
"c_cpp.command.disableErrorSquiggles.title": "Disable Error Squiggles",
"c_cpp.command.toggleIncludeFallback.title": "Toggle IntelliSense Engine Fallback on Include Errors",
"c_cpp.command.toggleDimInactiveRegions.title": "Toggle Inactive Region Colorization",
"c_cpp.command.resetDatabase.title": "Reset IntelliSense Database",
"c_cpp.command.takeSurvey.title": "Take Survey",
@@ -121,7 +120,7 @@
]
},
"c_cpp.configuration.codeAnalysis.exclude.markdownDescription": {
"message": "Configure glob patterns for excluding folders and files for code analysis. Files not under the workspace folder are always excluded. Inherits values from `#files.exclude#` and `#C_Cpp.files.exclude#`. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).",
"message": "Configure glob patterns for excluding folders and files for code analysis. Files not under the workspace folder are always excluded. Inherits values from `#files.exclude#` and `#C_Cpp.files.exclude#`. Learn more about [glob patterns](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).",
"comment": [
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
]
@@ -469,12 +468,6 @@
"c_cpp.configuration.intelliSenseEngine.default.description": "Provides context-aware results via a separate IntelliSense process.",
"c_cpp.configuration.intelliSenseEngine.tagParser.description": "Provides \"fuzzy\" results that are not context-aware.",
"c_cpp.configuration.intelliSenseEngine.disabled.description": "Turns off C/C++ language service features.",
"c_cpp.configuration.intelliSenseEngineFallback.markdownDescription": {
"message": "Controls whether the IntelliSense engine will automatically switch to the Tag Parser for translation units containing `#include` errors.",
"comment": [
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
]
},
"c_cpp.configuration.autocomplete.markdownDescription": {
"message": "Controls the auto-completion provider. If `disabled` and you want word-based completion, you will also need to set `\"[cpp]\": {\"editor.wordBasedSuggestions\": <value>}` (and similarly for `c` and `cuda-cpp` languages).",
"comment": [
@@ -775,6 +768,12 @@
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
]
},
"c_cpp.configuration.copilotHover.markdownDescription": {
"message": "If `enabled`, the hover tooltip will display an option to generate a summary of the symbol with Copilot. If `disabled`, the option will not be displayed.",
"comment": [
"Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered."
]
},
"c_cpp.configuration.renameRequiresIdentifier.markdownDescription": {
"message": "If `true`, 'Rename Symbol' will require a valid C/C++ identifier.",
"comment": [
@@ -788,7 +787,7 @@
]
},
"c_cpp.configuration.filesExclude.markdownDescription": {
"message": "Configure glob patterns for excluding folders (and files if `#C_Cpp.exclusionPolicy#` is changed). These are specific to the C/C++ extension and are in addition to `#files.exclude#`, but unlike `#files.exclude#` they also apply to paths outside the current workspace folder and are not removed from the Explorer view. Read more about glob patterns [here](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).",
"message": "Configure glob patterns for excluding folders (and files if `#C_Cpp.exclusionPolicy#` is changed). These are specific to the C/C++ extension and are in addition to `#files.exclude#`, but unlike `#files.exclude#` they also apply to paths outside the current workspace folder and are not removed from the Explorer view. Learn more about [glob patterns](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).",
"comment": [
"Markdown text between `` and [) should not be translated and the capitalization, spacing, and punctuation (including the ``) should not be altered: https://en.wikipedia.org/wiki/Markdown"
]
+6 -1
View File
@@ -187,13 +187,18 @@ export class RemoteAttachPicker {
const args: string[] = [`-ex "target extended-remote ${miDebuggerServerAddress}"`, '-ex "info os processes"', '-batch'];
let processListOutput: util.ProcessReturnType = await util.spawnChildProcess(miDebuggerPath, args);
// The device may not be responsive for a while during the restart after image deploy. Retry 5 times.
for (let i: number = 0; i < 5 && !processListOutput.succeeded; i++) {
for (let i: number = 0; i < 5 && !processListOutput.succeeded && processListOutput.outputError.length === 0; i++) {
processListOutput = await util.spawnChildProcess(miDebuggerPath, args);
}
if (!processListOutput.succeeded) {
throw new Error(localize('failed.to.make.gdb.connection', 'Failed to make GDB connection: "{0}".', processListOutput.output));
}
if (processListOutput.outputError.length !== 0) {
throw new Error(localize('failed.to.make.gdb.connection', 'Failed to make GDB connection: "{0}".', processListOutput.outputError));
}
const processes: AttachItem[] = this.parseProcessesFromInfoOsProcesses(processListOutput.output);
if (!processes || processes.length === 0) {
throw new Error(localize('failed.to.parse.processes', 'Failed to parse processes: "{0}".', processListOutput.output));
@@ -0,0 +1,33 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { CppSettings } from '../settings';
import { HoverProvider } from './HoverProvider';
export class CopilotHoverProvider implements vscode.HoverProvider {
private provider: HoverProvider;
constructor(provider: HoverProvider) {
this.provider = provider;
}
public async provideHover(document: vscode.TextDocument, _position: vscode.Position, _token: vscode.CancellationToken): Promise<vscode.Hover | undefined> {
const settings: CppSettings = new CppSettings(vscode.workspace.getWorkspaceFolder(document.uri)?.uri);
if (settings.hover === "disabled") {
return undefined;
}
// Why does it show "Loading..." and is that vscode?
// TODO: add intermediate loading state spinner before long ops
const content = await this.provider.showCopilotHover;
if (!content) {
return undefined;
}
const markdownContent = new vscode.MarkdownString(content);
markdownContent.supportThemeIcons = true;
return new vscode.Hover(markdownContent);
}
}
@@ -0,0 +1,60 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { Position, ResponseError, TextDocumentPositionParams } from 'vscode-languageclient';
import { ManualSignal } from '../../Utility/Async/manualSignal';
import { DefaultClient, HoverRequest } from '../client';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CppSettings } from '../settings';
export class HoverProvider implements vscode.HoverProvider {
private client: DefaultClient;
constructor(client: DefaultClient) {
this.client = client;
}
public async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.Hover | undefined> {
const settings: CppSettings = new CppSettings(vscode.workspace.getWorkspaceFolder(document.uri)?.uri);
if (settings.hover === "disabled") {
return undefined;
}
const params: TextDocumentPositionParams = {
textDocument: { uri: document.uri.toString() },
position: Position.create(position.line, position.character)
};
await this.client.ready;
let hoverResult: vscode.Hover;
try {
hoverResult = await this.client.languageClient.sendRequest(HoverRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}
// VS Code doesn't like the raw objects returned via RPC, so we need to create proper VS Code objects here.
const strings: vscode.MarkdownString[] = [];
for (const element of hoverResult.contents) {
const oldMarkdownString: vscode.MarkdownString = element as vscode.MarkdownString;
const newMarkdownString: vscode.MarkdownString = new vscode.MarkdownString(oldMarkdownString.value, oldMarkdownString.supportThemeIcons);
newMarkdownString.isTrusted = oldMarkdownString.isTrusted;
newMarkdownString.supportHtml = oldMarkdownString.supportHtml;
newMarkdownString.baseUri = oldMarkdownString.baseUri;
strings.push(newMarkdownString);
}
let range: vscode.Range | undefined;
if (hoverResult.range) {
range = new vscode.Range(hoverResult.range.start.line, hoverResult.range.start.character,
hoverResult.range.end.line, hoverResult.range.end.character);
}
return new vscode.Hover(strings, range);
}
public showCopilotHover = new ManualSignal<string>(true);
}
@@ -4,9 +4,10 @@
* ------------------------------------------------------------------------------------------ */
import * as path from 'path';
import * as vscode from 'vscode';
import { Position, Range, RequestType, TextDocumentIdentifier } from 'vscode-languageclient';
import { Position, Range, RequestType, ResponseError, TextDocumentIdentifier } from 'vscode-languageclient';
import * as Telemetry from '../../telemetry';
import { DefaultClient, workspaceReferences } from '../client';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CancellationSender } from '../references';
import { makeVscodeRange } from '../utils';
@@ -127,8 +128,15 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
textDocument: { uri: document.uri.toString() },
position: Position.create(position.line, position.character)
};
const response: CallHierarchyItemResult = await this.client.languageClient.sendRequest(CallHierarchyItemRequest, params, cancelSource.token);
let response: CallHierarchyItemResult;
try {
response = await this.client.languageClient.sendRequest(CallHierarchyItemRequest, params, cancelSource.token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
return undefined;
}
throw e;
}
cancellationTokenListener.dispose();
requestCanceledListener.dispose();
@@ -176,8 +184,16 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
textDocument: { uri: item.uri.toString() },
position: Position.create(item.selectionRange.start.line, item.selectionRange.start.character)
};
const response: CallHierarchyCallsItemResult = await this.client.languageClient.sendRequest(CallHierarchyCallsToRequest, params, cancelSource.token);
let response: CallHierarchyCallsItemResult | undefined;
let cancelled: boolean = false;
try {
response = await this.client.languageClient.sendRequest(CallHierarchyCallsToRequest, params, cancelSource.token);
} catch (e: any) {
cancelled = e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled);
if (!cancelled) {
throw e;
}
}
// Reset anything that can be cleared before processing the result.
const progressBarDuration: number | undefined = workspaceReferences.getCallHierarchyProgressBarDuration();
workspaceReferences.resetProgressBar();
@@ -186,12 +202,12 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
requestCanceledListener.dispose();
// Process the result.
if (cancelSource.token.isCancellationRequested || response.calls === undefined || requestCanceled !== undefined) {
if (cancelSource.token.isCancellationRequested || cancelled || requestCanceled !== undefined) {
const requestStatus: CallHierarchyRequestStatus = requestCanceled === CancellationSender.User ?
CallHierarchyRequestStatus.CanceledByUser : CallHierarchyRequestStatus.Canceled;
this.logTelemetry(CallHierarchyCallsToEvent, requestStatus, progressBarDuration);
throw new vscode.CancellationError();
} else if (response.calls.length !== 0) {
} else if (response && response.calls.length !== 0) {
result = this.createIncomingCalls(response.calls);
}
@@ -214,12 +230,20 @@ export class CallHierarchyProvider implements vscode.CallHierarchyProvider {
textDocument: { uri: item.uri.toString() },
position: Position.create(item.selectionRange.start.line, item.selectionRange.start.character)
};
const response: CallHierarchyCallsItemResult = await this.client.languageClient.sendRequest(CallHierarchyCallsFromRequest, params, token);
if (token.isCancellationRequested || response.calls === undefined) {
let response: CallHierarchyCallsItemResult | undefined;
let cancelled: boolean = false;
try {
await this.client.languageClient.sendRequest(CallHierarchyCallsFromRequest, params, token);
} catch (e: any) {
cancelled = e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled);
if (!cancelled) {
throw e;
}
}
if (token.isCancellationRequested || cancelled) {
this.logTelemetry(CallHierarchyCallsFromEvent, CallHierarchyRequestStatus.Canceled);
throw new vscode.CancellationError();
} else if (response.calls.length !== 0) {
} else if (response && response.calls.length !== 0) {
result = this.createOutgoingCalls(response.calls);
}
@@ -3,13 +3,14 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { Position, Range, RequestType, TextEdit } from 'vscode-languageclient';
import { Position, Range, RequestType, ResponseError, TextEdit } from 'vscode-languageclient';
import * as nls from 'vscode-nls';
import { DefaultClient } from '../client';
import {
CodeActionCodeInfo, CodeActionDiagnosticInfo, codeAnalysisAllFixes, codeAnalysisCodeToFixes, codeAnalysisFileToCodeActions
} from '../codeAnalysis';
import { LocalizeStringParams, getLocalizedString } from '../localization';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CppSettings } from '../settings';
import { makeVscodeRange } from '../utils';
@@ -70,17 +71,24 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
uri: document.uri.toString()
};
let response: GetCodeActionsResult = await this.client.languageClient.sendRequest(
GetCodeActionsRequest, params, token);
let response: GetCodeActionsResult;
try {
response = await this.client.languageClient.sendRequest(GetCodeActionsRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
const resultCodeActions: vscode.CodeAction[] = [];
if (token.isCancellationRequested || response.commands === undefined) {
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}
const resultCodeActions: vscode.CodeAction[] = [];
let hasSelectIntelliSenseConfiguration: boolean = false;
const settings: CppSettings = new CppSettings(this.client.RootUri);
const hasConfigurationSet: boolean = settings.defaultCompilerPath !== undefined ||
const hasConfigurationSet: boolean = settings.defaultCompilerPath !== null ||
!!settings.defaultCompileCommands || !!settings.defaultConfigurationProvider ||
this.client.configuration.CurrentConfiguration?.compilerPath !== undefined ||
!!this.client.configuration.CurrentConfiguration?.compileCommands ||
@@ -254,8 +262,15 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
if (!hoverResult.value.includes(localize("expands.to", "Expands to:"))) {
return false;
}
response = await this.client.languageClient.sendRequest(GetCodeActionsRequest, params, token);
if (token.isCancellationRequested || response.commands === undefined) {
try {
response = await this.client.languageClient.sendRequest(GetCodeActionsRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
return false;
}
throw e;
}
if (token.isCancellationRequested) {
return false;
}
for (const command of response.commands) {
@@ -3,8 +3,11 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { ResponseError } from 'vscode-languageclient';
import { DefaultClient, FormatDocumentRequest, FormatParams, FormatResult } from '../client';
import { CppSettings, OtherSettings, getEditorConfigSettings } from '../settings';
import { getEditorConfigSettings } from '../editorConfig';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CppSettings, OtherSettings } from '../settings';
import { makeVscodeTextEdits } from '../utils';
export class DocumentFormattingEditProvider implements vscode.DocumentFormattingEditProvider {
@@ -66,12 +69,16 @@ export class DocumentFormattingEditProvider implements vscode.DocumentFormatting
},
onChanges: options.onChanges === true
};
// We do not currently pass the CancellationToken to sendRequest
// because there is not currently cancellation logic for formatting
// in the native process. Formatting is currently done directly in
// message handling thread.
const response: FormatResult = await this.client.languageClient.sendRequest(FormatDocumentRequest, params, token);
if (token.isCancellationRequested || response.edits === undefined) {
let response: FormatResult;
try {
response = await this.client.languageClient.sendRequest(FormatDocumentRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}
const results: vscode.TextEdit[] = makeVscodeTextEdits(response.edits);
@@ -3,8 +3,11 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { ResponseError } from 'vscode-languageclient';
import { DefaultClient, FormatParams, FormatRangeRequest, FormatResult } from '../client';
import { CppSettings, getEditorConfigSettings } from '../settings';
import { getEditorConfigSettings } from '../editorConfig';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CppSettings } from '../settings';
import { makeVscodeTextEdits } from '../utils';
export class DocumentRangeFormattingEditProvider implements vscode.DocumentRangeFormattingEditProvider {
@@ -42,12 +45,16 @@ export class DocumentRangeFormattingEditProvider implements vscode.DocumentRange
},
onChanges: false
};
// We do not currently pass the CancellationToken to sendRequest
// because there is not currently cancellation logic for formatting
// in the native process. Formatting is currently done directly in
// message handling thread.
const response: FormatResult = await this.client.languageClient.sendRequest(FormatRangeRequest, params, token);
if (token.isCancellationRequested || response.edits === undefined) {
let response: FormatResult;
try {
response = await this.client.languageClient.sendRequest(FormatRangeRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}
return makeVscodeTextEdits(response.edits);
@@ -3,9 +3,11 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { ResponseError } from 'vscode-languageclient';
import { Client, DefaultClient, GetDocumentSymbolRequest, GetDocumentSymbolRequestParams, GetDocumentSymbolResult, LocalizeDocumentSymbol, SymbolScope } from '../client';
import { clients } from '../extension';
import { getLocalizedString, getLocalizedSymbolScope } from '../localization';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { makeVscodeRange } from '../utils';
export class DocumentSymbolProvider implements vscode.DocumentSymbolProvider {
@@ -61,8 +63,16 @@ export class DocumentSymbolProvider implements vscode.DocumentSymbolProvider {
const params: GetDocumentSymbolRequestParams = {
uri: document.uri.toString()
};
const response: GetDocumentSymbolResult = await defaultClient.languageClient.sendRequest(GetDocumentSymbolRequest, params, token);
if (token.isCancellationRequested || response.symbols === undefined) {
let response: GetDocumentSymbolResult;
try {
response = await defaultClient.languageClient.sendRequest(GetDocumentSymbolRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}
const resultSymbols: vscode.DocumentSymbol[] = this.getChildrenSymbols(response.symbols);
@@ -3,8 +3,9 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { Position, RequestType } from 'vscode-languageclient';
import { Position, RequestType, ResponseError } from 'vscode-languageclient';
import { DefaultClient, workspaceReferences } from '../client';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CancellationSender, ReferenceInfo, ReferenceType, ReferencesParams, ReferencesResult } from '../references';
const FindAllReferencesRequest: RequestType<ReferencesParams, ReferencesResult, void> =
@@ -34,7 +35,16 @@ export class FindAllReferencesProvider implements vscode.ReferenceProvider {
position: Position.create(position.line, position.character),
textDocument: { uri: document.uri.toString() }
};
const response: ReferencesResult = await this.client.languageClient.sendRequest(FindAllReferencesRequest, params, cancelSource.token);
let response: ReferencesResult | undefined;
let cancelled: boolean = false;
try {
response = await this.client.languageClient.sendRequest(FindAllReferencesRequest, params, cancelSource.token);
} catch (e: any) {
cancelled = e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled);
if (!cancelled) {
throw e;
}
}
// Reset anything that can be cleared before processing the result.
workspaceReferences.resetProgressBar();
@@ -42,14 +52,14 @@ export class FindAllReferencesProvider implements vscode.ReferenceProvider {
requestCanceledListener.dispose();
// Process the result.
if (cancelSource.token.isCancellationRequested || response.referenceInfos === null || response.isCanceled) {
if (cancelSource.token.isCancellationRequested || cancelled || (response && response.isCanceled)) {
// Return undefined instead of vscode.CancellationError to avoid the following error message from VS Code:
// "Cannot destructure property 'range' of 'e.location' as it is undefined."
// TODO: per issue https://github.com/microsoft/vscode/issues/169698
// vscode.CancellationError is expected, so when VS Code fixes the error use vscode.CancellationError again.
workspaceReferences.resetReferences();
return undefined;
} else if (response.referenceInfos.length > 0) {
} else if (response && response.referenceInfos.length > 0) {
response.referenceInfos.forEach((referenceInfo: ReferenceInfo) => {
if (referenceInfo.type === ReferenceType.Confirmed) {
const uri: vscode.Uri = vscode.Uri.file(referenceInfo.file);
@@ -3,8 +3,10 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { ResponseError } from 'vscode-languageclient';
import { ManualPromise } from '../../Utility/Async/manualPromise';
import { CppFoldingRange, DefaultClient, FoldingRangeKind, GetFoldingRangesParams, GetFoldingRangesRequest, GetFoldingRangesResult } from '../client';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CppSettings } from '../settings';
interface FoldingRangeRequestInfo {
@@ -57,14 +59,21 @@ export class FoldingRangeProvider implements vscode.FoldingRangeProvider {
return promise;
}
private async requestRanges(uri: string, token: vscode.CancellationToken): Promise<vscode.FoldingRange[] | undefined>
{
private async requestRanges(uri: string, token: vscode.CancellationToken): Promise<vscode.FoldingRange[] | undefined> {
const params: GetFoldingRangesParams = {
uri
};
const response: GetFoldingRangesResult = await this.client.languageClient.sendRequest(GetFoldingRangesRequest, params, token);
if (token.isCancellationRequested || response.ranges === undefined) {
let response: GetFoldingRangesResult;
try {
response = await this.client.languageClient.sendRequest(GetFoldingRangesRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}
const result: vscode.FoldingRange[] = [];
@@ -6,8 +6,7 @@ import * as vscode from 'vscode';
import { ManualPromise } from '../../Utility/Async/manualPromise';
import { CppSettings } from '../settings';
interface FileData
{
interface FileData {
version: number;
promise: ManualPromise<vscode.InlayHint[]>;
typeHints: CppInlayHint[];
@@ -3,8 +3,11 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { ResponseError } from 'vscode-languageclient';
import { DefaultClient, FormatOnTypeRequest, FormatParams, FormatResult } from '../client';
import { CppSettings, getEditorConfigSettings } from '../settings';
import { getEditorConfigSettings } from '../editorConfig';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CppSettings } from '../settings';
import { makeVscodeTextEdits } from '../utils';
export class OnTypeFormattingEditProvider implements vscode.OnTypeFormattingEditProvider {
@@ -41,12 +44,16 @@ export class OnTypeFormattingEditProvider implements vscode.OnTypeFormattingEdit
},
onChanges: false
};
// We do not currently pass the CancellationToken to sendRequest
// because there is not currently cancellation logic for formatting
// in the native process. Formatting is currently done directly in
// message handling thread.
const response: FormatResult = await this.client.languageClient.sendRequest(FormatOnTypeRequest, params, token);
if (token.isCancellationRequested || response.edits === undefined) {
let response: FormatResult;
try {
response = await this.client.languageClient.sendRequest(FormatOnTypeRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
}
return makeVscodeTextEdits(response.edits);
@@ -3,10 +3,11 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { Position, RequestType } from 'vscode-languageclient';
import { Position, RequestType, ResponseError } from 'vscode-languageclient';
import * as nls from 'vscode-nls';
import * as util from '../../common';
import { DefaultClient, workspaceReferences } from '../client';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { CancellationSender, ReferenceType, ReferencesParams, ReferencesResult, getReferenceItemIconPath, getReferenceTagString } from '../references';
import { CppSettings } from '../settings';
@@ -47,7 +48,15 @@ export class RenameProvider implements vscode.RenameProvider {
position: Position.create(position.line, position.character),
textDocument: { uri: document.uri.toString() }
};
const response: ReferencesResult = await this.client.languageClient.sendRequest(RenameRequest, params, cancelSource.token);
let response: ReferencesResult;
try {
response = await this.client.languageClient.sendRequest(RenameRequest, params, cancelSource.token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
// Reset anything that can be cleared before processing the result.
workspaceReferences.resetProgressBar();
@@ -55,7 +64,7 @@ export class RenameProvider implements vscode.RenameProvider {
requestCanceledListener.dispose();
// Process the result.
if (cancelSource.token.isCancellationRequested || response.referenceInfos === null || response.isCanceled) {
if (cancelSource.token.isCancellationRequested || response.isCanceled) {
throw new vscode.CancellationError();
} else if (response.referenceInfos.length === 0) {
void vscode.window.showErrorMessage(localize("unable.to.locate.selected.symbol", "A definition for the selected symbol could not be located."));
@@ -3,9 +3,11 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import { ResponseError } from 'vscode-languageclient';
import { isExperimentEnabled } from '../../telemetry';
import { DefaultClient, GetSymbolInfoRequest, LocalizeSymbolInformation, SymbolScope, WorkspaceSymbolParams } from '../client';
import { getLocalizedString, getLocalizedSymbolScope } from '../localization';
import { RequestCancelled, ServerCancelled } from '../protocolFilter';
import { makeVscodeLocation } from '../utils';
export class WorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
@@ -25,7 +27,15 @@ export class WorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
experimentEnabled: await isExperimentEnabled('CppTools1')
};
const symbols: LocalizeSymbolInformation[] = await this.client.languageClient.sendRequest(GetSymbolInfoRequest, params, token);
let symbols: LocalizeSymbolInformation[];
try {
symbols = await this.client.languageClient.sendRequest(GetSymbolInfoRequest, params, token);
} catch (e: any) {
if (e instanceof ResponseError && (e.code === RequestCancelled || e.code === ServerCancelled)) {
throw new vscode.CancellationError();
}
throw e;
}
const resultSymbols: vscode.SymbolInformation[] = [];
if (token.isCancellationRequested) {
throw new vscode.CancellationError();
+98 -27
View File
@@ -27,7 +27,7 @@ import * as fs from 'fs';
import * as os from 'os';
import { SourceFileConfiguration, SourceFileConfigurationItem, Version, WorkspaceBrowseConfiguration } from 'vscode-cpptools';
import { IntelliSenseStatus, Status } from 'vscode-cpptools/out/testApi';
import { CloseAction, DidOpenTextDocumentParams, ErrorAction, LanguageClientOptions, NotificationType, Position, Range, RequestType, TextDocumentIdentifier } from 'vscode-languageclient';
import { CloseAction, DidOpenTextDocumentParams, ErrorAction, LanguageClientOptions, NotificationType, Position, Range, RequestType, TextDocumentIdentifier, TextDocumentPositionParams } from 'vscode-languageclient';
import { LanguageClient, ServerOptions } from 'vscode-languageclient/node';
import * as nls from 'vscode-nls';
import { DebugConfigurationProvider } from '../Debugger/configurationProvider';
@@ -43,6 +43,8 @@ import { localizedStringCount, lookupString } from '../nativeStrings';
import { SessionState } from '../sessionState';
import * as telemetry from '../telemetry';
import { TestHook, getTestHook } from '../testHook';
import { CopilotHoverProvider } from './Providers/CopilotHoverProvider';
import { HoverProvider } from './Providers/HoverProvider';
import {
CodeAnalysisDiagnosticIdentifiersAndUri,
RegisterCodeAnalysisNotifications,
@@ -53,12 +55,13 @@ import {
import { Location, TextEdit, WorkspaceEdit } from './commonTypes';
import * as configs from './configurations';
import { DataBinding } from './dataBinding';
import { cachedEditorConfigSettings, getEditorConfigSettings } from './editorConfig';
import { CppSourceStr, clients, configPrefix, updateLanguageConfigurations, usesCrashHandler, watchForCrashes } from './extension';
import { LocalizeStringParams, getLocaleId, getLocalizedString } from './localization';
import { PersistentFolderState, PersistentWorkspaceState } from './persistentState';
import { createProtocolFilter } from './protocolFilter';
import * as refs from './references';
import { CppSettings, OtherSettings, SettingsParams, WorkspaceFolderSettingsParams, getEditorConfigSettings } from './settings';
import { CppSettings, OtherSettings, SettingsParams, WorkspaceFolderSettingsParams } from './settings';
import { SettingsTracker } from './settingsTracker';
import { ConfigurationType, LanguageStatusUI, getUI } from './ui';
import { handleChangedFromCppToC, makeLspRange, makeVscodeLocation, makeVscodeRange } from './utils';
@@ -102,7 +105,6 @@ let workspaceHash: string = "";
let workspaceDisposables: vscode.Disposable[] = [];
export let workspaceReferences: refs.ReferencesManager;
export const openFileVersions: Map<string, number> = new Map<string, number>();
export const cachedEditorConfigSettings: Map<string, any> = new Map<string, any>();
export const cachedEditorConfigLookups: Map<string, boolean> = new Map<string, boolean>();
export let semanticTokensLegend: vscode.SemanticTokensLegend | undefined;
@@ -533,16 +535,29 @@ interface DidChangeActiveEditorParams {
selection?: Range;
}
interface GetIncludesParams
{
interface GetIncludesParams {
maxDepth: number;
}
interface GetIncludesResult
{
interface GetIncludesResult {
includedFiles: string[];
}
interface ShowCopilotHoverParams
{
content: string;
}
interface ShowCopilotHoverResult
{
hoverPos: Position;
}
interface GetCopilotHoverInfoResult
{
content: string;
}
// Requests
const PreInitializationRequest: RequestType<void, string, void> = new RequestType<void, string, void>('cpptools/preinitialize');
const InitializationRequest: RequestType<CppInitializationParams, void, void> = new RequestType<CppInitializationParams, void, void>('cpptools/initialize');
@@ -556,12 +571,15 @@ export const GetFoldingRangesRequest: RequestType<GetFoldingRangesParams, GetFol
export const FormatDocumentRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatDocument');
export const FormatRangeRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatRange');
export const FormatOnTypeRequest: RequestType<FormatParams, FormatResult, void> = new RequestType<FormatParams, FormatResult, void>('cpptools/formatOnType');
export const HoverRequest: RequestType<TextDocumentPositionParams, vscode.Hover, void> = new RequestType<TextDocumentPositionParams, vscode.Hover, void>('cpptools/hover');
const CreateDeclarationOrDefinitionRequest: RequestType<CreateDeclarationOrDefinitionParams, CreateDeclarationOrDefinitionResult, void> = new RequestType<CreateDeclarationOrDefinitionParams, CreateDeclarationOrDefinitionResult, void>('cpptools/createDeclDef');
const ExtractToFunctionRequest: RequestType<ExtractToFunctionParams, WorkspaceEditResult, void> = new RequestType<ExtractToFunctionParams, WorkspaceEditResult, void>('cpptools/extractToFunction');
const GoToDirectiveInGroupRequest: RequestType<GoToDirectiveInGroupParams, Position | undefined, void> = new RequestType<GoToDirectiveInGroupParams, Position | undefined, void>('cpptools/goToDirectiveInGroup');
const GenerateDoxygenCommentRequest: RequestType<GenerateDoxygenCommentParams, GenerateDoxygenCommentResult | undefined, void> = new RequestType<GenerateDoxygenCommentParams, GenerateDoxygenCommentResult, void>('cpptools/generateDoxygenComment');
const ChangeCppPropertiesRequest: RequestType<CppPropertiesParams, void, void> = new RequestType<CppPropertiesParams, void, void>('cpptools/didChangeCppProperties');
const IncludesRequest: RequestType<GetIncludesParams, GetIncludesResult, void> = new RequestType<GetIncludesParams, GetIncludesResult, void>('cpptools/getIncludes');
const GetCopilotHoverInfoRequest: RequestType<void, GetCopilotHoverInfoResult, void> = new RequestType<void, GetCopilotHoverInfoResult, void>('cpptools/getCopilotHoverInfo');
const ShowCopilotHoverRequest: RequestType<ShowCopilotHoverParams, ShowCopilotHoverResult, void> = new RequestType<ShowCopilotHoverParams, ShowCopilotHoverResult, void>('cpptools/showCopilotHover');
// Notifications to the server
const DidOpenNotification: NotificationType<DidOpenTextDocumentParams> = new NotificationType<DidOpenTextDocumentParams>('textDocument/didOpen');
@@ -792,6 +810,9 @@ export interface Client {
setShowConfigureIntelliSenseButton(show: boolean): void;
addTrustedCompiler(path: string): Promise<void>;
getIncludes(maxDepth: number): Promise<GetIncludesResult>;
showCopilotHover_old(content: string): Promise<ShowCopilotHoverResult>;
showCopilotHover(content: string): Promise<void>;
getCopilotHoverInfo(): Promise<GetCopilotHoverInfoResult>;
}
export function createClient(workspaceFolder?: vscode.WorkspaceFolder): Client {
@@ -813,6 +834,7 @@ export class DefaultClient implements Client {
private inlayHintsProvider: InlayHintsProvider | undefined;
private semanticTokensProvider: SemanticTokensProvider | undefined;
private semanticTokensProviderDisposable: vscode.Disposable | undefined;
private hoverProvider: HoverProvider | undefined;
private innerConfiguration?: configs.CppProperties;
private rootPathFileWatcher?: vscode.FileSystemWatcher;
private rootFolder?: vscode.WorkspaceFolder;
@@ -1256,7 +1278,10 @@ export class DefaultClient implements Client {
this.registerFileWatcher();
initializedClientCount = 0;
this.inlayHintsProvider = new InlayHintsProvider();
this.hoverProvider = new HoverProvider(this);
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, this.hoverProvider));
this.disposables.push(vscode.languages.registerHoverProvider(util.documentSelector, new CopilotHoverProvider(this.hoverProvider)));
this.disposables.push(vscode.languages.registerInlayHintsProvider(util.documentSelector, this.inlayHintsProvider));
this.disposables.push(vscode.languages.registerRenameProvider(util.documentSelector, new RenameProvider(this)));
this.disposables.push(vscode.languages.registerReferenceProvider(util.documentSelector, new FindAllReferencesProvider(this)));
@@ -1275,7 +1300,7 @@ export class DefaultClient implements Client {
this.codeFoldingProviderDisposable = vscode.languages.registerFoldingRangeProvider(util.documentSelector, this.codeFoldingProvider);
const settings: CppSettings = new CppSettings();
if (settings.enhancedColorization && semanticTokensLegend) {
if (settings.isEnhancedColorizationEnabled && semanticTokensLegend) {
this.semanticTokensProvider = new SemanticTokensProvider();
this.semanticTokensProviderDisposable = vscode.languages.registerDocumentSemanticTokensProvider(util.documentSelector, this.semanticTokensProvider, semanticTokensLegend);
}
@@ -1325,7 +1350,6 @@ export class DefaultClient implements Client {
const result: WorkspaceFolderSettingsParams = {
uri: workspaceFolderUri?.toString(),
intelliSenseEngine: settings.intelliSenseEngine,
intelliSenseEngineFallback: settings.intelliSenseEngineFallback,
autocomplete: settings.autocomplete,
autocompleteAddParentheses: settings.autocompleteAddParentheses,
errorSquiggles: settings.errorSquiggles,
@@ -1352,9 +1376,6 @@ export class DefaultClient implements Client {
clangTidyHeaderFilter: settings.clangTidyHeaderFilter !== null ? util.resolveVariables(settings.clangTidyHeaderFilter, this.AdditionalEnvironment) : null,
clangTidyArgs: util.resolveVariablesArray(settings.clangTidyArgs, this.AdditionalEnvironment),
clangTidyUseBuildPath: settings.clangTidyUseBuildPath,
clangTidyFixWarnings: settings.clangTidyFixWarnings,
clangTidyFixErrors: settings.clangTidyFixErrors,
clangTidyFixNotes: settings.clangTidyFixNotes,
clangTidyChecksEnabled: settings.clangTidyChecksEnabled,
clangTidyChecksDisabled: settings.clangTidyChecksDisabled,
markdownInComments: settings.markdownInComments,
@@ -1446,7 +1467,7 @@ export class DefaultClient implements Client {
return workspaceFolderSettingsParams;
}
private getAllSettings(): SettingsParams {
private async getAllSettings(): Promise<SettingsParams> {
const workspaceSettings: CppSettings = new CppSettings();
const workspaceOtherSettings: OtherSettings = new OtherSettings();
const workspaceFolderSettingsParams: WorkspaceFolderSettingsParams[] = this.getAllWorkspaceFolderSettings();
@@ -1463,7 +1484,7 @@ export class DefaultClient implements Client {
simplifyStructuredComments: workspaceSettings.simplifyStructuredComments,
intelliSenseUpdateDelay: workspaceSettings.intelliSenseUpdateDelay,
experimentalFeatures: workspaceSettings.experimentalFeatures,
enhancedColorization: workspaceSettings.enhancedColorization,
enhancedColorization: workspaceSettings.isEnhancedColorizationEnabled,
intellisenseMaxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses,
intellisenseMaxMemory: workspaceSettings.intelliSenseMaxMemory,
referencesMaxConcurrentThreads: workspaceSettings.referencesMaxConcurrentThreads,
@@ -1472,6 +1493,7 @@ export class DefaultClient implements Client {
codeAnalysisMaxConcurrentThreads: workspaceSettings.codeAnalysisMaxConcurrentThreads,
codeAnalysisMaxMemory: workspaceSettings.codeAnalysisMaxMemory,
codeAnalysisUpdateDelay: workspaceSettings.codeAnalysisUpdateDelay,
copilotHover: await workspaceSettings.copilotHover,
workspaceFolderSettings: workspaceFolderSettingsParams
};
}
@@ -1520,9 +1542,9 @@ export class DefaultClient implements Client {
}
const workspaceSettings: CppSettings = new CppSettings();
if (workspaceSettings.caseSensitiveFileSupport !== currentCaseSensitiveFileSupport.Value) {
if (workspaceSettings.isCaseSensitiveFileSupportEnabled !== currentCaseSensitiveFileSupport.Value) {
resetDatabase = true;
currentCaseSensitiveFileSupport.Value = workspaceSettings.caseSensitiveFileSupport;
currentCaseSensitiveFileSupport.Value = workspaceSettings.isCaseSensitiveFileSupportEnabled;
}
const cacheStoragePath: string = util.getCacheStoragePath();
@@ -1537,11 +1559,11 @@ export class DefaultClient implements Client {
cacheStoragePath: cacheStoragePath,
vcpkgRoot: util.getVcpkgRoot(),
intelliSenseCacheDisabled: intelliSenseCacheDisabled,
caseSensitiveFileSupport: workspaceSettings.caseSensitiveFileSupport,
caseSensitiveFileSupport: workspaceSettings.isCaseSensitiveFileSupportEnabled,
resetDatabase: resetDatabase,
edgeMessagesDirectory: path.join(util.getExtensionFilePath("bin"), "messages", getLocaleId()),
localizedStrings: localizedStrings,
settings: this.getAllSettings()
settings: await this.getAllSettings()
};
this.loggingLevel = util.getNumericLoggingLevel(cppInitializationParams.settings.loggingLevel);
@@ -1582,6 +1604,9 @@ export class DefaultClient implements Client {
// We manually restart the language server so tell the LanguageClient not to do it automatically for us.
return { action: CloseAction.DoNotRestart, message };
}
},
markdown: {
isTrusted: true
}
// TODO: should I set the output channel? Does this sort output between servers?
@@ -1607,7 +1632,7 @@ export class DefaultClient implements Client {
public async sendDidChangeSettings(): Promise<void> {
// Send settings json to native side
await this.ready;
await this.languageClient.sendNotification(DidChangeSettingsNotification, this.getAllSettings());
await this.languageClient.sendNotification(DidChangeSettingsNotification, await this.getAllSettings());
}
public async onDidChangeSettings(_event: vscode.ConfigurationChangeEvent): Promise<Record<string, string>> {
@@ -1635,7 +1660,7 @@ export class DefaultClient implements Client {
}
const settings: CppSettings = new CppSettings();
if (changedSettings.enhancedColorization) {
if (settings.enhancedColorization && semanticTokensLegend) {
if (settings.isEnhancedColorizationEnabled && semanticTokensLegend) {
this.semanticTokensProvider = new SemanticTokensProvider();
this.semanticTokensProviderDisposable = vscode.languages.registerDocumentSemanticTokensProvider(util.documentSelector, this.semanticTokensProvider, semanticTokensLegend);
} else if (this.semanticTokensProviderDisposable) {
@@ -1950,6 +1975,34 @@ export class DefaultClient implements Client {
if (this.configuration.CurrentConfiguration) {
configJson = `Current Configuration:\n${JSON.stringify(this.configuration.CurrentConfiguration, null, 4)}\n`;
}
const userModifiedSettings = Object.entries(this.settingsTracker.getUserModifiedSettings());
if (userModifiedSettings.length > 0) {
const settings: Record<string, any> = {};
for (const [key] of userModifiedSettings) {
// Some settings were renamed during a telemetry change, so we need to undo that here.
const realKey = key.endsWith('2') ? key.slice(0, key.length - 1) : key;
const fullKey = `C_Cpp.${realKey}`;
settings[fullKey] = vscode.workspace.getConfiguration("C_Cpp").get(realKey) ?? '<error-retrieving-value>';
}
configJson += `Modified Settings:\n${JSON.stringify(settings, null, 4)}\n`;
}
{
const editorSettings = new OtherSettings(this.RootUri);
const settings: Record<string, any> = {};
settings.editorTabSize = editorSettings.editorTabSize;
settings.editorInsertSpaces = editorSettings.editorInsertSpaces;
settings.editorAutoClosingBrackets = editorSettings.editorAutoClosingBrackets;
settings.filesEncoding = editorSettings.filesEncoding;
settings.filesAssociations = editorSettings.filesAssociations;
settings.filesExclude = editorSettings.filesExclude;
settings.filesAutoSaveAfterDelay = editorSettings.filesAutoSaveAfterDelay;
settings.editorInlayHintsEnabled = editorSettings.editorInlayHintsEnabled;
settings.editorParameterHintsEnabled = editorSettings.editorParameterHintsEnabled;
settings.searchExclude = editorSettings.searchExclude;
settings.workbenchSettingsEditor = editorSettings.workbenchSettingsEditor;
configJson += `Additional Tracked Settings:\n${JSON.stringify(settings, null, 4)}\n`;
}
// Get diagnostics for configuration provider info.
let configurationLoggingStr: string = "";
@@ -2101,7 +2154,7 @@ export class DefaultClient implements Client {
result = "timeout";
if (!requestFile) {
const settings: CppSettings = new CppSettings(this.RootUri);
if (settings.configurationWarnings && !this.isExternalHeader(docUri) && !vscode.debug.activeDebugSession) {
if (settings.isConfigurationWarningsEnabled && !this.isExternalHeader(docUri) && !vscode.debug.activeDebugSession) {
const dismiss: string = localize("dismiss.button", "Dismiss");
const disable: string = localize("disable.warnings.button", "Disable Warnings");
const configName: string | undefined = this.configuration.CurrentConfiguration?.name;
@@ -2171,7 +2224,7 @@ export class DefaultClient implements Client {
public getVcpkgEnabled(): Promise<boolean> {
const cppSettings: CppSettings = new CppSettings(this.RootUri);
return Promise.resolve(!!cppSettings.vcpkgEnabled);
return Promise.resolve(cppSettings.vcpkgEnabled);
}
public async getKnownCompilers(): Promise<configs.KnownCompiler[] | undefined> {
@@ -2731,7 +2784,7 @@ export class DefaultClient implements Client {
showConfigStatus = ask.Value;
}
const compilerPathNotSet: boolean = settings.defaultCompilerPath === undefined && this.configuration.CurrentConfiguration?.compilerPath === undefined && this.configuration.CurrentConfiguration?.compilerPathInCppPropertiesJson === undefined;
const compilerPathNotSet: boolean = settings.defaultCompilerPath === null && this.configuration.CurrentConfiguration?.compilerPath === undefined && this.configuration.CurrentConfiguration?.compilerPathInCppPropertiesJson === undefined;
const configurationNotSet: boolean = configProviderNotSetAndNoCache && compileCommandsNotSet && compilerPathNotSet;
showConfigStatus = showConfigStatus || (configurationNotSet &&
@@ -3057,7 +3110,7 @@ export class DefaultClient implements Client {
providerVersion < Version.v6,
itemConfig.compilerPath,
util.isArrayOfString(itemConfig.compilerArgs) ? itemConfig.compilerArgs : undefined);
itemConfig.compilerPath = compilerPathAndArgs.compilerPath;
itemConfig.compilerPath = compilerPathAndArgs.compilerPath ?? undefined;
if (itemConfig.compilerPath !== undefined) {
void this.addTrustedCompiler(itemConfig.compilerPath).catch(logAndReturn.undefined);
}
@@ -3161,7 +3214,7 @@ export class DefaultClient implements Client {
providerVersion < Version.v6,
sanitized.compilerPath,
util.isArrayOfString(sanitized.compilerArgs) ? sanitized.compilerArgs : undefined);
sanitized.compilerPath = compilerPathAndArgs.compilerPath;
sanitized.compilerPath = compilerPathAndArgs.compilerPath ?? undefined;
if (sanitized.compilerPath !== undefined) {
void this.addTrustedCompiler(sanitized.compilerPath).catch(logAndReturn.undefined);
}
@@ -3476,8 +3529,7 @@ export class DefaultClient implements Client {
}
let formatParams: FormatParams | undefined;
if (cppSettings.useVcFormat(editor.document))
{
if (cppSettings.useVcFormat(editor.document)) {
const editorConfigSettings: any = getEditorConfigSettings(uri.fsPath);
formatParams = {
editorConfigSettings: editorConfigSettings,
@@ -3978,6 +4030,22 @@ export class DefaultClient implements Client {
compilerDefaults = await this.requestCompiler(path);
DebugConfigurationProvider.ClearDetectedBuildTasks();
}
public async showCopilotHover_old(content: string): Promise<ShowCopilotHoverResult> {
const params: ShowCopilotHoverParams = {content: content};
await this.ready;
return this.languageClient.sendRequest(ShowCopilotHoverRequest, params);
}
public async showCopilotHover(content: string): Promise<void> {
this.hoverProvider?.showCopilotHover.resolve(content);
this.hoverProvider?.showCopilotHover.reset();
}
public async getCopilotHoverInfo(): Promise<GetCopilotHoverInfoResult> {
await this.ready;
return this.languageClient.sendRequest(GetCopilotHoverInfoRequest, null);
}
}
function getLanguageServerFileName(): string {
@@ -4090,4 +4158,7 @@ class NullClient implements Client {
setShowConfigureIntelliSenseButton(show: boolean): void { }
addTrustedCompiler(path: string): Promise<void> { return Promise.resolve(); }
getIncludes(): Promise<GetIncludesResult> { return Promise.resolve({} as GetIncludesResult); }
showCopilotHover_old(content: string): Promise<ShowCopilotHoverResult> { return Promise.resolve({} as ShowCopilotHoverResult); }
showCopilotHover(content: string): Promise<void> { return Promise.resolve(); }
getCopilotHoverInfo(): Promise<GetCopilotHoverInfoResult> { return Promise.resolve({} as GetCopilotHoverInfoResult); }
}
+20 -20
View File
@@ -62,8 +62,8 @@ export interface ConfigurationJson {
export interface Configuration {
name: string;
compilerPathInCppPropertiesJson?: string;
compilerPath?: string;
compilerPathInCppPropertiesJson?: string | null;
compilerPath?: string | null;
compilerPathIsExplicit?: boolean;
compilerArgs?: string[];
compilerArgsLegacy?: string[];
@@ -951,7 +951,7 @@ export class CppProperties {
// compile_commands.json already specifies a compiler. compilerPath overrides the compile_commands.json compiler so
// don't set a default when compileCommands is in use.
configuration.compilerPath = this.updateConfigurationString(configuration.compilerPath, settings.defaultCompilerPath, env, true);
configuration.compilerPathIsExplicit = configuration.compilerPathIsExplicit || settings.defaultCompilerPath !== undefined;
configuration.compilerPathIsExplicit = configuration.compilerPathIsExplicit || settings.defaultCompilerPath !== null;
if (configuration.compilerPath === undefined) {
if (!!this.defaultCompilerPath && this.trustedCompilerFound) {
// If no config value yet set for these, pick up values from the defaults, but don't consider them explicit.
@@ -991,7 +991,6 @@ export class CppProperties {
configuration.compilerPath = settings.defaultCompilerPath;
}
if (configuration.compilerPath === null) {
configuration.compilerPath = undefined;
configuration.compilerPathIsExplicit = true;
} else if (configuration.compilerPath !== undefined) {
configuration.compilerPath = util.resolveVariables(configuration.compilerPath, env);
@@ -1041,8 +1040,8 @@ export class CppProperties {
&& !settings.defaultForcedInclude
&& !settings.defaultCompileCommands
&& !settings.defaultCompilerArgs
&& settings.defaultCStandard === ""
&& settings.defaultCppStandard === ""
&& !settings.defaultCStandard
&& !settings.defaultCppStandard
&& settings.defaultIntelliSenseMode === ""
&& !settings.defaultConfigurationProvider;
@@ -1516,7 +1515,7 @@ export class CppProperties {
return success;
}
private resolvePath(input_path: string | undefined, replaceAsterisks: boolean = true, assumeRelative: boolean = true): string {
private resolvePath(input_path: string | undefined | null, replaceAsterisks: boolean = true, assumeRelative: boolean = true): string {
if (!input_path || input_path === "${default}") {
return "";
}
@@ -1567,10 +1566,10 @@ export class CppProperties {
// Check if config name is unique.
errors.name = this.isConfigNameUnique(config.name);
let resolvedCompilerPath: string | undefined;
let resolvedCompilerPath: string | undefined | null;
// Validate compilerPath
if (config.compilerPath) {
resolvedCompilerPath = which.sync(config.compilerPath, { nothrow: true }) ?? undefined;
resolvedCompilerPath = which.sync(config.compilerPath, { nothrow: true });
}
if (resolvedCompilerPath === undefined) {
@@ -1590,6 +1589,7 @@ export class CppProperties {
(compilerPathAndArgs.compilerArgsFromCommandLineInPath && compilerPathAndArgs.compilerArgsFromCommandLineInPath.length > 0) &&
!resolvedCompilerPath.startsWith('"') &&
compilerPathAndArgs.compilerPath !== undefined &&
compilerPathAndArgs.compilerPath !== null &&
compilerPathAndArgs.compilerPath.includes(" ");
const compilerPathErrors: string[] = [];
@@ -1598,7 +1598,7 @@ export class CppProperties {
}
// Get compiler path without arguments before checking if it exists
resolvedCompilerPath = compilerPathAndArgs.compilerPath;
resolvedCompilerPath = compilerPathAndArgs.compilerPath ?? undefined;
if (resolvedCompilerPath) {
let pathExists: boolean = true;
const existsWithExeAdded: (path: string) => boolean = (path: string) => isWindows && !path.startsWith("/") && fs.existsSync(path + ".exe");
@@ -1640,15 +1640,15 @@ export class CppProperties {
}
// Validate paths (directories)
errors.includePath = this.validatePath(config.includePath, {globPaths: true});
errors.includePath = this.validatePath(config.includePath, { globPaths: true });
errors.macFrameworkPath = this.validatePath(config.macFrameworkPath);
errors.browsePath = this.validatePath(config.browse ? config.browse.path : undefined);
// Validate files
errors.forcedInclude = this.validatePath(config.forcedInclude, {isDirectory: false, assumeRelative: false});
errors.compileCommands = this.validatePath(config.compileCommands, {isDirectory: false});
errors.dotConfig = this.validatePath(config.dotConfig, {isDirectory: false});
errors.databaseFilename = this.validatePath(config.browse ? config.browse.databaseFilename : undefined, {isDirectory: false});
errors.forcedInclude = this.validatePath(config.forcedInclude, { isDirectory: false, assumeRelative: false });
errors.compileCommands = this.validatePath(config.compileCommands, { isDirectory: false });
errors.dotConfig = this.validatePath(config.dotConfig, { isDirectory: false });
errors.databaseFilename = this.validatePath(config.browse ? config.browse.databaseFilename : undefined, { isDirectory: false });
// Validate intelliSenseMode
if (isWindows) {
@@ -1661,7 +1661,7 @@ export class CppProperties {
return errors;
}
private validatePath(input: string | string[] | undefined, {isDirectory = true, assumeRelative = true, globPaths = false} = {}): string | undefined {
private validatePath(input: string | string[] | undefined, { isDirectory = true, assumeRelative = true, globPaths = false } = {}): string | undefined {
if (!input) {
return undefined;
}
@@ -1877,8 +1877,8 @@ export class CppProperties {
// Check for path-related squiggles.
const paths: string[] = [];
let compilerPath: string | undefined;
for (const pathArray of [ currentConfiguration.browse ? currentConfiguration.browse.path : undefined,
currentConfiguration.includePath, currentConfiguration.macFrameworkPath ]) {
for (const pathArray of [currentConfiguration.browse ? currentConfiguration.browse.path : undefined,
currentConfiguration.includePath, currentConfiguration.macFrameworkPath]) {
if (pathArray) {
for (const curPath of pathArray) {
paths.push(`${curPath}`);
@@ -2075,7 +2075,7 @@ export class CppProperties {
let message: string = "";
if (!pathExists) {
if (curOffset >= forcedIncludeStart && curOffset <= forcedeIncludeEnd
&& !path.isAbsolute(expandedPaths[0])) {
&& !path.isAbsolute(expandedPaths[0])) {
continue; // Skip the error, because it could be resolved recursively.
}
let badPath = "";
@@ -2089,7 +2089,7 @@ export class CppProperties {
} else {
// Check for file versus path mismatches.
if ((curOffset >= forcedIncludeStart && curOffset <= forcedeIncludeEnd) ||
(curOffset >= compileCommandsStart && curOffset <= compileCommandsEnd)) {
(curOffset >= compileCommandsStart && curOffset <= compileCommandsEnd)) {
if (expandedPaths.length > 1) {
message = localize("multiple.paths.not.allowed", "Multiple paths are not allowed.");
newSquiggleMetrics.MultiplePathsNotAllowed++;
@@ -98,7 +98,7 @@ export class CppBuildTaskProvider implements TaskProvider {
// Get user compiler path.
const userCompilerPathAndArgs: util.CompilerPathAndArgs | undefined = await activeClient.getCurrentCompilerPathAndArgs();
let userCompilerPath: string | undefined;
let userCompilerPath: string | undefined | null;
if (userCompilerPathAndArgs) {
userCompilerPath = userCompilerPathAndArgs.compilerPath;
if (userCompilerPath && userCompilerPathAndArgs.compilerName) {
@@ -414,7 +414,7 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
}
});
if (this.options === undefined) {
this.options = { };
this.options = {};
}
if (this.options.cwd) {
this.options.cwd = util.resolveVariables(this.options.cwd.toString());
@@ -0,0 +1,168 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as fs from 'fs';
import * as path from 'path';
export const cachedEditorConfigSettings: Map<string, any> = new Map<string, any>();
export function mapIndentationReferenceToEditorConfig(value: string | undefined): string {
if (value !== undefined) {
// Will never actually be undefined, as these settings have default values.
if (value === "statementBegin") {
return "statement_begin";
}
if (value === "outermostParenthesis") {
return "outermost_parenthesis";
}
}
return "innermost_parenthesis";
}
export function mapIndentToEditorConfig(value: string | undefined): string {
if (value !== undefined) {
// Will never actually be undefined, as these settings have default values.
if (value === "leftmostColumn") {
return "leftmost_column";
}
if (value === "oneLeft") {
return "one_left";
}
}
return "none";
}
export function mapNewOrSameLineToEditorConfig(value: string | undefined): string {
if (value !== undefined) {
// Will never actually be undefined, as these settings have default values.
if (value === "newLine") {
return "new_line";
}
if (value === "sameLine") {
return "same_line";
}
}
return "ignore";
}
export function mapWrapToEditorConfig(value: string | undefined): string {
if (value !== undefined) {
// Will never actually be undefined, as these settings have default values.
if (value === "allOneLineScopes") {
return "all_one_line_scopes";
}
if (value === "oneLiners") {
return "one_liners";
}
}
return "never";
}
function matchesSection(filePath: string, section: string): boolean {
const fileName: string = path.basename(filePath);
// Escape all regex special characters except '*' and '?'.
// Convert wildcards '*' to '.*' and '?' to '.'.
const sectionPattern = section.replace(/[.+^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*').replace(/\?/g, '.');
const regex: RegExp = new RegExp(`^${sectionPattern}$`);
return regex.test(fileName);
}
function parseEditorConfigContent(content: string): Record<string, any> {
const lines = content.split(/\r?\n/);
const config: Record<string, any> = {};
let currentSection: string | null = '*'; // Use '*' for sectionless (global) settings.
lines.forEach(line => {
line = line.trim();
if (!line || line.startsWith('#') || line.startsWith(';')) {
// Skip empty lines and comments.
return;
}
if (line.startsWith('[') && line.endsWith(']')) {
// New section (e.g., [*.js])
currentSection = line.slice(1, -1).trim();
config[currentSection] = config[currentSection] || {};
} else {
// Key-value pair (e.g., indent_style = space).
const [key, ...values] = line.split('=');
if (key && values.length > 0) {
const trimmedKey = key.trim();
const value = values.join('=').trim();
if (currentSection) {
// Ensure the current section is initialized.
if (!config[currentSection]) {
config[currentSection] = {};
}
config[currentSection][trimmedKey] = value;
}
}
}
});
return config;
}
function getEditorConfig(filePath: string): any {
let combinedConfig: any = {};
let globalConfig: any = {};
let currentDir: string = path.dirname(filePath);
const rootDir: string = path.parse(currentDir).root;
// Traverse from the file's directory to the root directory.
for (;;) {
const editorConfigPath: string = path.join(currentDir, '.editorconfig');
if (fs.existsSync(editorConfigPath)) {
const configFileContent: string = fs.readFileSync(editorConfigPath, 'utf-8');
const configData = parseEditorConfigContent(configFileContent);
// Extract global (sectionless) entries.
if (configData['*']) {
globalConfig = {
...globalConfig,
...configData['*']
};
}
// Match sections and combine configurations.
Object.keys(configData).forEach((section: string) => {
if (section !== '*' && matchesSection(filePath, section)) {
combinedConfig = {
...combinedConfig,
...configData[section]
};
}
});
// Check if the current .editorconfig is the root.
if (configData['*']?.root?.toLowerCase() === 'true') {
break; // Stop searching after processing the root = true file.
}
}
if (currentDir === rootDir) {
break; // Stop the loop after checking the root directory.
}
currentDir = path.dirname(currentDir);
}
// Merge global config with section-based config.
return {
...globalConfig,
...combinedConfig
};
}
// Look up the appropriate .editorconfig settings for the specified file.
// This is intentionally not async to avoid races due to multiple entrancy.
export function getEditorConfigSettings(fsPath: string): Promise<any> {
let editorConfigSettings: any = cachedEditorConfigSettings.get(fsPath);
if (!editorConfigSettings) {
editorConfigSettings = getEditorConfig(fsPath);
cachedEditorConfigSettings.set(fsPath, editorConfigSettings);
}
return editorConfigSettings;
}
+89 -8
View File
@@ -17,6 +17,7 @@ import { TargetPopulation } from 'vscode-tas-client';
import * as which from 'which';
import { logAndReturn } from '../Utility/Async/returns';
import * as util from '../common';
import { modelSelector } from '../constants';
import { getCrashCallStacksChannel } from '../logger';
import { PlatformInformation } from '../platform';
import * as telemetry from '../telemetry';
@@ -26,6 +27,7 @@ import { CodeActionDiagnosticInfo, CodeAnalysisDiagnosticIdentifiersAndUri, code
import { CppBuildTaskProvider } from './cppBuildTaskProvider';
import { getCustomConfigProviders } from './customProviders';
import { getLanguageConfig } from './languageConfig';
import { getLocaleId } from './localization';
import { PersistentState } from './persistentState';
import { NodeType, TreeNode } from './referencesModel';
import { CppSettings } from './settings';
@@ -359,7 +361,6 @@ export function registerCommands(enabled: boolean): void {
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.AddToIncludePath', enabled ? onAddToIncludePath : onDisabledCommand));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.EnableErrorSquiggles', enabled ? onEnableSquiggles : onDisabledCommand));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.DisableErrorSquiggles', enabled ? onDisableSquiggles : onDisabledCommand));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ToggleIncludeFallback', enabled ? onToggleIncludeFallback : onDisabledCommand));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ToggleDimInactiveRegions', enabled ? onToggleDimInactiveRegions : onDisabledCommand));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.PauseParsing', enabled ? onPauseParsing : onDisabledCommand));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ResumeParsing', enabled ? onResumeParsing : onDisabledCommand));
@@ -404,6 +405,7 @@ export function registerCommands(enabled: boolean): void {
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExtractToMemberFunction', enabled ? () => onExtractToFunction(false, true) : onDisabledCommand));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExpandSelection', enabled ? (r: Range) => onExpandSelection(r) : onDisabledCommand));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.getIncludes', enabled ? (maxDepth: number) => getIncludes(maxDepth) : () => Promise.resolve()));
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCopilotHover', enabled ? onCopilotHover : onDisabledCommand));
}
function onDisabledCommand() {
@@ -754,12 +756,6 @@ function onDisableSquiggles(): void {
settings.update<string>("errorSquiggles", "disabled");
}
function onToggleIncludeFallback(): void {
// This only applies to the active client.
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
settings.toggleSetting("intelliSenseEngineFallback", "enabled", "disabled");
}
function onToggleDimInactiveRegions(): void {
// This only applies to the active client.
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
@@ -1319,7 +1315,7 @@ export function UpdateInsidersAccess(): void {
const insidersMitigationDone: PersistentState<boolean> = new PersistentState<boolean>("CPP.insidersMitigationDone", false);
if (!insidersMitigationDone.Value) {
if (vscode.workspace.getConfiguration("extensions", null).get<boolean>("autoUpdate")) {
if (settings.getWithUndefinedDefault<string>("updateChannel") === undefined) {
if (settings.getStringWithUndefinedDefault("updateChannel") === undefined) {
installPrerelease = true;
}
}
@@ -1379,3 +1375,88 @@ export async function getIncludes(maxDepth: number): Promise<any> {
const includes = await clients.ActiveClient.getIncludes(maxDepth);
return includes;
}
// This uses several workarounds for interacting with the hover feature.
// A proposal for dynamic hover content would help, such as the one here (https://github.com/microsoft/vscode/issues/195394)
async function onCopilotHover(): Promise<void> {
if (!vscode.window.activeTextEditor) { return; }
// Check if the user has access to vscode language model.
const vscodelm = (vscode as any).lm;
if (!vscodelm) { return; }
// Prep hover with wait message and get the hover position location.
//const copilotHoverResult = await clients.ActiveClient.showCopilotHover('$(loading~spin)');
//const hoverPosition = new vscode.Position(copilotHoverResult.hoverPos.line, copilotHoverResult.hoverPos.character);
// Make sure the editor has focus.
//await vscode.window.showTextDocument(vscode.window.activeTextEditor.document, { preserveFocus: false, selection: new vscode.Selection(hoverPosition, hoverPosition) });
// Workaround to force the editor to update it's content, needs to be called from another location first.
//await vscode.commands.executeCommand('cursorMove', { to: 'right' });
//await vscode.commands.executeCommand('editor.action.showHover', { focus: 'noAutoFocus' });
// Move back and show the correct hover.
//await clients.ActiveClient.showCopilotHover('$(loading~spin)');
//await vscode.commands.executeCommand('cursorMove', { to: 'left' });
//await vscode.commands.executeCommand('editor.action.showHover', { focus: 'noAutoFocus'});
// Gather the content for the query from the client.
const response = await clients.ActiveClient.getCopilotHoverInfo();
// Ensure the content is valid before proceeding.
const request = response.content;
if (request.length === 0) {
return;
}
const locale = getLocaleId();
const messages = [
vscode.LanguageModelChatMessage
.User(request + locale)];
const [model] = await vscodelm.selectChatModels(modelSelector);
let chatResponse: vscode.LanguageModelChatResponse | undefined;
try {
chatResponse = await model.sendRequest(
messages,
{},
new vscode.CancellationTokenSource().token
);
} catch (err) {
if (err instanceof vscode.LanguageModelError) {
console.log(err.message, err.code, err.cause);
} else {
throw err;
}
return;
}
// Ensure we have a valid response from Copilot.
if (!chatResponse) { return; }
let content: string = '';
try {
for await (const fragment of chatResponse.text) {
content += fragment;
}
} catch (err) {
return;
}
//if (!vscode.window.activeTextEditor) { return; }
//await vscode.window.showTextDocument(vscode.window.activeTextEditor.document, { preserveFocus: false, selection: new vscode.Selection(hoverPosition, hoverPosition) });
// Same workaround as above to force the editor to update it's content.
//await clients.ActiveClient.showCopilotHover('$(loading~spin)');
//await vscode.commands.executeCommand('cursorMove', { to: 'right' });
//await vscode.commands.executeCommand('editor.action.showHover', { focus: 'noAutoFocus'});
// Prepare and show the real content.
await clients.ActiveClient.showCopilotHover(content);
//await vscode.commands.executeCommand('cursorMove', { to: 'left' });
//await vscode.commands.executeCommand('editor.action.showHover', { focus: 'noAutoFocus'});
}
@@ -12,6 +12,9 @@ import { Client } from './client';
import { clients } from './extension';
import { shouldChangeFromCToCpp } from './utils';
export const RequestCancelled: number = -32800;
export const ServerCancelled: number = -32802;
let anyFileOpened: boolean = false;
export function createProtocolFilter(): Middleware {
File diff suppressed because it is too large Load Diff
@@ -62,17 +62,17 @@ export class SettingsTracker {
if (subVal === undefined) {
continue;
}
if (subVal instanceof Object && !(subVal instanceof Array)) {
if (newRawSetting === undefined && subVal instanceof Object) {
collectSettingsRecursive(newKey, subVal, depth + 1);
} else {
const entry: KeyValuePair | undefined = this.filterAndSanitize(newKey, subVal, correctlyScopedSubSettings, filter);
if (entry && entry.key && entry.value) {
if (entry?.key && entry.value !== undefined) {
result[entry.key] = entry.value;
}
}
}
};
if (val instanceof Object && !(val instanceof Array)) {
if (rawSetting === undefined && val instanceof Object) {
collectSettingsRecursive(key, val, 1);
continue;
}
@@ -108,6 +108,9 @@ export class SettingsTracker {
return "<invalid>";
}
return val;
} else if (val === curSetting["default"]) {
// C_Cpp.default.browse.path is a special case where the default value is null and doesn't match the type definition.
return val;
}
}
}
@@ -123,6 +126,9 @@ export class SettingsTracker {
if (typeof value === t) {
return t;
}
if (t === "integer" && typeof value === "number") {
return "number";
}
if (t === "array" && value instanceof Array) {
return t;
}
@@ -131,8 +137,13 @@ export class SettingsTracker {
}
}
}
} else if (typeof type === "string" && typeof value === type) {
return type;
} else if (typeof type === "string") {
if (typeof value === type) {
return type;
}
if (type === "integer" && typeof value === "number") {
return "number";
}
}
}
return undefined;
+1 -1
View File
@@ -304,7 +304,7 @@ export function runInteractiveSshTerminalCommand(args: ITerminalCommandArgs): Pr
// When using showLoginTerminal, stdout include the passphrase prompt, etc. Try to get just the command output on the last line.
const actualOutput: string | undefined = cancel ? '' : lastNonemptyLine(stdout);
result.resolve({ succeeded: !exitCode, exitCode, output: actualOutput || '' });
result.resolve({ succeeded: !exitCode, exitCode, outputError: '', output: actualOutput || '' });
};
const failed = (error?: any) => {
+1 -1
View File
@@ -12,7 +12,7 @@ import { isIdentifierPart, isIdentifierStart } from './characterCodes';
/** simple dynamic tagged literal implementation */
export function taggedLiteral(templateString: string, templateVars: Record<string, any>): string {
return safeEval(`\`${templateString.replace(/\\/g, '\\\\').replace(/`/g, '\`')}\`;`, templateVars) as string;
return safeEval(`\`${templateString.replace(/\\/g, '\\\\').replace(/`/g, '\\`')}\`;`, templateVars) as string;
}
function parseTaggedLiteral(templateString: string) {
+26 -12
View File
@@ -65,7 +65,7 @@ export const packageJson: any = vscode.extensions.getExtension("ms-vscode.cpptoo
// Use getRawSetting to get subcategorized settings from package.json.
// This prevents having to iterate every time we search.
let flattenedPackageJson: Map<string, any>;
export function getRawSetting(key: string): any {
export function getRawSetting(key: string, breakIfMissing: boolean = false): any {
if (flattenedPackageJson === undefined) {
flattenedPackageJson = new Map();
for (const subheading of packageJson.contributes.configuration) {
@@ -74,7 +74,12 @@ export function getRawSetting(key: string): any {
}
}
}
return flattenedPackageJson.get(key);
const result = flattenedPackageJson.get(key);
if (result === undefined && breakIfMissing) {
// eslint-disable-next-line no-debugger
debugger; // The setting does not exist in package.json. Check the `key`.
}
return result;
}
export async function getRawJson(path: string | undefined): Promise<any> {
@@ -317,12 +322,12 @@ export function isBoolean(input: any): input is boolean {
return typeof input === "boolean";
}
export function isObject(input: any): input is object {
return typeof input === "object";
export function isObject(input: any): boolean {
return input !== null && typeof input === "object" && !isArray(input);
}
export function isArray(input: any): input is any[] {
return input instanceof Array;
return Array.isArray(input);
}
export function isOptionalString(input: any): input is string | undefined {
@@ -333,6 +338,15 @@ export function isArrayOfString(input: any): input is string[] {
return isArray(input) && input.every(isString);
}
// Validates whether the given object is a valid mapping of key and value type.
// EX: {"key": true, "key2": false} should return true for keyType = string and valueType = boolean.
export function isValidMapping(value: any, isValidKey: (key: any) => boolean, isValidValue: (value: any) => boolean): value is object {
if (isObject(value)) {
return Object.entries(value).every(([key, val]) => isValidKey(key) && isValidValue(val));
}
return false;
}
export function isOptionalArrayOfString(input: any): input is string[] | undefined {
return input === undefined || isArrayOfString(input);
}
@@ -739,6 +753,7 @@ export interface ProcessReturnType {
succeeded: boolean;
exitCode?: number | NodeJS.Signals;
output: string;
outputError: string;
}
export async function spawnChildProcess(program: string, args: string[] = [], continueOn?: string, skipLogging?: boolean, cancellationToken?: vscode.CancellationToken): Promise<ProcessReturnType> {
@@ -752,7 +767,7 @@ export async function spawnChildProcess(program: string, args: string[] = [], co
const programOutput: ProcessOutput = await spawnChildProcessImpl(program, args, continueOn, skipLogging, cancellationToken);
const exitCode: number | NodeJS.Signals | undefined = programOutput.exitCode;
if (programOutput.exitCode) {
return { succeeded: false, exitCode, output: programOutput.stderr || programOutput.stdout || localize('process.exited', 'Process exited with code {0}', exitCode) };
return { succeeded: false, exitCode, outputError: programOutput.stderr, output: programOutput.stderr || programOutput.stdout || localize('process.exited', 'Process exited with code {0}', exitCode) };
} else {
let stdout: string;
if (programOutput.stdout.length) {
@@ -761,7 +776,7 @@ export async function spawnChildProcess(program: string, args: string[] = [], co
} else {
stdout = localize('process.succeeded', 'Process executed successfully.');
}
return { succeeded: true, exitCode, output: stdout };
return { succeeded: true, exitCode, outputError: programOutput.stderr, output: stdout };
}
}
@@ -1081,15 +1096,15 @@ export function isCl(compilerPath: string): boolean {
/** CompilerPathAndArgs retains original casing of text input for compiler path and args */
export interface CompilerPathAndArgs {
compilerPath?: string;
compilerPath?: string | null;
compilerName: string;
compilerArgs?: string[];
compilerArgsFromCommandLineInPath: string[];
allCompilerArgs: string[];
}
export function extractCompilerPathAndArgs(useLegacyBehavior: boolean, inputCompilerPath?: string, compilerArgs?: string[]): CompilerPathAndArgs {
let compilerPath: string | undefined = inputCompilerPath;
export function extractCompilerPathAndArgs(useLegacyBehavior: boolean, inputCompilerPath?: string | null, compilerArgs?: string[]): CompilerPathAndArgs {
let compilerPath: string | undefined | null = inputCompilerPath;
let compilerName: string = "";
let compilerArgsFromCommandLineInPath: string[] = [];
if (compilerPath) {
@@ -1766,8 +1781,7 @@ export function buildShellCommandLine(originalCommand: CommandString, command: C
let commandLine = result.join(' ');
// There are special rules quoted command line in cmd.exe
if (isWindows)
{
if (isWindows) {
commandLine = `chcp 65001>nul && ${commandLine}`;
if (commandQuoted && argQuoted) {
commandLine = '"' + commandLine + '"';
+3
View File
@@ -13,3 +13,6 @@ export const isLinux = OperatingSystem === 'linux';
// if you want to see the output of verbose logging, set this to true.
export const verboseEnabled = false;
// Model selector for Copilot features
export const modelSelector = { vendor: 'copilot', family: 'gpt-4' };
+2 -1
View File
@@ -478,5 +478,6 @@
"refactor_extract_reference_return_c_code": "The function would have to return a value by reference. C code cannot return references.",
"refactor_extract_xborder_jump": "Jumps between the selected code and the surrounding code are present.",
"refactor_extract_missing_return": "In the selected code, some control paths exit without setting the return value. This is supported only for scalar, numeric, and pointer return types.",
"expand_selection": "Expand selection (to enable 'Extract to function')"
"expand_selection": "Expand selection (to enable 'Extract to function')",
"copilot_hover_link": "Generate Copilot summary"
}
+4
View File
@@ -83,6 +83,10 @@ export async function isExperimentEnabled(experimentName: string): Promise<boole
if (new CppSettings().experimentalFeatures) {
return true;
}
return isFlightEnabled(experimentName);
}
export async function isFlightEnabled(experimentName: string): Promise<boolean> {
const experimentationService: IExperimentationService | undefined = await getExperimentationService();
const isEnabled: boolean | undefined = experimentationService?.getTreatmentVariable<boolean>("vscode", experimentName);
return isEnabled ?? false;
-11
View File
@@ -8,7 +8,6 @@
'use strict';
const path = require('path');
const copyPlugin = require('copy-webpack-plugin');
/**@type {import('webpack').Configuration}*/
const config = {
@@ -32,16 +31,6 @@ const config = {
extensions: ['.js', '.ts',],
mainFields: ['main', 'module'],
},
plugins: [
new copyPlugin({
patterns: [
{
from: path.resolve(__dirname, 'node_modules', "@one-ini", "wasm", "one_ini_bg.wasm"),
to: path.resolve(__dirname, 'dist', 'src')
}
]
})
],
module: {
rules: [{
test: /\.ts$/,
+352 -476
View File
File diff suppressed because it is too large Load Diff