8000 adopt new createStatusBarItem API for id and name properties by testforstephen · Pull Request #1054 · microsoft/vscode-java-debug · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"debugger"
],
"engines": {
"vscode": "^1.55.0"
"vscode": "^1.57.0"
},
"license": "SEE LICENSE IN LICENSE.txt",
"repository": {
Expand Down Expand Up @@ -946,7 +946,7 @@
"@types/mocha": "^5.2.7",
"@types/node": "^14.14.10",
"@types/uuid": "^8.3.0",
"@types/vscode": "1.55.0",
"@types/vscode": "1.57.0",
"cross-env": "^5.2.0",
"gulp": "^4.0.2",
"gulp-tslint": "^8.1.4",
Expand Down
9 changes: 2 additions & 7 deletions src/JavaInlineValueProvider.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import * as compareVersions from "compare-versions";
import { debug, InlineValue, InlineValueContext, InlineValueEvaluatableExpression, InlineValuesProvider, InlineValueText, InlineValueVariableLookup,
Range, TextDocument, version } from "vscode";
Range, TextDocument } from "vscode";
import { instrumentOperation, instrumentOperationStep, sendInfo } from "vscode-extension-telemetry-wrapper";
import * as CodeConverter from "vscode-languageclient/lib/codeConverter";
import * as ProtocolConverter from "vscode-languageclient/lib/protocolConverter";
import { InlineKind, InlineVariable, resolveInlineVariables } from "./languageServerPlugin";

// In VS Code 1.55.0, viewport doesn't change while scrolling the editor and it's fixed in 1.56.0.
// So dynamically enable viewport support based on the user's VS Code version.
const isViewPortSupported = compareVersions(version.replace(/-insider$/i, ""), "1.56.0") >= 0;

const protoConverter: ProtocolConverter.Converter = ProtocolConverter.createConverter();
const codeConverter: CodeConverter.Converter = CodeConverter.createConverter();

Expand All @@ -23,7 +18,7 @@ export class JavaInlineValuesProvider implements InlineValuesProvider {
const resolveInlineVariablesStep = instrumentOperationStep(operationId, "resolveInlineVariables", async () => {
return <InlineVariable[]> (await resolveInlineVariables({
uri: document.uri.toString(),
viewPort: isViewPortSupported ? codeConverter.asRange(viewPort) : undefined,
viewPort: codeConverter.asRange(viewPort),
stoppedLocation: codeConverter.asRange(context.stoppedLocation),
}));
});
Expand Down
5 changes: 3 additions & 2 deletions src/customWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ export class NotificationBar implements vscode.Disposable {
private statusBar: vscode.StatusBarItem;
private lastUpdateTime: number;

constructor() {
this.statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.POSITIVE_INFINITY);
constructor(id: string, name: string) {
this.statusBar = vscode.window.createStatusBarItem(id, vscode.StatusBarAlignment.Left, Number.POSITIVE_INFINITY);
this.statusBar.name = name;
}

public show(text: string, duration?: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function initializeExtension(_operationId: string, context: vscode.ExtensionCont
// tslint:disable-next-line
return javaProcess ? String(javaProcess.pid) : "${command:PickJavaProcess}";
}));
const hcrStatusBar: NotificationBar = new NotificationBar();
const hcrStatusBar: NotificationBar = new NotificationBar("java.hcrStatusBar", "Java HotCodeReplace");
context.subscriptions.push(hcrStatusBar);
context.subscriptions.push(instrumentOperationAsVsCodeCommand("java.debug.hotCodeReplace", async () => {
await applyHCR(hcrStatusBar);
Expand Down
3 changes: 2 additions & 1 deletion src/progressImpl.ts
6E45
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class ProgressReporter implements IProgressReporter {
}

if (this._progressLocation === ProgressLocation.Window) {
this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 1);
this._statusBarItem = window.createStatusBarItem(this._id, StatusBarAlignment.Left, 1);
this._statusBarItem.name = "Progress Message for " + this._jobName;
this._statusBarItem.text = `$(sync~spin) ${this._jobName}...`;
this._statusBarItem.command = {
title: "Check Java Build Status",
Expand Down
0