This PR attempts to make completion code easier to understand and work on.
Previously, code that explicitly referred to completions lived in common, server, and remote_control; after this PR, it all lives in server and remote_control. Because server can refer to protocol types, I was also able to dramatically simplify the types/specs used in the builder.
Additionally, two behaviours have been removed in favor of referring to their implementations directly: Lexical.Ast.Environment (which was only implemented by Lexical.Ast.Env), and Lexical.Completion.Builder (which was only implemented by Lexical.Server.CodeIntelligence.Completion.Builder). Removing some of this indirection also allowed Dialyzer to catch a few bugs in the types that lived in Lexical.Ast.Environment (now Lexical.Ast.Env).
This PR attempts to make completion code easier to understand and work on.
Previously, code that explicitly referred to completions lived in common, server, and remote_control; after this PR, it all lives in server and remote_control. Because server can refer to protocol types, I was also able to dramatically simplify the types/specs used in the builder.
Additionally, two behaviours have been removed in favor of referring to their implementations directly:
Lexical.Ast.Environment
(which was only implemented byLexical.Ast.Env
), andLexical.Completion.Builder
(which was only implemented byLexical.Server.CodeIntelligence.Completion.Builder
). Removing some of this indirection also allowed Dialyzer to catch a few bugs in the types that lived inLexical.Ast.Environment
(nowLexical.Ast.Env
).