Skip to content

Conversation

@ktnyt
Copy link
Owner

@ktnyt ktnyt commented Jan 2, 2026

Fixes #27

Problem

The first find_references call per session was returning incomplete results (only the definition) because the LSP server hadn't finished indexing the project yet when the request was made.

Solution

  • Modified ensureFileOpen to return a boolean indicating if the file was just opened (vs already open)
  • Added a 200ms wait after opening a file for the first time in findReferences and findDefinition to give the LSP server time to process the didOpen notification and start indexing the project

This ensures that workspace-wide operations like find_references return complete results even on the first call.

Testing

…eferences

Fixes #27

The first find_references call per session was returning incomplete
results (only the definition) because the LSP server hadn't finished
indexing the project yet when the request was made.

Changes:
- Modified ensureFileOpen to return a boolean indicating if the file
  was just opened (vs already open)
- Added a 200ms wait after opening a file for the first time in
  findReferences and findDefinition to give the LSP server time to
  process the didOpen notification and start indexing the project

This ensures that workspace-wide operations like find_references return
complete results even on the first call.
@ktnyt ktnyt merged commit 308c104 into main Jan 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First find_references returns incomplete results - missing didOpen before first request

1 participant