Skip to content
Open
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1914,12 +1914,12 @@
"group": "1_javaactions"
},
{
"when": "explorerResourceIsFolder&&javaLSReady",
"when": "explorerResourceIsFolder&&javaLSReady&&resourcePath in java.projects",
"command": "java.project.addToSourcePath.command",
"group": "1_javaactions@1"
},
{
"when": "explorerResourceIsFolder&&javaLSReady",
"when": "explorerResourceIsFolder&&javaLSReady&&resourcePath in java.projects",
"command": "java.project.removeFromSourcePath.command",
"group": "1_javaactions@2"
}
Expand Down
9 changes: 8 additions & 1 deletion src/standardLanguageClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class StandardLanguageClient {

public registerLanguageClientActions(context: ExtensionContext, hasImported: boolean, jdtEventEmitter: EventEmitter<Uri>) {
activationProgressNotification.showProgress();
this.languageClient.onNotification(StatusNotification.type, (report) => {
this.languageClient.onNotification(StatusNotification.type, async (report) => {
// Resolve serverRunning on the first status notification from the server,
// indicating the server process is alive and can accept requests.
apiManager.resolveServerRunningPromise();
Expand Down Expand Up @@ -152,6 +152,13 @@ export class StandardLanguageClient {
// Disable the client-side snippet provider since LS is ready.
snippetCompletionProvider.dispose();
registerDocumentValidationListener(context, this.languageClient);
try {
const projectUris = await getAllJavaProjects();
const projectPaths = projectUris.map((uriString) => Uri.parse(uriString).fsPath.replace(/[\\/]$/, ''));
await commands.executeCommand('setContext', 'java.projects', projectPaths);
} catch (error) {
logger.error(error);
}
commands.executeCommand('setContext', 'javaLSReady', true);
break;
case 'Started':
Expand Down
Loading