@@ -8,7 +8,7 @@ import { cleanupLombokCache } from './lombokSupport';
88import { ensureExists , getJavaConfiguration } from './utils' ;
99import { apiManager } from './apiManager' ;
1010import { isActive , setActive , smartSemicolonDetection } from './smartSemicolonDetection' ;
11- import { BuildFileSelector , PICKED_BUILD_FILES } from './buildFilesSelector' ;
11+ import { BuildFileSelector , IMPORT_METHOD , PICKED_BUILD_FILES } from './buildFilesSelector' ;
1212
1313const DEFAULT_HIDDEN_FILES : string [ ] = [ '**/.classpath' , '**/.project' , '**/.settings' , '**/.factorypath' ] ;
1414const IS_WORKSPACE_JDK_ALLOWED = "java.ls.isJdkAllowed" ;
@@ -370,6 +370,11 @@ export function handleTextDocumentChanges(document: TextDocument, changes: reado
370370export async function getImportMode ( context : ExtensionContext , selector : BuildFileSelector ) : Promise < ImportMode > {
371371 const mode = getJavaConfiguration ( ) . get < string > ( "import.projectSelection" ) ;
372372 if ( mode === "manual" ) {
373+ // use automatic mode if user has selected "Import All" before.
374+ if ( context . workspaceState . get ( IMPORT_METHOD ) === "Import All" ) {
375+ return ImportMode . automatic ;
376+ }
377+
373378 // if no selectable build files, use automatic mode
374379 const hasBuildFiles = await selector . hasBuildFiles ( ) ;
375380 if ( ! hasBuildFiles ) {
@@ -386,6 +391,7 @@ export async function getImportMode(context: ExtensionContext, selector: BuildFi
386391 { modal : true } ,
387392 "Import All" , "Let Me Select..." ) ;
388393 if ( answer === "Import All" ) {
394+ context . workspaceState . update ( IMPORT_METHOD , "Import All" ) ;
389395 return ImportMode . automatic ;
390396 } else if ( answer === "Let Me Select..." ) {
391397 return ImportMode . manual ;
0 commit comments