Please enable JavaScript.
Coggle requires JavaScript to display documents.
Lexical - Coggle Diagram
Lexical
Glossary
LSP (protocol/)
Messages
Requests (Lexical.Protocol.Requests)
Requests are sent from client to server and vice versa, and must always be answered with a Response.
Responses (Lexical.Protocol.Responses)
Notifications (Lexical.Protocol.Notifications)
Notifications are likewise bi-directional and work like events. They expressly do not receive responses per LSP's specification.
Types of Messages
Completion Requests
Goto Definition Requests
WillSaveTextDocument Notifications
Language Server (server/)
Code Intelligence (code_intelligence/)
Handles Candidates and Completions
Modules
Env
in_context?
Given the context, are we looking at Elixir concepts such as if the user is currently typing
@impl
...
use
...
Server.CodeIntelligence.Completion
What does it do?
Determines what to show the client for completions
How does it determine what to complete?
applies_to_env?
Does the current completion suggested make sense in the given context?
Ultimately just returns a boolean
Env represents what the user is typing?
If the suggestion is a behavior and the user typed
@impl
then we should return true since it would make sense to show the user this completion
Code Intelligence
Completion
Pipeline
get_position_context()
|> get_candidates
Candidates
Who should we show in a given scenario?
If you type
@impl
you should only receive back implemented Behaviours as candidates
Local Completions