New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic code intel: ideas for improvements #2298
Comments
Basic code intel now ranks references by file path similarity sourcegraph/code-intel-extensions@27d3b89 |
For section “Custom hover docs”, actually
As they are very often useful as tooltip. Note that all of them takes a type, which Sourcegraph should render as a link. |
Closing this issue as it stands it is not actionable for us, team will discuss outstanding ideas and if still applicable we will create new separate scoped issues to track development. |
Jump-to-definition can't disambiguate between symbols with the same name
Say you have 2 files that both define:
Jump-to-definition on a reference to
Foo
would show 2 results.Ideas for improvements
.
, such ascli
incli.Main
) to determine the enclosing classSee #3234
Find-references is inaccurate
User report
Ideas for improvements
More discussion #3418
Elaborating on filtering by imports
We could do more computation in basic-code-intel in the browser. Here's a sketch:
Foo
Foo
and discovers it is defined inpkg1/Foo.java
Foo
and finds lots of resultsThe main problem is "lots of results", which could be in the tens or hundreds. We could limit it to the top N, or prompt users to click a button to make basic code intel try harder.
We could do more indexing up front. Here's a sketch:
The main problem is compute and storage resources for all of these references.
Doesn't work well for dependencies
User report
Ideas for improvements
import
statements,package.json
s, and the respective package registry to find relevant repositories to search in for dependency symbolsJump-to-definition and find-references don't work on local variables
Currently, basic-code-intel cannot provide jump-to-definition for anything but top-level variables/functions, and there are lots of false-positives because it's not scope-aware.
Proposal: use tree-sitter
Use tree-sitter to build a syntax tree with scope information for a given file in order to reduce false positives for references provide jump-to-definition within the given scope.
Domain-specific code intelligence
Custom hover docs
From #4 (comment)
Currently, Sourcegraph
RegexLexer.state
is not a link:The text was updated successfully, but these errors were encountered: