diff --git a/CHANGELOG.md b/CHANGELOG.md index 255f1b6a..745b46e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Removed - The setting `java.test.forceBuildBeforeLaunchTest` is removed, please use `java.debug.settings.forceBuildBeforeLaunch` instead. [PR#850](https://github.com/microsoft/vscode-java-test/pull/850) +- The setting `java.test.saveAllBeforeLaunchTest` is removed, now the unsaved files will always be saved before launching the tests.[PR#861](https://github.com/microsoft/vscode-java-test/pull/861) ### Fixed - [Bugs fixed](https://github.com/microsoft/vscode-java-test/issues?q=is%3Aissue+is%3Aclosed+label%3Abug+milestone%3A0.21.0) diff --git a/package.json b/package.json index c3f9d00a..57114111 100644 --- a/package.json +++ b/package.json @@ -199,12 +199,6 @@ "description": "%configuration.java.test.editor.enableShortcuts.description%", "scope": "application" }, - "java.test.saveAllBeforeLaunchTest": { - "type": "boolean", - "default": true, - "description": "%configuration.java.test.saveAllBeforeLaunchTest.description%", - "scope": "application" - }, "java.test.log.level": { "type": "string", "enum": [ diff --git a/package.nls.json b/package.nls.json index caa485ba..e93184d6 100644 --- a/package.nls.json +++ b/package.nls.json @@ -12,7 +12,6 @@ "configuration.java.test.report.showAfterExecution.description": "Specify if the test report will automatically be shown after execution", "configuration.java.test.report.position.description": "Specify where to show the test report", "configuration.java.test.editor.enableShortcuts.description": "Specify whether to show the Code Lenses in editor or not", - "configuration.java.test.saveAllBeforeLaunchTest.description": "Specify whether to save all of the dirty files before lauching the test", "configuration.java.test.log.level.description": "Specify the level of the test logs", "configuration.java.test.message.hintForDeprecatedConfig.description": "Specify whether the extension will show hint dialog when deprecated configuration file is used", "configuration.java.test.message.hintForSetingDefaultConfig.description": "Specify whether the extension will show hint to set default test configuration", diff --git a/package.nls.zh.json b/package.nls.zh.json index 2588445e..10a294a3 100644 --- a/package.nls.zh.json +++ b/package.nls.zh.json @@ -12,7 +12,6 @@ "configuration.java.test.report.showAfterExecution.description": "设定测试报告是否会在测试完成后自动显示", "configuration.java.test.report.position.description": "设定测试报告的显示位置", "configuration.java.test.editor.enableShortcuts.description": "设定是否在编辑器内显示 Code Lens 快捷方式", - "configuration.java.test.saveAllBeforeLaunchTest.description": "设定在执行测试之前是否需要保存工作空间内的所有文件", "configuration.java.test.log.level.description": "设定日志级别", "configuration.java.test.message.hintForDeprecatedConfig.description": "设定插件是否会对使用弃用的配置文件进行提示", "configuration.java.test.message.hintForSetingDefaultConfig.description": "设定插件是否会对设置默认测试配置项进行提示", diff --git a/src/constants/configs.ts b/src/constants/configs.ts index 93a5478e..d588a57c 100644 --- a/src/constants/configs.ts +++ b/src/constants/configs.ts @@ -3,8 +3,6 @@ export const LOCAL_HOST: string = '127.0.0.1'; -export const SAVE_ALL_BEFORE_LAUNCH_SETTING_KEY: string = 'java.test.saveAllBeforeLaunchTest'; - export const LOG_FILE_NAME: string = 'java_test_runner.log'; export const LOG_FILE_MAX_SIZE: number = 5 * 1024 * 1024; export const LOG_FILE_MAX_NUMBER: number = 2; diff --git a/src/runners/runnerScheduler.ts b/src/runners/runnerScheduler.ts index f82ee3fc..635c4cb6 100644 --- a/src/runners/runnerScheduler.ts +++ b/src/runners/runnerScheduler.ts @@ -13,7 +13,7 @@ import { testResultManager } from '../testResultManager'; import { testStatusBarProvider } from '../testStatusBarProvider'; import { getResolvedRunConfig } from '../utils/configUtils'; import { resolveLaunchConfigurationForRunner } from '../utils/launchUtils'; -import { getShowReportSetting, needSaveAll } from '../utils/settingUtils'; +import { getShowReportSetting } from '../utils/settingUtils'; import * as uiUtils from '../utils/uiUtils'; import { BaseRunner } from './baseRunner/BaseRunner'; import { JUnitRunner } from './junitRunner/JunitRunner'; @@ -38,8 +38,6 @@ class RunnerScheduler { this._isRunning = true; let finalResults: ITestResult[] = []; - await this.saveFilesIfNeeded(); - try { this._runnerMap = this.classifyTestsByKind(testItems); for (const [runner, tests] of this._runnerMap.entries()) { @@ -90,12 +88,6 @@ class RunnerScheduler { this._isRunning = false; } - private async saveFilesIfNeeded(): Promise { - if (needSaveAll()) { - await workspace.saveAll(); - } - } - private classifyTestsByKind(tests: ITestItem[]): Map { const testMap: Map = this.mapTestsByProjectAndKind(tests); return this.mapTestsByRunner(testMap); diff --git a/src/utils/settingUtils.ts b/src/utils/settingUtils.ts index ab459b00..157efa16 100644 --- a/src/utils/settingUtils.ts +++ b/src/utils/settingUtils.ts @@ -3,7 +3,7 @@ import * as _ from 'lodash'; import { Uri, ViewColumn, workspace, WorkspaceConfiguration, WorkspaceFolder } from 'vscode'; -import { DEFAULT_LOG_LEVEL, DEFAULT_REPORT_POSITION, DEFAULT_REPORT_SHOW, LOG_LEVEL_SETTING_KEY, REPORT_POSITION_SETTING_KEY, REPORT_SHOW_SETTING_KEY, SAVE_ALL_BEFORE_LAUNCH_SETTING_KEY } from '../constants/configs'; +import { DEFAULT_LOG_LEVEL, DEFAULT_REPORT_POSITION, DEFAULT_REPORT_SHOW, LOG_LEVEL_SETTING_KEY, REPORT_POSITION_SETTING_KEY, REPORT_SHOW_SETTING_KEY } from '../constants/configs'; import { logger } from '../logger/logger'; import { IExecutionConfig } from '../runConfigs'; @@ -13,10 +13,6 @@ export function getReportPosition(): ViewColumn { return position === DEFAULT_REPORT_POSITION ? ViewColumn.Two : ViewColumn.Active; } -export function needSaveAll(): boolean { - return workspace.getConfiguration().get(SAVE_ALL_BEFORE_LAUNCH_SETTING_KEY, true); -} - export function getLogLevel(): string { return workspace.getConfiguration().get(LOG_LEVEL_SETTING_KEY, DEFAULT_LOG_LEVEL); }