nextflow-io / nextflow-io/language-server
Feature Request: Workspace Indexing Progress Notifications
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:
- That indexing is in progress
- How far along the indexing is
- 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:
- Create a progress token during initialization using
window/workDoneProgress/create - Send
$/progressnotifications during theupdate()method inLanguageService.javawith:kind: "begin"when starting to indexkind: "report"withpercentage(0-100) and/ormessage(e.g., "Indexing file 15/60") as files are processedkind: "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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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