Skip to content

Commit

Permalink
Refresh branch (#4116)
Browse files Browse the repository at this point in the history
<!-- Thank you for submitting a pull request.
If this is your first pull request you can find information about
contributing here:
  * https://github.com/posit-dev/positron/blob/main/CONTRIBUTING.md

We recommend synchronizing your branch with the latest changes in the
main branch by either pulling or rebasing.
-->

<!--
  Describe briefly what problem this pull request resolves, or what
  new feature it introduces. Include screenshots of any new or altered
  UI. Link to any GitHub issues but avoid "magic" keywords that will 
  automatically close the issue. If there are any details about your 
approach that are unintuitive or you want to draw attention to, please
  describe them here.
-->

### QA Notes

<!--
  Add additional information for QA on how to validate the change,
  paying special attention to the level of risk, adjacent areas that
  could be affected by the change, and any important contextual
  information not present in the linked issues.
-->

---------

Signed-off-by: Daniel Falbel <[email protected]>
Co-authored-by: Jonathan <[email protected]>
Co-authored-by: Lionel Henry <[email protected]>
Co-authored-by: Daniel Falbel <[email protected]>
Co-authored-by: Brian Lambert <[email protected]>
Co-authored-by: Jennifer (Jenny) Bryan <[email protected]>
Co-authored-by: positron-bot[bot] <173392469+positron-bot[bot]@users.noreply.github.com>
Co-authored-by: Wasim Lorgat <[email protected]>
Co-authored-by: Tim Mok <[email protected]>
Co-authored-by: Jon Vanausdeln <[email protected]>
Co-authored-by: Christopher Mead <[email protected]>
Co-authored-by: sharon <[email protected]>
Co-authored-by: Wes McKinney <[email protected]>
Co-authored-by: Nick Strayer <[email protected]>
Co-authored-by: Kyle F Butts <[email protected]>
  • Loading branch information
15 people authored Jul 22, 2024
1 parent f4ed496 commit 067ae78
Show file tree
Hide file tree
Showing 1,823 changed files with 36,581 additions and 16,525 deletions.
4 changes: 2 additions & 2 deletions .configurations/configuration.dsc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ properties:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: npm
directives:
description: Install NodeJS version >=18.15.x and <19
description: Install NodeJS version 20
allowPrerelease: true
settings:
id: OpenJS.NodeJS.LTS
version: "18.18.0"
version: "20.14.0"
source: winget
- resource: NpmDsc/NpmPackage
id: yarn
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/devcontainers/typescript-node:18-bookworm
FROM mcr.microsoft.com/devcontainers/typescript-node:20-bookworm

ADD install-vscode.sh /root/
RUN /root/install-vscode.sh
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@
"events",
"fs",
"fs/promises",
"graceful-fs",
"http",
"https",
"minimist",
Expand All @@ -690,6 +689,7 @@
"vscode-regexpp",
"vscode-textmate",
"worker_threads",
"@xterm/addon-clipboard",
"@xterm/addon-image",
"@xterm/addon-search",
"@xterm/addon-serialize",
Expand Down
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ labels: ['bug']
## What did you expect to happen?


## Were there any error messages in the output or Developer Tools console?
## Were there any error messages in the Output panel or Developer Tools console?

<!--
Open the Developer Tools console by running the Developer: Toggle Developer Tools command from the Command Palette.
A guide to locating the correct Output channel can be found here: https://github.com/posit-dev/positron/wiki/Troubleshooting
-->

5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/generic_issue_ark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: File an issue for Ark
about: Create a new issue for the Ark kernel (https://github.com/posit-dev/ark).
labels: ["lang: r", "area: kernels"]
---
4 changes: 2 additions & 2 deletions .github/classifier.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"debug": {"assign": ["roblourens"]},
"debug-disassembly": {"assign": []},
"dialogs": {"assign": ["sbatten"]},
"diff-editor": {"assign": ["alexdima"]},
"diff-editor": {"assign": ["hediet"]},
"dropdown": {"assign": ["lramos15"]},
"editor-api": {"assign": ["alexdima"]},
"editor-autoclosing": {"assign": ["alexdima"]},
Expand Down Expand Up @@ -116,7 +116,7 @@
"json": {"assign": ["aeschli"]},
"json-sorting": {"assign": ["aiday-mar"]},
"keybindings": {"assign": ["ulugbekna"]},
"keybindings-editor": {"assign": ["sandy081"]},
"keybindings-editor": {"assign": ["ulugbekna"]},
"keyboard-layout": {"assign": ["ulugbekna"]},
"L10N": {"assign": ["TylerLeonhardt", "csigs"]},
"l10n-platform": {"assign": ["TylerLeonhardt"]},
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/locker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
- name: Run Locker
uses: ./actions/locker
with:
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
daysSinceClose: 45
appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}}
daysSinceUpdate: 3
ignoredLabel: "*out-of-scope,accessibility"
ignoreLabelUntil: "author-verification-requested"
ignoredMilestones: "Backlog Candidates"
labelUntil: "verified"
11 changes: 11 additions & 0 deletions .github/workflows/on-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ jobs:
- name: Install Actions
run: npm install --production --prefix ./actions

- name: Check for Validity
uses: ./actions/validity-checker
with:
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}

- name: Run CopyCat (VSCodeTriageBot/testissues)
if: github.event.issue.user.login != 'ghost'
uses: ./actions/copycat
with:
appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}}
Expand All @@ -25,6 +31,7 @@ jobs:
repo: testissues

- name: Run New Release
if: github.event.issue.user.login != 'ghost'
uses: ./actions/new-release
with:
label: new release
Expand All @@ -36,6 +43,7 @@ jobs:
days: 5

- name: Run Clipboard Labeler
if: github.event.issue.user.login != 'ghost'
uses: ./actions/regex-labeler
with:
appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}}
Expand All @@ -44,6 +52,7 @@ jobs:
comment: "It looks like you're using the VS Code Issue Reporter but did not paste the text generated into the created issue. We've closed this issue, please open a new one containing the text we placed in your clipboard.\n\nHappy Coding!"

- name: Run Clipboard Labeler (Chinese)
if: github.event.issue.user.login != 'ghost'
uses: ./actions/regex-labeler
with:
appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}}
Expand All @@ -53,6 +62,7 @@ jobs:

# source of truth in ./english-please.yml
- name: Run English Please
if: github.event.issue.user.login != 'ghost'
uses: ./actions/english-please
with:
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
Expand All @@ -64,6 +74,7 @@ jobs:
translatorRequestedLabelColor: "c29cff"
# source of truth in ./test-plan-item-validator.yml
- name: Run Test Plan Item Validator
if: github.event.issue.user.login != 'ghost'
uses: ./actions/test-plan-item-validator
with:
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/on-reopen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: On Reopen
on:
issues:
types: [reopened]

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v4
with:
repository: "microsoft/vscode-github-triage-actions"
ref: stable
path: ./actions
- name: Install Actions
run: npm install --production --prefix ./actions

- name: Check for Validity
uses: ./actions/validity-checker
with:
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
7 changes: 7 additions & 0 deletions .github/workflows/positron-full-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ jobs:
curl https://raw.githubusercontent.com/posit-dev/qa-example-content/main/DESCRIPTION --output DESCRIPTION
Rscript -e "pak::local_install_dev_deps(ask = FALSE)"
# Instructions from: https://github.com/conda-forge/miniforge/?tab=readme-ov-file#downloading-the-installer-as-part-of-a-ci-pipeline
- name: Install Conda (Miniforge3)
run: |
wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
sudo bash Miniforge3.sh -b -p "${HOME}/conda"
source "${HOME}/conda/etc/profile.d/conda.sh"
- uses: actions/setup-node@v3
with:
node-version: 20
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/positron-python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defaults:
working-directory: 'extensions/positron-python'

