-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Analysis #457
Analysis #457
Conversation
aa2f51c
to
d8a2c25
Compare
apps/remote_control/lib/lexical/remote_control/search/indexer/extractors/module.ex
Outdated
Show resolved
Hide resolved
92cc5b8
to
8336ee4
Compare
Reminder to self: the pattern for detecting edit: done |
9822223
to
d58a134
Compare
apps/remote_control/lib/lexical/remote_control/dispatch/handlers/indexing.ex
Outdated
Show resolved
Hide resolved
0af5ef2
to
b828358
Compare
@scohen @scottming I'm going to mark this as ready for review, as I think it's very close to a merge-able state. I'll update the OP with some additional information. |
apps/remote_control/lib/lexical/remote_control/code_intelligence/entity.ex
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is excellent.
I have a couple of small comments, but I think we should move forward on this.
apps/remote_control/lib/lexical/remote_control/dispatch/handlers/indexing.ex
Outdated
Show resolved
Hide resolved
We weren't using the read-concurrency features of the ETS store, so this commit refactors the document store to use a simpler in-memory representation.
f09e333
to
5c872e3
Compare
This functionality is tested thoroughly at a higher level in alias resolution tests.
Find references weren't correctly updated to use analysis in #457.
Fixes #426
This PR introduces the concept of analysis, which is encapsulated by the
%Lexical.Ast.Analysis{}
struct. The idea is that, in the happy case, we can analyze the AST up front to capture important information and then re-use it for subsequent operations.The most important new APIs/changes introduced:
Lexical.Ast.analyze(document)
- returns%Analysis{}
which may or may not be valid (analysis.valid?
). Used for whole-document analysis, e.g. indexing.Lexical.Ast.reanalyze_to(analysis, position)
- returns%Analysis{}
using the fragment of the original document up to the given position. Useful for things that may not require the whole document, e.g. resolving aliases. If the given analysis is already valid, this is a no-op.Lexical.Ast.Aliases
has been removed in favor of analysis.Lexical.Ast
functions have been refactored to also (or only) accept an analysis in place of a document.Lexical.Document.Store
. This allows for a derived analysis to be saved alongside the document and fetched using{:ok, %Document{}, %Analysis{}} = Document.Store.fetch(uri, :analysis)
.Running the following extremely simple "benchmark" in
iex -S mix
: