Proposal: Validate Top-Level Objects #56
Labels
area/syntax
affecting syntax highlight
status/triage
default label before it is marked as bug or something else
type/enhancement
New feature or request
Milestone
Description
This proposal asks to implement some sense of validation for top-level objects like
.User
,.Guild
, etc.Additionally, it'd be nice if we can find a way to also have auto-completion available for them.
Solution
Initial thoughts: Have some sort of dict lookup table from which we can determine:
However, this might cause issues within
range
and other structures that manipulate the dot context. We'd have to parse the context around the object and then determine whether to launch validation, or not.This also poses an issue with the auto-completion engine: My knowledge around the engine we provide sources for is heavily limited, and their documentation on such pretty "advanced" stuff is... lacking to say the least.
Perhaps we can consider implementing our own completion engine, entirely tailored to our needs. If possible, even in pure Vim Script, so that both Vim and Neovim can benefit from this feature.
The last point is, at least currently, not trivial -- here it is worth looking further into it and pushing Vim Script to its absolute limits.
As easy as it might seem to just look at other completion engines's code, I believe a clean-room implementation is both beneficial to us, as developers, as well as avoiding potential license / copyright claims. An active development branch should be considered.
Thinking further, the classic RegEx ways are quite excessive and inherently slow; though Vim's RegEx is powerful, it is still RegEx in the end and comes with its shortcomings, such as
There might be a third way, which I am missing, but I'll update this comment whenever I have a new idea.
With this feature implemented, we can also consider validating the syntax on some basic level -- though, at some point, we should consider implementing an LSP, which defines the grammar proper rather than admittedly hacks via Vim Script.
Code of Conduct
The text was updated successfully, but these errors were encountered: