Fix Debugging log bugs and dependency flows

VSCode sha integrity needed to be updated due to a change someone pushed upstream
In addition, p-retry does not work on vs code with newer versions yet due to vscode support limitations of es6 features
so we had to downgrade it to keep it from failing
This commit is contained in:
Noah Gilson 2023-07-31 09:54:21 -07:00
Родитель c56d813810
Коммит 51e5aea6db
13 изменённых файлов: 98 добавлений и 42 удалений

23
sample/LICENSE.txt Normal file
Просмотреть файл

@ -0,0 +1,23 @@
The MIT License (MIT)
Copyright (c) .NET Foundation, Microsoft and Contributors
All rights reserved.
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.

6
sample/package-lock.json сгенерированный
Просмотреть файл

@ -25,7 +25,7 @@
"typescript": "4.4.4"
},
"engines": {
"vscode": "^1.74.0"
"vscode": "^1.75.0"
}
},
"../vscode-dotnet-runtime-extension": {
@ -286,7 +286,7 @@
"node_modules/@types/vscode": {
"version": "1.74.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz",
"integrity": "sha1-tNbRktWut16R0K3vaJw+zvmHnac=",
"integrity": "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0=",
"dev": true,
"license": "MIT"
},
@ -2840,7 +2840,7 @@
"@types/vscode": {
"version": "1.74.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz",
"integrity": "sha1-tNbRktWut16R0K3vaJw+zvmHnac=",
"integrity": "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0=",
"dev": true
},
"@ungap/promise-all-settled": {

Просмотреть файл

@ -10,7 +10,7 @@
"version": "0.0.1",
"publisher": "ms-dotnettools",
"engines": {
"vscode": "^1.74.0"
"vscode": "^1.75.0"
},
"categories": [
"Other"
@ -18,6 +18,13 @@
"capabilities": {
"virtualWorkspaces": true
},
"extensionDependencies": [
"ms-dotnettools.vscode-dotnet-runtime",
"ms-dotnettools.vscode-dotnet-sdk"
],
"main": "./out/extension.js",
"contributes": {
"commands": [

Просмотреть файл

@ -55,7 +55,7 @@
"@types/node" "*"
"@types/vscode@1.74.0":
"integrity" "sha1-tNbRktWut16R0K3vaJw+zvmHnac="
"integrity" "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0="
"resolved" "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz"
"version" "1.74.0"

4
vscode-dotnet-runtime-extension/package-lock.json сгенерированный
Просмотреть файл

@ -460,7 +460,7 @@
"node_modules/@types/vscode": {
"version": "1.74.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz",
"integrity": "sha1-tNbRktWut16R0K3vaJw+zvmHnac=",
"integrity": "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0=",
"dev": true,
"license": "MIT"
},
@ -4617,7 +4617,7 @@
"@types/vscode": {
"version": "1.74.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz",
"integrity": "sha1-tNbRktWut16R0K3vaJw+zvmHnac=",
"integrity": "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0=",
"dev": true
},
"@ungap/promise-all-settled": {

Просмотреть файл

@ -220,7 +220,7 @@
"@types/node" "*"
"@types/vscode@1.74.0":
"integrity" "sha1-tNbRktWut16R0K3vaJw+zvmHnac="
"integrity" "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0="
"resolved" "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz"
"version" "1.74.0"

32
vscode-dotnet-runtime-library/package-lock.json сгенерированный
Просмотреть файл

@ -305,9 +305,9 @@
}
},
"node_modules/@types/retry": {
"version": "0.12.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/retry/-/retry-0.12.0.tgz",
"integrity": "sha1-KzXsz87n04zXKtmSMvvVi/+zyE0=",
"version": "0.12.1",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/retry/-/retry-0.12.1.tgz",
"integrity": "sha1-2PHA0Nwjr61twWqemToIZXdLQGU=",
"license": "MIT"
},
"node_modules/@types/rimraf": {
@ -345,7 +345,7 @@
"node_modules/@types/vscode": {
"version": "1.74.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz",
"integrity": "sha1-tNbRktWut16R0K3vaJw+zvmHnac=",
"integrity": "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0=",
"license": "MIT"
},
"node_modules/@ungap/promise-all-settled": {
@ -2461,12 +2461,12 @@
}
},
"node_modules/p-retry": {
"version": "4.6.2",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/p-retry/-/p-retry-4.6.2.tgz",
"integrity": "sha1-m6rnGEBX7dThcjHO4EJkEG4JKhY=",
"version": "4.6.1",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/p-retry/-/p-retry-4.6.1.tgz",
"integrity": "sha1-j83dXN96Z6CRGpzy7w5d9/YCMWw=",
"license": "MIT",
"dependencies": {
"@types/retry": "0.12.0",
"@types/retry": "^0.12.0",
"retry": "^0.13.1"
},
"engines": {
@ -3875,9 +3875,9 @@
}
},
"@types/retry": {
"version": "0.12.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/retry/-/retry-0.12.0.tgz",
"integrity": "sha1-KzXsz87n04zXKtmSMvvVi/+zyE0="
"version": "0.12.1",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/retry/-/retry-0.12.1.tgz",
"integrity": "sha1-2PHA0Nwjr61twWqemToIZXdLQGU="
},
"@types/rimraf": {
"version": "3.0.2",
@ -3910,7 +3910,7 @@
"@types/vscode": {
"version": "1.74.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz",
"integrity": "sha1-tNbRktWut16R0K3vaJw+zvmHnac="
"integrity": "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0="
},
"@ungap/promise-all-settled": {
"version": "1.1.2",
@ -5290,11 +5290,11 @@
}
},
"p-retry": {
"version": "4.6.2",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/p-retry/-/p-retry-4.6.2.tgz",
"integrity": "sha1-m6rnGEBX7dThcjHO4EJkEG4JKhY=",
"version": "4.6.1",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/p-retry/-/p-retry-4.6.1.tgz",
"integrity": "sha1-j83dXN96Z6CRGpzy7w5d9/YCMWw=",
"requires": {
"@types/retry": "0.12.0",
"@types/retry": "^0.12.0",
"retry": "^0.13.1"
}
},

Просмотреть файл

@ -8,6 +8,7 @@ import {
DotnetAcquisitionError,
DotnetAcquisitionStarted,
DotnetAcquisitionVersionError,
DotnetDebuggingMessage,
DotnetExistingPathResolutionCompleted,
} from './EventStreamEvents';
import { EventType } from './EventType';
@ -22,8 +23,10 @@ export class OutputChannelObserver implements IEventStreamObserver {
constructor(private readonly outputChannel: vscode.OutputChannel) {
}
public post(event: IEvent): void {
switch (event.type) {
public post(event: IEvent): void
{
switch (event.type)
{
case EventType.DotnetRuntimeAcquisitionStart:
this.outputChannel.append('Downloading the .NET Runtime.');
this.outputChannel.appendLine('');
@ -88,6 +91,10 @@ export class OutputChannelObserver implements IEventStreamObserver {
this.stopDownloadIndicator();
}
break;
case EventType.DotnetDebuggingMessage:
const loggedMessage = event as DotnetDebuggingMessage;
this.outputChannel.appendLine(loggedMessage.message);
break;
}
}

Просмотреть файл

@ -2,16 +2,23 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import path = require('path');
import { IEventStream } from '../EventStream/EventStream';
import {
DotnetDebuggingMessage,
} from '../EventStream/EventStreamEvents';
import * as fs from 'fs';
/**
* A simple wrapper around console logging that can disable / enable all debugging or logging messages.
*/
export class Debugging {
export class Debugging
{
static logFile = path.join('C:', 'VsDotnetDebuggingLog.txt');
static debugOn = true;
static logToVS = true;
static logToFile = true;
public static log(message : string, eventStream : IEventStream | null = null)
{
@ -21,9 +28,21 @@ export class Debugging {
{
eventStream?.post(new DotnetDebuggingMessage(message));
}
else
console.log(message);
if(Debugging.logFile)
{
console.log(message);
console.log(`Writing to ${Debugging.logFile}`);
if(Debugging.logToVS)
{
eventStream?.post(new DotnetDebuggingMessage(`Writing to ${Debugging.logFile}`));
}
const file = fs.createWriteStream(Debugging.logFile, { flags: 'a+' });
file.write(message);
}
}
else

Просмотреть файл

@ -75,7 +75,7 @@ export class WebRequestWorker {
private async makeWebRequestWithRetries(url : string, throwOnError: boolean, retriesCount: number): Promise<string | undefined> {
return retry(async () => {
return this.makeWebRequest(url, throwOnError);
}, { retries: retriesCount, onFailedAttempt: async (error) => {
}, { retries: retriesCount, onFailedAttempt: async (error: { attemptNumber: number; }) => {
await this.delay(Math.pow(2, error.attemptNumber));
}});
}

Просмотреть файл

@ -148,10 +148,10 @@
dependencies:
"@types/node" "*"
"@types/retry@0.12.0":
"integrity" "sha1-KzXsz87n04zXKtmSMvvVi/+zyE0="
"resolved" "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/retry/-/retry-0.12.0.tgz"
"version" "0.12.0"
"@types/retry@^0.12.0":
"integrity" "sha1-2PHA0Nwjr61twWqemToIZXdLQGU="
"resolved" "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/retry/-/retry-0.12.1.tgz"
"version" "0.12.1"
"@types/rimraf@3.0.2":
"integrity" "sha1-pj0XWzMXSOUiCtSMkB17vx9E7vg="
@ -180,7 +180,7 @@
"version" "4.0.2"
"@types/vscode@1.74.0":
"integrity" "sha1-tNbRktWut16R0K3vaJw+zvmHnac="
"integrity" "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0="
"resolved" "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz"
"version" "1.74.0"
@ -1589,11 +1589,11 @@
"p-limit" "^3.0.2"
"p-retry@^4.6.1":
"integrity" "sha1-m6rnGEBX7dThcjHO4EJkEG4JKhY="
"resolved" "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/p-retry/-/p-retry-4.6.2.tgz"
"version" "4.6.2"
"integrity" "sha1-j83dXN96Z6CRGpzy7w5d9/YCMWw="
"resolved" "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/p-retry/-/p-retry-4.6.1.tgz"
"version" "4.6.1"
dependencies:
"@types/retry" "0.12.0"
"@types/retry" "^0.12.0"
"retry" "^0.13.1"
"p-some@^5.0.0":

4
vscode-dotnet-sdk-extension/package-lock.json сгенерированный
Просмотреть файл

@ -464,7 +464,7 @@
"node_modules/@types/vscode": {
"version": "1.74.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz",
"integrity": "sha1-tNbRktWut16R0K3vaJw+zvmHnac=",
"integrity": "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0=",
"license": "MIT"
},
"node_modules/@ungap/promise-all-settled": {
@ -4536,7 +4536,7 @@
"@types/vscode": {
"version": "1.74.0",
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz",
"integrity": "sha1-tNbRktWut16R0K3vaJw+zvmHnac="
"integrity": "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0="
},
"@ungap/promise-all-settled": {
"version": "1.1.2",

Просмотреть файл

@ -227,7 +227,7 @@
"@types/node" "*"
"@types/vscode@1.74.0":
"integrity" "sha1-tNbRktWut16R0K3vaJw+zvmHnac="
"integrity" "sha1-StwhtOf1J7iT3jQYwhqR8eUDvc0="
"resolved" "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@types/vscode/-/vscode-1.74.0.tgz"
"version" "1.74.0"