env:
NODE_VERSION: '18.17.1'
NODE_VERSION: '20.12.1'
PYTHON_VERSION: '3.10'
PROJECT_DIR: 'extensions/positron-python'
PYTHON_SRC_DIR: 'extensions/positron-python/python_files'
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
cache: 'pip'

- name: Install Node dependencies
run: yarn install --immutable --network-timeout 120000 --prefer-offline
run: yarn --immutable --network-timeout 120000

- name: Run `gulp prePublishNonBundle`
run: yarn prePublish
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:
cache: 'pip'

- name: Install Node dependencies
run: yarn install --immutable --network-timeout 120000 --prefer-offline
run: yarn --immutable --network-timeout 120000

- name: Run `gulp prePublishNonBundle`
run: yarn prePublish
Expand Down
5 changes: 5 additions & 0 deletions .vscode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const extensions = [
label: 'positron-r',
workspaceFolder: path.join(os.tmpdir(), `positron-r-${Math.floor(Math.random() * 100000)}`),
mocha: { timeout: 60_000 }
},
{
label: 'positron-connections',
workspaceFolder: path.join(os.tmpdir(), `positron-connections-${Math.floor(Math.random() * 100000)}`),
mocha: { timeout: 60_000 }
}
// --- End Positron ---
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { IstanbulCoverageContext } from 'istanbul-to-vscode';
import * as vscode from 'vscode';
import { SourceLocationMapper, SourceMapStore } from './testOutputScanner';
import { SearchStrategy, SourceLocationMapper, SourceMapStore } from './testOutputScanner';
import { IScriptCoverage, OffsetToPosition, RangeCoverageTracker } from './v8CoverageWrangling';

