From 5d08d0a49bb137ae9639cea61b472bf858821df4 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Sat, 9 May 2020 17:02:32 +0100 Subject: [PATCH] Cleanup unused variables --- src/features/GenerateBugReport.ts | 2 - src/features/HelpCompletion.ts | 2 - src/main.ts | 5 --- src/session.ts | 9 ++-- .../updateExtensionVersions.ps1 | 42 ------------------- 5 files changed, 3 insertions(+), 57 deletions(-) diff --git a/src/features/GenerateBugReport.ts b/src/features/GenerateBugReport.ts index 6904095096..dd29ef673f 100644 --- a/src/features/GenerateBugReport.ts +++ b/src/features/GenerateBugReport.ts @@ -2,7 +2,6 @@ * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ -import cp = require("child_process"); import os = require("os"); import vscode = require("vscode"); import { IFeature, LanguageClient } from "../feature"; @@ -30,7 +29,6 @@ const extensions = export class GenerateBugReportFeature implements IFeature { private command: vscode.Disposable; - private powerShellProcess: cp.ChildProcess; constructor(private sessionManager: SessionManager) { this.command = vscode.commands.registerCommand("PowerShell.GenerateBugReport", () => { diff --git a/src/features/HelpCompletion.ts b/src/features/HelpCompletion.ts index 5dcfb3bcd8..97255bfc67 100644 --- a/src/features/HelpCompletion.ts +++ b/src/features/HelpCompletion.ts @@ -127,7 +127,6 @@ class TriggerFinder { class HelpCompletionProvider { private triggerFinderHelpComment: TriggerFinder; - private lastChangeText: string; private lastChangeRange: Range; private lastDocument: TextDocument; private langClient: LanguageClient; @@ -148,7 +147,6 @@ class HelpCompletionProvider { public updateState(document: TextDocument, changeText: string, changeRange: Range): void { this.lastDocument = document; - this.lastChangeText = changeText; this.lastChangeRange = changeRange; this.triggerFinderHelpComment.updateState(document, changeText); } diff --git a/src/main.ts b/src/main.ts index f5c25465c8..a51407300e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,10 +40,6 @@ import utils = require("./utils"); // tslint:disable-next-line: no-var-requires const PackageJSON: any = require("../../package.json"); -// NOTE: We will need to find a better way to deal with the required -// PS Editor Services version... -const requiredEditorServicesVersion = "2.0.0"; - // the application insights key (also known as instrumentation key) used for telemetry. const AI_KEY: string = "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217"; @@ -132,7 +128,6 @@ export function activate(context: vscode.ExtensionContext): void { sessionManager = new SessionManager( - requiredEditorServicesVersion, logger, documentSelector, PackageJSON.displayName, diff --git a/src/session.ts b/src/session.ts index a65484ecc1..024f52e10d 100644 --- a/src/session.ts +++ b/src/session.ts @@ -54,7 +54,6 @@ export class SessionManager implements Middleware { private sessionSettings: Settings.ISettings = undefined; private sessionDetails: utils.IEditorServicesSessionDetails; private bundledModulesPath: string; - private telemetryReporter: TelemetryReporter; // Initialized by the start() method, since this requires settings private powershellExeFinder: PowerShellExeFinder; @@ -66,18 +65,16 @@ export class SessionManager implements Middleware { vscode.env.sessionId === "someValue.sessionId"; constructor( - private requiredEditorServicesVersion: string, private log: Logger, private documentSelector: DocumentSelector, - private hostName: string, - private version: string, - private reporter: TelemetryReporter) { + hostName: string, + version: string, + private telemetryReporter: TelemetryReporter) { this.platformDetails = getPlatformDetails(); this.HostName = hostName; this.HostVersion = version; - this.telemetryReporter = reporter; const osBitness = this.platformDetails.isOS64Bit ? "64-bit" : "32-bit"; const procBitness = this.platformDetails.isProcess64Bit ? "64-bit" : "32-bit"; diff --git a/tools/postReleaseScripts/updateExtensionVersions.ps1 b/tools/postReleaseScripts/updateExtensionVersions.ps1 index 974a6e43f7..0d8d376046 100644 --- a/tools/postReleaseScripts/updateExtensionVersions.ps1 +++ b/tools/postReleaseScripts/updateExtensionVersions.ps1 @@ -116,23 +116,6 @@ function FindPackageJsonVersionSpan throw 'Did not find package.json version field' } -function FindRequiredPsesVersionSpan -{ - param( - [Parameter(Mandatory)] - [string] - $MainTsContent - ) - - $pattern = [regex]'const\s+requiredEditorServicesVersion\s+=\s+"(.*)"' - $versionGroup = $pattern.Match($MainTsContent).Groups[1] - - return @{ - Start = $versionGroup.Index - End = $versionGroup.Index + $versionGroup.Length - } -} - function FindVstsBuildVersionSpan { param( @@ -150,27 +133,6 @@ function FindVstsBuildVersionSpan } } -function UpdateMainTsPsesVersion -{ - param( - [Parameter(Mandatory)] - [string] - $MainTsPath, - - [Parameter(Mandatory)] - [version] - $Version - ) - - $mainTsContent = Get-Content -Raw $MainTsPath - $mainTsVersionSpan = FindRequiredPsesVersionSpan $mainTsContent - $newMainTsContent = New-StringWithSegment -String $mainTsContent -NewSegment $Version -StartIndex $mainTsVersionSpan.Start -EndIndex $mainTsVersionSpan.End - if ($newMainTsContent -ne $mainTsContent) - { - Set-Content -Path $MainTsPath -Value $newMainTsContent -Encoding utf8NoBOM -NoNewline - } -} - function UpdateDockerFileVersion { param( @@ -247,16 +209,12 @@ if (-not $PRDescription) } # Get the marketplace/non-semver versions for various files -$psesVersion = Get-VersionFromSemVer -SemVer $NewVersion $marketPlaceVersion = GetMarketplaceVersionFromSemVer -SemVer $NewVersion # Finally create the new package.json file $newPkgJsonContent = New-StringWithSegment -String $packageJson -NewSegment $NewVersion -StartIndex $pkgJsonVersionOffsetSpan.Start -EndIndex $pkgJsonVersionOffsetSpan.End Set-Content -Path $paths.packageJson -Value $newPkgJsonContent -Encoding utf8NoBOM -NoNewline -# Create the new content for the main.ts required version file -UpdateMainTsPsesVersion -MainTsPath $paths.mainTs -Version $psesVersion - # Create the new content for the VSTS dockerfile UpdateDockerFileVersion -DockerFilePath $paths.vstsDockerFile -Version $marketPlaceVersion