Skip to content

Commit 2c67751

Browse files
authored
Change to use double quote (#118)
1 parent 4f0062a commit 2c67751

File tree

10 files changed

+57
-56
lines changed

10 files changed

+57
-56
lines changed

src/commands/handler.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,36 @@ import { sendInfo } from "vscode-extension-telemetry-wrapper";
88
import { getReleaseNotesEntries, findLatestReleaseNotes } from "../utils";
99

1010
export async function createMavenProjectCmdHanlder(context: vscode.ExtensionContext) {
11-
if (!await validateAndRecommendExtension('vscjava.vscode-maven', 'Maven extension is recommended to help create Java projects and work with custom goals.', true)) {
11+
if (!await validateAndRecommendExtension("vscjava.vscode-maven", "Maven extension is recommended to help create Java projects and work with custom goals.", true)) {
1212
return;
1313
}
1414

15-
await vscode.commands.executeCommand('maven.archetype.generate');
15+
await vscode.commands.executeCommand("maven.archetype.generate");
1616
}
1717

1818
// TODO: add entry to create standalone Java file
1919

2020
export async function createSpringBootProjectCmdHandler(context: vscode.ExtensionContext) {
21-
if (!await validateAndRecommendExtension('vscjava.vscode-spring-initializr', 'Spring Initializr extension is recommended to help create Spring Boot projects and manage dependencies.', true)) {
21+
if (!await validateAndRecommendExtension("vscjava.vscode-spring-initializr", "Spring Initializr extension is recommended to help create Spring Boot projects and manage dependencies.", true)) {
2222
return;
2323
}
2424

25-
await vscode.commands.executeCommand('spring.initializr.createProject');
25+
await vscode.commands.executeCommand("spring.initializr.createProject");
2626
}
2727

2828
export async function showExtensionCmdHandler(context: vscode.ExtensionContext, operationId: string, extensionName: string) {
2929
sendInfo(operationId, { extName: extensionName });
30-
vscode.commands.executeCommand('extension.open', extensionName);
30+
vscode.commands.executeCommand("extension.open", extensionName);
3131
}
3232

3333
export async function openUrlCmdHandler(context: vscode.ExtensionContext, operationId: string, url: string) {
3434
sendInfo(operationId, { url: url });
35-
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(url));
35+
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(url));
3636
}
3737

3838
export async function showReleaseNotes(context: vscode.ExtensionContext, operationId: string, version: string) {
3939
let path = context.asAbsolutePath(`release-notes/v${version}.md`);
40-
vscode.commands.executeCommand('markdown.showPreview', vscode.Uri.file(path), null, {
40+
vscode.commands.executeCommand("markdown.showPreview", vscode.Uri.file(path), null, {
4141
sideBySide: false,
4242
locked: true
4343
});

src/commands/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
import * as vscode from "vscode";
55

6-
import { instrumentCommand } from '../utils';
6+
import { instrumentCommand } from "../utils";
77
import { createMavenProjectCmdHanlder, createSpringBootProjectCmdHandler, showExtensionCmdHandler, openUrlCmdHandler, showLatestReleaseNotesHandler } from "./handler";
88
import { overviewCmdHandler } from "../overview";
99

1010
export function initialize(context: vscode.ExtensionContext) {
11-
context.subscriptions.push(vscode.commands.registerCommand('java.overview', instrumentCommand(context, 'java.overview', instrumentCommand(context, 'java.helper.overview', overviewCmdHandler))));
12-
context.subscriptions.push(vscode.commands.registerCommand('java.helper.createMavenProject', instrumentCommand(context, 'java.helper.createMavenProject', createMavenProjectCmdHanlder)));
13-
context.subscriptions.push(vscode.commands.registerCommand('java.helper.createSpringBootProject', instrumentCommand(context, 'java.helper.createSpringBootProject', createSpringBootProjectCmdHandler)));
14-
context.subscriptions.push(vscode.commands.registerCommand('java.helper.showExtension', instrumentCommand(context, 'java.helper.showExtension', showExtensionCmdHandler)));
15-
context.subscriptions.push(vscode.commands.registerCommand('java.helper.openUrl', instrumentCommand(context, 'java.helper.openUrl', openUrlCmdHandler)));
16-
context.subscriptions.push(vscode.commands.registerCommand('java.showLatestReleaseNotes', instrumentCommand(context, 'java.showLatestReleaseNotes', showLatestReleaseNotesHandler)));
11+
context.subscriptions.push(vscode.commands.registerCommand("java.overview", instrumentCommand(context, "java.overview", instrumentCommand(context, "java.helper.overview", overviewCmdHandler))));
12+
context.subscriptions.push(vscode.commands.registerCommand("java.helper.createMavenProject", instrumentCommand(context, "java.helper.createMavenProject", createMavenProjectCmdHanlder)));
13+
context.subscriptions.push(vscode.commands.registerCommand("java.helper.createSpringBootProject", instrumentCommand(context, "java.helper.createSpringBootProject", createSpringBootProjectCmdHandler)));
14+
context.subscriptions.push(vscode.commands.registerCommand("java.helper.showExtension", instrumentCommand(context, "java.helper.showExtension", showExtensionCmdHandler)));
15+
context.subscriptions.push(vscode.commands.registerCommand("java.helper.openUrl", instrumentCommand(context, "java.helper.openUrl", openUrlCmdHandler)));
16+
context.subscriptions.push(vscode.commands.registerCommand("java.showLatestReleaseNotes", instrumentCommand(context, "java.showLatestReleaseNotes", showLatestReleaseNotesHandler)));
1717
}

src/extension.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
import * as vscode from 'vscode';
5-
import { dispose as disposeTelemetryWrapper, initialize, instrumentOperation } from 'vscode-extension-telemetry-wrapper';
4+
import * as vscode from "vscode";
5+
import { dispose as disposeTelemetryWrapper, initialize, instrumentOperation } from "vscode-extension-telemetry-wrapper";
66

77
import { initialize as initUtils } from "./utils";
88
import { initialize as initCommands } from "./commands";
99
import { initialize as initRecommendations } from "./recommendation";
1010
import { initialize as initMisc, showReleaseNotesOnStart } from "./misc";
11-
import { showOverviewPageOnActivation, OverviewViewSerializer } from './overview';
11+
import { showOverviewPageOnActivation, OverviewViewSerializer } from "./overview";
1212
import { validateJavaRuntime } from "./java-runtime";
1313

1414
export async function activate(context: vscode.ExtensionContext) {
1515
initializeTelemetry(context);
16-
await instrumentOperation('activation', initializeExtension)(context);
16+
await instrumentOperation("activation", initializeExtension)(context);
1717
}
1818

1919
async function initializeExtension(operationId: string, context: vscode.ExtensionContext) {
@@ -22,7 +22,7 @@ async function initializeExtension(operationId: string, context: vscode.Extensio
2222
initRecommendations(context);
2323
initMisc(context);
2424

25-
context.subscriptions.push(vscode.window.registerWebviewPanelSerializer('java.overview', new OverviewViewSerializer()));
25+
context.subscriptions.push(vscode.window.registerWebviewPanelSerializer("java.overview", new OverviewViewSerializer()));
2626

2727
await showOverviewPageOnActivation(context);
2828
await showReleaseNotesOnStart(context);
@@ -33,7 +33,7 @@ async function initializeExtension(operationId: string, context: vscode.Extensio
3333
}
3434

3535
function initializeTelemetry(context: vscode.ExtensionContext) {
36-
const ext = vscode.extensions.getExtension('vscjava.vscode-java-pack');
36+
const ext = vscode.extensions.getExtension("vscjava.vscode-java-pack");
3737
const packageInfo = ext ? ext.packageJSON : undefined;
3838
if (packageInfo) {
3939
if (packageInfo.aiKey) {

src/misc/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function showInfoButton() {
1313
}
1414

1515
type ReleaseNotesPresentationHistoryEntry = { version: string, timeStamp: string };
16-
const RELEASE_NOTE_PRESENTATION_HISTORY = 'releaseNotesPresentationHistory';
16+
const RELEASE_NOTE_PRESENTATION_HISTORY = "releaseNotesPresentationHistory";
1717

1818
export async function showReleaseNotesOnStart(context: vscode.ExtensionContext) {
1919
const entries = await getReleaseNotesEntries(context);
@@ -24,7 +24,7 @@ export async function showReleaseNotesOnStart(context: vscode.ExtensionContext)
2424
return;
2525
}
2626

27-
await vscode.commands.executeCommand('java.showLatestReleaseNotes');
27+
await vscode.commands.executeCommand("java.showLatestReleaseNotes");
2828

2929
history.push({
3030
version: latest.version,

src/overview/assets/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
// Licensed under the MIT license.
33

44
import * as $ from "jquery";
5-
import './index.scss';
5+
import "./index.scss";
66

7-
window.addEventListener('message', event => {
8-
if (event.data.command === 'hideInstalledExtensions') {
7+
window.addEventListener("message", event => {
8+
if (event.data.command === "hideInstalledExtensions") {
99
hideInstalledExtensions(event.data.installedExtensions);
1010
hideEmptySections();
11-
} else if (event.data.command === 'setOverviewVisibility') {
12-
$('#showWhenUsingJava').prop('checked', event.data.visibility);
13-
} else if (event.data.command === 'showJavaRuntimePanel') {
14-
$('#javaRuntimePanel').removeClass('d-none');
11+
} else if (event.data.command === "setOverviewVisibility") {
12+
$("#showWhenUsingJava").prop("checked", event.data.visibility);
13+
} else if (event.data.command === "showJavaRuntimePanel") {
14+
$("#javaRuntimePanel").removeClass("d-none");
1515
}
1616
});
1717

1818
function hideInstalledExtensions(extensions: any) {
19-
$('div[ext]').each((index, elem) => {
19+
$("div[ext]").each((index, elem) => {
2020
const anchor = $(elem);
21-
const ext = (anchor.attr('ext') || '').toLowerCase();
21+
const ext = (anchor.attr("ext") || "").toLowerCase();
2222
if (extensions.indexOf(ext) !== -1) {
2323
anchor.hide();
2424
}
2525
});
2626
}
2727

2828
function hideEmptySections() {
29-
$('div h3').parent().each((i, div) => {
30-
if (!$(div).children('h3 ~ div').is(':visible')) {
29+
$("div h3").parent().each((i, div) => {
30+
if (!$(div).children("h3 ~ div").is(":visible")) {
3131
$(div).hide();
3232
}
3333
});
@@ -36,9 +36,9 @@ function hideEmptySections() {
3636
declare function acquireVsCodeApi(): any;
3737
const vscode = acquireVsCodeApi();
3838

39-
$('#showWhenUsingJava').change(function () {
39+
$("#showWhenUsingJava").change(function () {
4040
vscode.postMessage({
41-
command: 'setOverviewVisibility',
42-
visibility: $(this).is(':checked')
41+
command: "setOverviewVisibility",
42+
visibility: $(this).is(":checked")
4343
});
4444
});

src/overview/index.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
import * as vscode from 'vscode';
4+
import * as vscode from "vscode";
55

6-
import { readFile as fsReadFile } from 'fs';
7-
import * as util from 'util';
8-
import * as path from 'path';
6+
import { readFile as fsReadFile } from "fs";
7+
import * as util from "util";
8+
import * as path from "path";
99

1010
const readFile = util.promisify(fsReadFile);
1111

1212
import { instrumentOperation, sendInfo } from "vscode-extension-telemetry-wrapper";
1313
import { getExtensionContext } from "../utils";
14-
import { validateJavaRuntime } from '../java-runtime';
14+
import { validateJavaRuntime } from "../java-runtime";
1515

1616
let overviewView: vscode.WebviewPanel | undefined;
17-
const KEY_SHOW_WHEN_USING_JAVA = 'showWhenUsingJava';
17+
const KEY_SHOW_WHEN_USING_JAVA = "showWhenUsingJava";
1818
const KEY_OVERVIEW_LAST_SHOW_TIME = "overviewLastShowTime";
1919

2020
const toggleOverviewVisibilityOperation = instrumentOperation("toggleOverviewVisibility", (operationId: string, context: vscode.ExtensionContext, visibility: boolean) => {
@@ -32,8 +32,8 @@ export async function overviewCmdHandler(context: vscode.ExtensionContext, opera
3232
}
3333

3434
overviewView = vscode.window.createWebviewPanel(
35-
'java.overview',
36-
'Java Overview',
35+
"java.overview",
36+
"Java Overview",
3737
{
3838
viewColumn: vscode.ViewColumn.One,
3939
preserveFocus: showInBackground
@@ -55,37 +55,37 @@ function onDidDisposeWebviewPanel() {
5555
}
5656

5757
async function initializeOverviewView(context: vscode.ExtensionContext, webviewPanel: vscode.WebviewPanel, onDisposeCallback: () => void) {
58-
webviewPanel.iconPath = vscode.Uri.file(path.join(context.extensionPath, 'logo.lowres.png'));
58+
webviewPanel.iconPath = vscode.Uri.file(path.join(context.extensionPath, "logo.lowres.png"));
5959
webviewPanel.webview.html = await loadHtmlContent(context);
6060

6161
context.subscriptions.push(webviewPanel.onDidDispose(onDisposeCallback));
6262

6363
const installedExtensions = vscode.extensions.all.map(ext => ext.id.toLowerCase());
6464
webviewPanel.webview.postMessage({
65-
command: 'hideInstalledExtensions',
65+
command: "hideInstalledExtensions",
6666
installedExtensions: installedExtensions
6767
});
6868

6969
webviewPanel.webview.postMessage({
70-
command: 'setOverviewVisibility',
70+
command: "setOverviewVisibility",
7171
visibility: context.globalState.get(KEY_SHOW_WHEN_USING_JAVA)
7272
});
7373

7474
context.subscriptions.push(webviewPanel.webview.onDidReceiveMessage((e) => {
75-
if (e.command === 'setOverviewVisibility') {
75+
if (e.command === "setOverviewVisibility") {
7676
toggleOverviewVisibilityOperation(context, e.visibility);
7777
}
7878
}));
7979

8080
if (!await validateJavaRuntime()) {
8181
webviewPanel.webview.postMessage({
82-
command: 'showJavaRuntimePanel'
82+
command: "showJavaRuntimePanel"
8383
});
8484
}
8585
}
8686

8787
async function loadHtmlContent(context: vscode.ExtensionContext) {
88-
let buffer = await readFile(context.asAbsolutePath('./out/assets/overview/index.html'));
88+
let buffer = await readFile(context.asAbsolutePath("./out/assets/overview/index.html"));
8989
return buffer.toString();
9090
}
9191

@@ -98,7 +98,7 @@ export async function showOverviewPageOnActivation(context: vscode.ExtensionCont
9898
if (showWhenUsingJava) {
9999
let overviewLastShowTime = context.globalState.get(KEY_OVERVIEW_LAST_SHOW_TIME);
100100
let showInBackground = overviewLastShowTime !== undefined;
101-
vscode.commands.executeCommand('java.overview', showInBackground);
101+
vscode.commands.executeCommand("java.overview", showInBackground);
102102
}
103103
}
104104

src/utils/command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
import * as vscode from 'vscode';
5-
import { instrumentOperation } from 'vscode-extension-telemetry-wrapper';
4+
import * as vscode from "vscode";
5+
import { instrumentOperation } from "vscode-extension-telemetry-wrapper";
66

77
export type CommandHandler = (context: vscode.ExtensionContext, operationId: string, ...args: any[]) => any;
88

src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function recommendExtension(extName: string, message: string): Prom
2121
const action = "Details";
2222
const answer = await vscode.window.showInformationMessage(message, action);
2323
if (answer === action) {
24-
await vscode.commands.executeCommand('java.helper.showExtension', extName);
24+
await vscode.commands.executeCommand("java.helper.showExtension", extName);
2525
}
2626
}
2727

src/utils/release-notes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { sendError } from "vscode-extension-telemetry-wrapper";
99
type ReleaseNotesEntry = { fileName: string, version: string };
1010

1111
export async function getReleaseNotesEntries(context: vscode.ExtensionContext): Promise<ReleaseNotesEntry[]> {
12-
const dir = context.asAbsolutePath('release-notes');
12+
const dir = context.asAbsolutePath("release-notes");
1313
const regex = /v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*))\.md/g;
1414

1515
return new Promise<ReleaseNotesEntry[]>((resolve, reject) => {

tslint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
true,
1010
"always"
1111
],
12-
"triple-equals": true
12+
"triple-equals": true,
13+
"quotemark": true
1314
},
1415
"defaultSeverity": "warning"
1516
}

0 commit comments

Comments
 (0)