22// Licensed under the MIT license.
33
44import * as vscode from "vscode" ;
5- import * as path from "path" ;
65import { instrumentCommand , webviewCmdLinkHandler } from "../utils" ;
76import { createMavenProjectCmdHandler , createSpringBootProjectCmdHandler , createQuarkusProjectCmdHandler , createMicroProfileStarterProjectCmdHandler , showExtensionCmdHandler , openUrlCmdHandler , showReleaseNotesHandler , installExtensionCmdHandler } from "./handler" ;
87import { overviewCmdHandler } from "../overview" ;
@@ -12,9 +11,6 @@ import { javaExtGuideCmdHandler } from "../ext-guide";
1211import { instrumentOperationAsVsCodeCommand } from "vscode-extension-telemetry-wrapper" ;
1312import { showWelcomeWebview } from "../welcome" ;
1413import { showClasspathConfigurationPage } from "../classpath/classpathConfigurationView" ;
15- import { markdownPreviewProvider } from "../classpath/markdownPreviewProvider" ;
16- import { getExpService } from "../exp" ;
17- import { TreatmentVariables } from "../exp/TreatmentVariables" ;
1814import { javaFormatterSettingsEditorProvider } from "../formatter-settings" ;
1915
2016export function initialize ( context : vscode . ExtensionContext ) {
@@ -34,15 +30,5 @@ export function initialize(context: vscode.ExtensionContext) {
3430 context . subscriptions . push ( vscode . commands . registerCommand ( "java.welcome" , instrumentCommand ( context , "java.welcome" , showWelcomeWebview ) ) ) ;
3531 context . subscriptions . push ( vscode . commands . registerCommand ( "java.formatterSettings" , instrumentCommand ( context , "java.formatterSettings" , ( ) => javaFormatterSettingsEditorProvider . showFormatterSettingsEditor ( ) ) ) ) ;
3632 context . subscriptions . push ( vscode . commands . registerCommand ( "java.formatterSettings.showTextEditor" , instrumentCommand ( context , "java.formatterSettings.showTextEditor" , javaFormatterSettingsEditorProvider . reopenWithTextEditor ) ) ) ;
37- context . subscriptions . push ( vscode . commands . registerCommand ( "java.classpathConfiguration" , instrumentCommand ( context , "java.classpathConfiguration" , async ( ) => {
38- const showCustomizedView : boolean = await getExpService ( ) ?. getTreatmentVariableAsync ( TreatmentVariables . VSCodeConfig , TreatmentVariables . CustomizedClasspathConfigurationView , true /*checkCache*/ ) || false ;
39- if ( showCustomizedView ) {
40- showClasspathConfigurationPage ( context ) ;
41- } else {
42- // To filter the setting in the workspace scope, see: https://github.com/microsoft/vscode/issues/90086#issuecomment-803510704
43- await vscode . commands . executeCommand ( "workbench.action.openSettings" , "java.project.sourcePaths" ) ;
44- await vscode . commands . executeCommand ( "workbench.action.openWorkspaceSettings" ) ;
45- markdownPreviewProvider . show ( context . asAbsolutePath ( path . join ( "webview-resources" , "classpathConfiguration.md" ) ) , "Classpath Settings" , context ) ;
46- }
47- } ) ) ) ;
33+ context . subscriptions . push ( vscode . commands . registerCommand ( "java.classpathConfiguration" , instrumentCommand ( context , "java.classpathConfiguration" , showClasspathConfigurationPage ) ) ) ;
4834}
0 commit comments