feat(developer): Keyman-language LSP (to gain auto-complete, etc)
- Dominant language
- Pascal
- Stars
- 534
- Forks
- 143
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 113
Description
Since the idea happened to come up in a meeting earlier today, my interest was a bit piqued and I did some quick searching / research.
For the uninitiated: *l*anguage *s*erver *p*rotocol. This is a programming-related technology that, when implemented for a language, allows compatible text editors to integrate Intellisense, code-completion, code-definition hotlinking, etc for it. So, implementing this for the Keyman language would allow us to gain these features for keyboard coding! (Our text-editing engine dependency is LSP-compatible.)
For starters: https://microsoft.github.io/language-server-protocol/
That site pretty much has the spec and lots of links to resources for development of language-server protocols. No clear guide that I could quickly find, but there are some parts that serve to ease you into some of the design and such, at least. There's noted use of "JSON_RPC" for cross-platform comms, and the protocol design seems to have been spearheaded by MS to work with VS Code... with noted contribution from other open-source communities. So... TS is likely a pretty good language for working with this stuff. Conveniently... we've been putting Keyman Developer's compilers into TS lately via the 🗜 PR chain as part of #8954 and possibly before.
Searching through the resources and links, one thing in particular stands out:
https://github.com/langium/langium/tree/main/packages/langium-vscode/src/language-server
It's an open source project (main site: https://langium.org/) that's essentially an SDK for parser, compiler, etc development based in TS... one component of which ties into automatic creation/fueling of LSPs. The link above is to the folder where the main interfacing types for their implementation of the feature exists. Other components of possible relevance exist in other (sibling & parent) folders in that repo.
Of note: MIT licensed, in TS. If nothing else, it'd probably make a valuable reference, and the licensing is very permissive.
Obviously, this isn't the simplest thing to pick up and instantly implement... but since I've gone ahead and found these resources, I figured "why not at least document it?"
Contributor guide
Assessment
This issue has not been assessed yet.