nextflow-io / nextflow-io/language-server

Feature Request: Workspace Indexing Progress Notifications

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
31
Forks
8
Avg merge
1d 10h
Merged PRs (30d)
2

Description

Summary

Add support for $/progress notifications during workspace indexing to allow LSP clients to display progress information to users.

Motivation

When opening a large Nextflow project, the language server takes significant time to index all .nf files before it can respond to requests like workspace/symbol or textDocument/documentSymbol. During this time, clients have no way to know:

  1. That indexing is in progress
  2. How far along the indexing is
  3. When indexing will complete

This results in a poor user experience where the editor/client appears to be "stuck" or unresponsive.

Proposed Solution

Implement the LSP Progress support for workspace indexing:

  1. Create a progress token during initialization using window/workDoneProgress/create
  2. Send $/progress notifications during the update() method in LanguageService.java with:
    • kind: "begin" when starting to index
    • kind: "report" with percentage (0-100) and/or message (e.g., "Indexing file 15/60") as files are processed
    • kind: "end" when indexing completes
Example Progress Flow
-> window/workDoneProgress/create { token: "indexing" }
<- $/progress { token: "indexing", value: { kind: "begin", title: "Indexing workspace", percentage: 0 } }
<- $/progress { token: "indexing", value: { kind: "report", percentage: 25, message: "15/60 files" } }
<- $/progress { token: "indexing", value: { kind: "report", percentage: 50, message: "30/60 files" } }
<- $/progress { token: "indexing", value: { kind: "report", percentage: 100, message: "60/60 files" } }
<- $/progress { token: "indexing", value: { kind: "end", message: "Indexed 60 files" } }
Implementation Notes

In LanguageService.java, the update0() method already knows the set of URIs being processed:

private void update0() {
    // ...
    var uris = fileCache.removeChangedFiles();
    if( !scanned ) {
        if( uris.isEmpty() ) {
            uris = getWorkspaceFiles();  // <-- We know the total count here
            // Could send begin progress here
        }
    }
    // ...
    var changedUris = astCache.update(uris, fileCache);
    // Could send progress updates during astCache.update()
}

The ASTNodeCache.update() method could accept a progress callback or the total/current counts could be tracked and reported.

Benefits
  • Better user experience in VS Code and other editors
  • Enables CLI tools to show accurate progress bars
  • Aligns with LSP best practices for long-running operations
References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LanguageService.java, especially update0(), and inspect how ASTNodeCache.update() processes the URIs from fileCache. Read the referenced LSP Progress and Work Done Progress specifications before deciding how progress callbacks or counts should flow. Done means workspace indexing emits begin, report, and end $/progress notifications with useful counts or messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.