export const istanbulCoverageContext = new IstanbulCoverageContext();
Expand All @@ -18,7 +18,7 @@ export const istanbulCoverageContext = new IstanbulCoverageContext();
export class PerTestCoverageTracker {
private readonly scripts = new Map</* script ID */ string, Script>();

constructor(private readonly maps: SourceMapStore) {}
constructor(private readonly maps: SourceMapStore) { }

public add(coverage: IScriptCoverage, test?: vscode.TestItem) {
const script = this.scripts.get(coverage.scriptId);
Expand Down Expand Up @@ -71,11 +71,7 @@ class Script {
public async report(run: vscode.TestRun) {
const mapper = await this.maps.getSourceLocationMapper(this.uri.toString());
const originalUri = (await this.maps.getSourceFile(this.uri.toString())) || this.uri;

run.addCoverage(this.overall.report(originalUri, this.converter, mapper));
for (const [test, projection] of this.perItem) {
run.addCoverage(projection.report(originalUri, this.converter, mapper, test));
}
run.addCoverage(this.overall.report(originalUri, this.converter, mapper, this.perItem));
}
}

Expand All @@ -88,20 +84,11 @@ class ScriptCoverageTracker {
}
}

/**
* Generates the script's coverage for the test run.
*
* If a source location mapper is given, it assumes the `uri` is the mapped
* URI, and that any unmapped locations/outside the URI should be ignored.
*/
public report(
public *toDetails(
uri: vscode.Uri,
convert: OffsetToPosition,
mapper: SourceLocationMapper | undefined,
item?: vscode.TestItem
): V8CoverageFile {
const file = new V8CoverageFile(uri, item);

) {
for (const range of this.coverage) {
if (range.start === range.end) {
continue;
Expand All @@ -113,8 +100,8 @@ class ScriptCoverageTracker {
const endCov = convert.toLineColumn(range.end);
let end = new vscode.Position(endCov.line, endCov.column);
if (mapper) {
const startMap = mapper(start.line, start.character);
const endMap = startMap && mapper(end.line, end.character);
const startMap = mapper(start.line, start.character, SearchStrategy.FirstAfter);
const endMap = startMap && mapper(end.line, end.character, SearchStrategy.FirstBefore);
if (!endMap || uri.toString().toLowerCase() !== endMap.uri.toString().toLowerCase()) {
continue;
}
Expand All @@ -123,28 +110,48 @@ class ScriptCoverageTracker {
}

for (let i = start.line; i <= end.line; i++) {
file.add(
new vscode.StatementCoverage(
range.covered,
new vscode.Range(
new vscode.Position(i, i === start.line ? start.character : 0),
new vscode.Position(i, i === end.line ? end.character : Number.MAX_SAFE_INTEGER)
)
yield new vscode.StatementCoverage(
range.covered,
new vscode.Range(
new vscode.Position(i, i === start.line ? start.character : 0),
new vscode.Position(i, i === end.line ? end.character : Number.MAX_SAFE_INTEGER)
)
);
}
}
}

/**
* Generates the script's coverage for the test run.
*
* If a source location mapper is given, it assumes the `uri` is the mapped
* URI, and that any unmapped locations/outside the URI should be ignored.
*/
public report(
uri: vscode.Uri,
convert: OffsetToPosition,
mapper: SourceLocationMapper | undefined,
items: Map<vscode.TestItem, ScriptCoverageTracker>,
): V8CoverageFile {
const file = new V8CoverageFile(uri, items, convert, mapper);
for (const detail of this.toDetails(uri, convert, mapper)) {
file.add(detail);
}

return file;
}
}

export class V8CoverageFile extends vscode.FileCoverage {
export class V8CoverageFile extends vscode.FileCoverage2 {
public details: vscode.StatementCoverage[] = [];

constructor(uri: vscode.Uri, item?: vscode.TestItem) {
super(uri, { covered: 0, total: 0 });
(this as vscode.FileCoverage2).testItem = item;
constructor(
uri: vscode.Uri,
private readonly perTest: Map<vscode.TestItem, ScriptCoverageTracker>,
private readonly convert: OffsetToPosition,
private readonly mapper: SourceLocationMapper | undefined,
) {
super(uri, { covered: 0, total: 0 }, undefined, undefined, [...perTest.keys()]);
}

public add(detail: vscode.StatementCoverage) {
Expand All @@ -154,4 +161,9 @@ export class V8CoverageFile extends vscode.FileCoverage {
this.statementCoverage.covered++;
}
}

public testDetails(test: vscode.TestItem): vscode.FileCoverageDetail[] {
const t = this.perTest.get(test);
return t ? [...t.toDetails(this.uri, this.convert, this.mapper)] : [];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.tests.registerTestFollowupProvider({
async provideFollowup(_result, test, taskIndex, messageIndex, _token) {
return [{
title: '$(sparkle) Ask copilot for help',
title: '$(sparkle) Fix with Copilot',
command: 'github.copilot.tests.fixTestFailure',
arguments: [{ source: 'peekFollowup', test, message: test.taskStates[taskIndex].messages[messageIndex] }]
}];
Expand Down Expand Up @@ -119,7 +119,7 @@ export async function activate(context: vscode.ExtensionContext) {
map,
task,
kind === vscode.TestRunProfileKind.Debug
? await runner.debug(currentArgs, req.include)
? await runner.debug(task, currentArgs, req.include)
: await runner.run(currentArgs, req.include),
coverageDir,
cancellationToken
Expand Down Expand Up @@ -196,13 +196,8 @@ export async function activate(context: vscode.ExtensionContext) {
true
);

coverage.loadDetailedCoverage = async (_run, coverage) => {
if (coverage instanceof V8CoverageFile) {
return coverage.details;
}

return [];
};
coverage.loadDetailedCoverage = async (_run, coverage) => coverage instanceof V8CoverageFile ? coverage.details : [];
coverage.loadDetailedCoverageForTest = async (_run, coverage, test) => coverage instanceof V8CoverageFile ? coverage.testDetails(test) : [];

for (const [name, arg] of browserArgs) {
const cfg = ctrl.createRunProfile(
Expand Down
Loading

0 comments on commit 067ae78

Please sign in to comment.