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
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const server_dir = '../java-debug';

gulp.task("tslint", () => {
return gulp.src(["**/*.ts", "!**/*.d.ts", "!node_modules/**", "!./src/views/node_modules/**"])
.pipe(tslint())
.pipe(tslint({formatter: "verbose"}))
.pipe(tslint.report());
});

Expand Down
4,558 changes: 1,306 additions & 3,252 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -526,24 +526,24 @@
"test": "npm run compile && node ./out/test/index.js"
},
"devDependencies": {
"@types/lodash": "^4.14.116",
"@types/mocha": "^5.2.5",
"@types/node": "^8.10.22",
"@types/vscode": "^1.32.0",
"@types/lodash": "^4.14.137",
"@types/mocha": "^5.2.7",
"@types/node": "^8.10.51",
"@types/vscode": "1.32.0",
"cross-env": "^5.2.0",
"gulp": "^4.0.0",
"gulp-tslint": "^8.1.2",
"gulp": "^4.0.2",
"gulp-tslint": "^8.1.4",
"mocha": "^5.2.0",
"shelljs": "^0.8.2",
"ts-loader": "^5.3.3",
"tslint": "^5.7.0",
"typescript": "^3.0.1",
"vscode-test": "^1.0.2",
"webpack": "^4.29.3",
"webpack-cli": "^3.2.3"
"shelljs": "^0.8.3",
"ts-loader": "^5.4.5",
"tslint": "^5.18.0",
"typescript": "^3.5.3",
"vscode-test": "^1.2.0",
"webpack": "^4.39.2",
"webpack-cli": "^3.3.7"
},
"dependencies": {
"lodash": "^4.17.13",
"lodash": "^4.17.15",
"vscode-extension-telemetry": "0.1.1",
"vscode-extension-telemetry-wrapper": "0.4.0"
}
Expand Down
11 changes: 7 additions & 4 deletions src/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
return config;
} else {
// Information for diagnostic:
// tslint:disable-next-line:no-console
console.log("Cannot find a port for debugging session");
throw new Error("Failed to start debug server.");
}
Expand Down Expand Up @@ -302,21 +303,21 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
if (mainEntries.length === 1) {
return mainEntries[0];
} else if (mainEntries.length > 1) {
return await this.showMainClassQuickPick(this.formatMainClassOptions(mainEntries),
return this.showMainClassQuickPick(this.formatMainClassOptions(mainEntries),
`Multiple main classes found in the file '${path.basename(currentFile)}', please select one first.`);
}
}

const hintMessage = currentFile ?
`No main class found in the file '${path.basename(currentFile)}', please select main class<project name> again.` :
"Please select main class<project name>.";
return await this.promptMainClass(folder, hintMessage);
return this.promptMainClass(folder, hintMessage);
}

const containsExternalClasspaths = !_.isEmpty(config.classPaths) || !_.isEmpty(config.modulePaths);
const validationResponse = await lsPlugin.validateLaunchConfig(folder, config.mainClass, config.projectName, containsExternalClasspaths);
if (!validationResponse.mainClass.isValid || !validationResponse.projectName.isValid) {
return await this.fixMainClass(folder, config, validationResponse);
return this.fixMainClass(folder, config, validationResponse);
}

