Skip to content

Support find-definition for fully qualified vars even when the namespace is not explicitly required - #2278

Merged
ericdallo merged 10 commits into
clojure-lsp:masterfrom
jramosg:master
Apr 27, 2026
Merged

ericdallo merged 10 commits into
clojure-lsp:masterfrom
jramosg:master

Conversation

@jramosg

@jramosg jramosg commented Apr 27, 2026

Copy link
Copy Markdown
Contributor
  • I created an issue to discuss the problem I am trying to solve or an open issue already exists.

  • I added a new entry to CHANGELOG.md

  • I updated documentation if applicable (docs folder)

  • Create resolved-unknown-var-usage-namespace to resolve unknown namespace usages for variables. When it is resolved, it adds :to keyword to var-usage

  • Add unit tests:

    • namespace is resolved (alias is the full namespace)
    • namespace is not resolved
  • Add integration tests for resolved namespace

Fixes #2028

jramosg and others added 10 commits April 27, 2026 08:49
This change introduces a new private function to resolve unknown
namespace usages for variables. It enhances the existing
find-definition method to utilize this new function, allowing
for better handling of cases where a variable's namespace is
unknown, improving the overall analysis accuracy.

Fixes clojure-lsp#2028
This commit introduces a new test case to verify the behavior of
finding definitions for fully qualified vars without requiring
the namespace. Additionally, it adds a new source file to
support the test, ensuring comprehensive coverage for
definition lookups in the integration tests.
This test verifies that the system can correctly find the definition
of a fully qualified symbol that is not explicitly required in the
namespace. This enhances the coverage of the definition lookup
functionality in the queries.
This test checks the behavior of the
find-definition-from-cursor function when
using a non-fully qualified symbol without
a require statement, ensuring it returns nil
as expected.

@ericdallo ericdallo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered about the performance of find-definition, but I think it's good, it should only happen for unknown ns, thank you!

@ericdallo
ericdallo merged commit 5955d58 into clojure-lsp:master Apr 27, 2026
13 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.

Support navigation of fqs not required

2 participants