Skip to content

Commit

Permalink
Update Quarkus properties (from cache) when classpath changed
Browse files Browse the repository at this point in the history
Fixes #10

Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr authored and xorye committed Aug 27, 2019
1 parent a27e083 commit 157f2c3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ConfigManager } from './definitions/configManager';
import { QUARKUS_PROJECT_REQUEST, JDTLS_PROJECT_INFO_COMMAND } from './definitions/commandConstants';
import * as requirements from './languageServer/requirements';
import { prepareExecutable } from './languageServer/javaServerStarter';
import { LanguageClientOptions, LanguageClient, RequestType } from 'vscode-languageclient';
import { LanguageClientOptions, LanguageClient, RequestType, ExecuteCommandParams } from 'vscode-languageclient';

let languageClient: LanguageClient;

Expand All @@ -37,6 +37,14 @@ export function activate(context: ExtensionContext) {
languageClient.onRequest(quarkusPojectInfoRequest, async (params: QuarkusProjectInfoParams) =>
<any> await commands.executeCommand("java.execute.workspaceCommand", JDTLS_PROJECT_INFO_COMMAND, params)
);

/**
* Command for resetting Quarkus properties cache
*/
context.subscriptions.push(commands.registerCommand('quarkusTools.classpathChanged', (projects) => {
languageClient.sendNotification("quarkus/classpathChanged", projects);
}));

}).catch((error) => {
window.showErrorMessage(error.message, error.label).then((selection) => {
if (error.label && error.label === selection && error.openUrl) {
Expand Down

0 comments on commit 157f2c3

Please sign in to comment.