return {
Expand Down Expand Up @@ -504,11 +505,13 @@ async function updateDebugSettings() {
const javaHome = await utility.getJavaHome();
if (debugSettingsRoot.settings && Object.keys(debugSettingsRoot.settings).length) {
try {
// tslint:disable-next-line:no-console
console.log("settings:", await commands.executeJavaLanguageServerCommand(commands.JAVA_UPDATE_DEBUG_SETTINGS, JSON.stringify(
{ ...debugSettingsRoot.settings, logLevel, javaHome })));
} catch (err) {
// log a warning message and continue, since update settings failure should not block debug session
console.log("Cannot update debug settings.", err)
// tslint:disable-next-line:no-console
console.log("Cannot update debug settings.", err);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/debugCodeLensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DebugCodeLensContainer implements vscode.Disposable {
this.runCommand = instrumentOperationAsVsCodeCommand(JAVA_RUN_CODELENS_COMMAND, runJavaProgram);
this.debugCommand = instrumentOperationAsVsCodeCommand(JAVA_DEBUG_CODELENS_COMMAND, debugJavaProgram);

const configuration = vscode.workspace.getConfiguration(JAVA_DEBUG_CONFIGURATION)
const configuration = vscode.workspace.getConfiguration(JAVA_DEBUG_CONFIGURATION);
const isCodeLensEnabled = configuration.get<boolean>(ENABLE_CODE_LENS_VARIABLE);

if (isCodeLensEnabled) {
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { dispose as disposeTelemetryWrapper, initializeFromJsonFile, instrumentO
import * as commands from "./commands";
import { JavaDebugConfigurationProvider } from "./configurationProvider";
import { HCR_EVENT, JAVA_LANGID, USER_NOTIFICATION_EVENT } from "./constants";
import { initializeCodeLensProvider, startDebugging } from "./debugCodeLensProvider"
import { initializeCodeLensProvider, startDebugging } from "./debugCodeLensProvider";
import { handleHotCodeReplaceCustomEvent, initializeHotCodeReplace } from "./hotCodeReplace";
import { IMainMethod, resolveMainMethod } from "./languageServerPlugin";
import { logger, Type } from "./logger";
Expand Down Expand Up @@ -135,7 +135,7 @@ async function applyHCR() {
await autobuildConfig.update("enabled", true);
// Force an incremental build to avoid auto build is not finishing during HCR.
try {
await commands.executeJavaExtensionCommand(commands.JAVA_BUILD_WORKSPACE, false)
await commands.executeJavaExtensionCommand(commands.JAVA_BUILD_WORKSPACE, false);
} catch (err) {
// do nothing.
}
Expand Down
2 changes: 1 addition & 1 deletion src/languageServerPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ export async function detectPreviewFlag(className: string, projectName: string):
const expectedOptions = {
[COMPILER_PB_ENABLE_PREVIEW_FEATURES]: "enabled",
};
return await checkProjectSettings(className, projectName, true, expectedOptions);
return checkProjectSettings(className, projectName, true, expectedOptions);
}
6 changes: 3 additions & 3 deletions src/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ function logMessage(message: ILoggingMessage): void {

export async function showInformationMessage(message: ILoggingMessage, ...items: string[]): Promise<string | undefined> {
logMessage(message);
return await vscode.window.showInformationMessage(message.message, ...items);
return vscode.window.showInformationMessage(message.message, ...items);
}

export async function showWarningMessage(message: ILoggingMessage, ...items: string[]): Promise<string | undefined> {
logMessage(message);
return await vscode.window.showWarningMessage(message.message, ...items);
return vscode.window.showWarningMessage(message.message, ...items);
}

export async function showErrorMessage(message: ILoggingMessage, ...items: string[]): Promise<string | undefined> {
logMessage(message);
return await vscode.window.showErrorMessage(message.message, ...items);
return vscode.window.showErrorMessage(message.message, ...items);
}

export async function showInformationMessageWithTroubleshooting(message: ITroubleshootingMessage, ...items: string[]): Promise<string | undefined> {
Expand Down
1 change: 0 additions & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ async function main(): Promise<void> {
// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error("Failed to run tests");
process.exit(1);
}
}
Expand Down
19 changes: 11 additions & 8 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
],
"no-unused-expression": true,
"no-duplicate-variable": true,
"max-classes-per-file": [
false
"max-classes-per-file": false,
"no-implicit-dependencies": [
false, // Turned off due to: https://github.com/microsoft/vscode/issues/78019
"dev"
],
"no-implicit-dependencies": [true, "dev"],
"no-empty": false,
"object-literal-sort-keys": false,
"curly": true,
Expand All @@ -24,15 +25,17 @@
"check-separator",
"check-type"
],
"semicolon": [
"always"
],
"semicolon": true,
"triple-equals": true,
"max-line-length": [
true,
150
],
],
"no-angle-bracket-type-assertion": false,
"no-console": ["log","error"]
"no-console": [
true,
"log",
"error"
]
}
}