diff --git a/sample/LICENSE.txt b/sample/LICENSE.txt new file mode 100644 index 00000000..a2413e97 --- /dev/null +++ b/sample/LICENSE.txt @@ -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. diff --git a/sample/package-lock.json b/sample/package-lock.json index b3b0a2f4..f97037f3 100644 --- a/sample/package-lock.json +++ b/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": { diff --git a/sample/package.json b/sample/package.json index 8e0a05d6..f26efbc0 100644 --- a/sample/package.json +++ b/sample/package.json @@ -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": [ diff --git a/sample/yarn.lock b/sample/yarn.lock index 6efb32a5..f03f8344 100644 --- a/sample/yarn.lock +++ b/sample/yarn.lock @@ -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" diff --git a/vscode-dotnet-runtime-extension/package-lock.json b/vscode-dotnet-runtime-extension/package-lock.json index ea407352..cf9d4f91 100644 --- a/vscode-dotnet-runtime-extension/package-lock.json +++ b/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": { diff --git a/vscode-dotnet-runtime-extension/yarn.lock b/vscode-dotnet-runtime-extension/yarn.lock index 55fa9e89..8ebedc44 100644 --- a/vscode-dotnet-runtime-extension/yarn.lock +++ b/vscode-dotnet-runtime-extension/yarn.lock @@ -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" diff --git a/vscode-dotnet-runtime-library/package-lock.json b/vscode-dotnet-runtime-library/package-lock.json index 237275ad..5f57aaa6 100644 --- a/vscode-dotnet-runtime-library/package-lock.json +++ b/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" } }, diff --git a/vscode-dotnet-runtime-library/src/EventStream/OutputChannelObserver.ts b/vscode-dotnet-runtime-library/src/EventStream/OutputChannelObserver.ts index f7a93d3e..9c9283af 100644 --- a/vscode-dotnet-runtime-library/src/EventStream/OutputChannelObserver.ts +++ b/vscode-dotnet-runtime-library/src/EventStream/OutputChannelObserver.ts @@ -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; } } diff --git a/vscode-dotnet-runtime-library/src/Utils/Debugging.ts b/vscode-dotnet-runtime-library/src/Utils/Debugging.ts index 9d388299..c39eb6fe 100644 --- a/vscode-dotnet-runtime-library/src/Utils/Debugging.ts +++ b/vscode-dotnet-runtime-library/src/Utils/Debugging.ts @@ -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 diff --git a/vscode-dotnet-runtime-library/src/Utils/WebRequestWorker.ts b/vscode-dotnet-runtime-library/src/Utils/WebRequestWorker.ts index 9781bc20..73c7bd08 100644 --- a/vscode-dotnet-runtime-library/src/Utils/WebRequestWorker.ts +++ b/vscode-dotnet-runtime-library/src/Utils/WebRequestWorker.ts @@ -75,7 +75,7 @@ export class WebRequestWorker { private async makeWebRequestWithRetries(url : string, throwOnError: boolean, retriesCount: number): Promise { 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)); }}); } diff --git a/vscode-dotnet-runtime-library/yarn.lock b/vscode-dotnet-runtime-library/yarn.lock index 144969ac..dbc86474 100644 --- a/vscode-dotnet-runtime-library/yarn.lock +++ b/vscode-dotnet-runtime-library/yarn.lock @@ -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": diff --git a/vscode-dotnet-sdk-extension/package-lock.json b/vscode-dotnet-sdk-extension/package-lock.json index 1d7bb34d..6a210ea4 100644 --- a/vscode-dotnet-sdk-extension/package-lock.json +++ b/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", diff --git a/vscode-dotnet-sdk-extension/yarn.lock b/vscode-dotnet-sdk-extension/yarn.lock index e4c07f5a..a6d2089a 100644 --- a/vscode-dotnet-sdk-extension/yarn.lock +++ b/vscode-dotnet-sdk-extension/yarn.lock @@ -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"