Skip to content

Commit 279fc29

Browse files
authored
Define messages for formatter setting editor (#626)
* enhancement and define messages
1 parent 5ff315e commit 279fc29

11 files changed

Lines changed: 461 additions & 308 deletions

File tree

src/commands/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { showClasspathConfigurationPage } from "../classpath/classpathConfigurat
1515
import { markdownPreviewProvider } from "../classpath/markdownPreviewProvider";
1616
import { getExpService } from "../exp";
1717
import { TreatmentVariables } from "../exp/TreatmentVariables";
18-
import { JavaFormatterSettingsEditorProvider } from "../formatter-settings";
18+
import { javaFormatterSettingsEditorProvider } from "../formatter-settings";
1919

2020
export function initialize(context: vscode.ExtensionContext) {
2121
context.subscriptions.push(vscode.commands.registerCommand("java.overview", instrumentCommand(context, "java.overview", instrumentCommand(context, "java.helper.overview", overviewCmdHandler))));
@@ -32,9 +32,6 @@ export function initialize(context: vscode.ExtensionContext) {
3232
context.subscriptions.push(vscode.commands.registerCommand("java.extGuide", instrumentCommand(context, "java.extGuide", javaExtGuideCmdHandler)));
3333
context.subscriptions.push(instrumentOperationAsVsCodeCommand("java.webview.runCommand", webviewCmdLinkHandler));
3434
context.subscriptions.push(vscode.commands.registerCommand("java.welcome", instrumentCommand(context, "java.welcome", showWelcomeWebview)));
35-
const javaFormatterSettingsEditorProvider: JavaFormatterSettingsEditorProvider = new JavaFormatterSettingsEditorProvider(context);
36-
const editorOptions = { webviewOptions: {enableFindWidget: true, retainContextWhenHidden: true}, supportsMultipleEditorsPerDocument: false };
37-
context.subscriptions.push(vscode.window.registerCustomEditorProvider(JavaFormatterSettingsEditorProvider.viewType, javaFormatterSettingsEditorProvider, editorOptions));
3835
context.subscriptions.push(vscode.commands.registerCommand("java.formatterSettings", instrumentCommand(context, "java.formatterSettings", () => javaFormatterSettingsEditorProvider.showFormatterSettingsEditor())));
3936
context.subscriptions.push(vscode.commands.registerCommand("java.classpathConfiguration", instrumentCommand(context, "java.classpathConfiguration", async () => {
4037
const showCustomizedView: boolean = await getExpService()?.getTreatmentVariableAsync(TreatmentVariables.VSCodeConfig, TreatmentVariables.CustomizedClasspathConfigurationView, true /*checkCache*/) || false;

src/extension.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { JavaExtGuideViewSerializer } from "./ext-guide";
1717
import { ClassPathConfigurationViewSerializer } from "./classpath/classpathConfigurationView";
1818
import { TreatmentVariables } from "./exp/TreatmentVariables";
1919
import { MarkdownPreviewSerializer } from "./classpath/markdownPreviewProvider";
20+
import { initFormatterSettingsEditorProvider } from "./formatter-settings";
2021

2122
export async function activate(context: vscode.ExtensionContext) {
2223
syncState(context);
@@ -27,6 +28,7 @@ export async function activate(context: vscode.ExtensionContext) {
2728
}
2829

2930
async function initializeExtension(_operationId: string, context: vscode.ExtensionContext) {
31+
initFormatterSettingsEditorProvider(context);
3032
initUtils(context);
3133
initCommands(context);
3234
initRecommendations(context);

0 commit comments

Comments
 (0)