Skip to content

Commit caf2135

Browse files
bergmeisterChristoph Bergmeister
and
Christoph Bergmeister
authored
Cleanup unused variables (#2686)
Co-authored-by: Christoph Bergmeister <christoph.bergmeister@bjss.com>
1 parent 46ce28f commit caf2135

File tree

5 files changed

+3
-57
lines changed

5 files changed

+3
-57
lines changed

src/features/GenerateBugReport.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright (C) Microsoft Corporation. All rights reserved.
33
*--------------------------------------------------------*/
44

5-
import cp = require("child_process");
65
import os = require("os");
76
import vscode = require("vscode");
87
import { IFeature, LanguageClient } from "../feature";
@@ -30,7 +29,6 @@ const extensions =
3029
export class GenerateBugReportFeature implements IFeature {
3130

3231
private command: vscode.Disposable;
33-
private powerShellProcess: cp.ChildProcess;
3432

3533
constructor(private sessionManager: SessionManager) {
3634
this.command = vscode.commands.registerCommand("PowerShell.GenerateBugReport", () => {

src/features/HelpCompletion.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ class TriggerFinder {
127127

128128
class HelpCompletionProvider {
129129
private triggerFinderHelpComment: TriggerFinder;
130-
private lastChangeText: string;
131130
private lastChangeRange: Range;
132131
private lastDocument: TextDocument;
133132
private langClient: LanguageClient;
@@ -148,7 +147,6 @@ class HelpCompletionProvider {
148147

149148
public updateState(document: TextDocument, changeText: string, changeRange: Range): void {
150149
this.lastDocument = document;
151-
this.lastChangeText = changeText;
152150
this.lastChangeRange = changeRange;
153151
this.triggerFinderHelpComment.updateState(document, changeText);
154152
}

src/main.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ import utils = require("./utils");
4040
// tslint:disable-next-line: no-var-requires
4141
const PackageJSON: any = require("../../package.json");
4242

43-
// NOTE: We will need to find a better way to deal with the required
44-
// PS Editor Services version...
45-
const requiredEditorServicesVersion = "2.0.0";
46-
4743
// the application insights key (also known as instrumentation key) used for telemetry.
4844
const AI_KEY: string = "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217";
4945

@@ -132,7 +128,6 @@ export function activate(context: vscode.ExtensionContext): void {
132128

133129
sessionManager =
134130
new SessionManager(
135-
requiredEditorServicesVersion,
136131
logger,
137132
documentSelector,
138133
PackageJSON.displayName,

src/session.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export class SessionManager implements Middleware {
5454
private sessionSettings: Settings.ISettings = undefined;
5555
private sessionDetails: utils.IEditorServicesSessionDetails;
5656
private bundledModulesPath: string;
57-
private telemetryReporter: TelemetryReporter;
5857

5958
// Initialized by the start() method, since this requires settings
6059
private powershellExeFinder: PowerShellExeFinder;
@@ -66,18 +65,16 @@ export class SessionManager implements Middleware {
6665
vscode.env.sessionId === "someValue.sessionId";
6766

6867
constructor(
69-
private requiredEditorServicesVersion: string,
7068
private log: Logger,
7169
private documentSelector: DocumentSelector,
72-
private hostName: string,
73-
private version: string,
74-
private reporter: TelemetryReporter) {
70+
hostName: string,
71+
version: string,
72+
private telemetryReporter: TelemetryReporter) {
7573

7674
this.platformDetails = getPlatformDetails();
7775

7876
this.HostName = hostName;
7977
this.HostVersion = version;
80-
this.telemetryReporter = reporter;
8178

8279
const osBitness = this.platformDetails.isOS64Bit ? "64-bit" : "32-bit";
8380
const procBitness = this.platformDetails.isProcess64Bit ? "64-bit" : "32-bit";

tools/postReleaseScripts/updateExtensionVersions.ps1

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,6 @@ function FindPackageJsonVersionSpan
116116
throw 'Did not find package.json version field'
117117
}
118118

119-
function FindRequiredPsesVersionSpan
120-
{
121-
param(
122-
[Parameter(Mandatory)]
123-
[string]
124-
$MainTsContent
125-
)
126-
127-
$pattern = [regex]'const\s+requiredEditorServicesVersion\s+=\s+"(.*)"'
128-
$versionGroup = $pattern.Match($MainTsContent).Groups[1]
129-
130-
return @{
131-
Start = $versionGroup.Index
132-
End = $versionGroup.Index + $versionGroup.Length
133-
}
134-
}
135-
136119
function FindVstsBuildVersionSpan
137120
{
138121
param(
@@ -150,27 +133,6 @@ function FindVstsBuildVersionSpan
150133
}
151134
}
152135

153-
function UpdateMainTsPsesVersion
154-
{
155-
param(
156-
[Parameter(Mandatory)]
157-
[string]
158-
$MainTsPath,
159-
160-
[Parameter(Mandatory)]
161-
[version]
162-
$Version
163-
)
164-
165-
$mainTsContent = Get-Content -Raw $MainTsPath
166-
$mainTsVersionSpan = FindRequiredPsesVersionSpan $mainTsContent
167-
$newMainTsContent = New-StringWithSegment -String $mainTsContent -NewSegment $Version -StartIndex $mainTsVersionSpan.Start -EndIndex $mainTsVersionSpan.End
168-
if ($newMainTsContent -ne $mainTsContent)
169-
{
170-
Set-Content -Path $MainTsPath -Value $newMainTsContent -Encoding utf8NoBOM -NoNewline
171-
}
172-
}
173-
174136
function UpdateDockerFileVersion
175137
{
176138
param(
@@ -247,16 +209,12 @@ if (-not $PRDescription)
247209
}
248210

249211
# Get the marketplace/non-semver versions for various files
250-
$psesVersion = Get-VersionFromSemVer -SemVer $NewVersion
251212
$marketPlaceVersion = GetMarketplaceVersionFromSemVer -SemVer $NewVersion
252213

253214
# Finally create the new package.json file
254215
$newPkgJsonContent = New-StringWithSegment -String $packageJson -NewSegment $NewVersion -StartIndex $pkgJsonVersionOffsetSpan.Start -EndIndex $pkgJsonVersionOffsetSpan.End
255216
Set-Content -Path $paths.packageJson -Value $newPkgJsonContent -Encoding utf8NoBOM -NoNewline
256217

257-
# Create the new content for the main.ts required version file
258-
UpdateMainTsPsesVersion -MainTsPath $paths.mainTs -Version $psesVersion
259-
260218
# Create the new content for the VSTS dockerfile
261219
UpdateDockerFileVersion -DockerFilePath $paths.vstsDockerFile -Version $marketPlaceVersion
262220

0 commit comments

Comments
 (0)