Repository navigation
Add progress reporting and server status tracking - #3
angelozerr wants to merge 1 commit into
Conversation
|
Please note I have add Java LS as mcp-ade extension https://github.com/angelozerr/mcp-ade/tree/main/extensions/java-ls and I need this PR to track the server ready, otherwise the first time that LSP references is consumed it returns empty references because Java LS has not finished to index the project. |
849f2ab to
c48335e
Compare
- Add ProgressSupport interface and ProgressMonitor for LSP $/progress - Add ServerStatus enum (starting/indexing/ready) with java/serverStatus notification - Add JavaLanguageClient interface extending LanguageClient with custom notifications - Integrate progress reporting into IndexService and Scanner - Use Launcher.Builder with JavaLanguageClient as remote interface Signed-off-by: azerr <azerr@redhat.com>
c48335e to
b32865d
Compare
|
@angelozerr I think you could achieve the same result by simply observing the log output of the language server. const indexLoadedDeferred = new Deferred<void>(900000);
const subscription = client.onNotification<LogMessageParams>(
LogMessageNotification.type,
(params: LogMessageParams) => {
// logRepoProgress(_repoName, "Metals log message: " + params.message);
const message = params && typeof params.message === "string" ? params.message : "";
if (/Indexing complete/.test(message)) {
logRepoProgress(_repoName, "Metals index complete");
indexLoadedDeferred.resolve(undefined);
}
},
);
return indexLoadedDeferred.promise().finally(() => {
subscription.dispose();
});I think having this infrastructure would be interesting generally, because most language servers will not publish status information. |
|
@tsmaeder thanks for your answer. First please note that jdtls and intellij server uses this custom notification. It would be very nice if lsp spec could introduce this kind of notification. I understand your point of view but IMHO I think it is a fragile solution because logs could be disabled. If you want to be full compliant lsp, I think the proper solution is to manage that with lsp progress. By using lsp progress you will give info to the user the status of rhe indexing. Even if java ls is super fast it could be interesting ro have that for large code base like quarkus. |
This PR:
Here a sample LSP Trace