Skip to content
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

feat(developer): Keyman-language LSP (to gain auto-complete, etc) #9370

Open
jahorton opened this issue Jul 31, 2023 · 1 comment
Open

feat(developer): Keyman-language LSP (to gain auto-complete, etc) #9370

jahorton opened this issue Jul 31, 2023 · 1 comment

Comments

@jahorton
Copy link
Contributor

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: language server protocol. 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?"

@mcdurdin
Copy link
Member

https://github.com/github-linguist/linguist/blob/master/CONTRIBUTING.md would be valuable to do alongside this. I think we are close to meeting their requirements for popularity -- certainly there are a lot of unrelated repos, excluding forks: https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.kmn

We could add a heuristic for 'begin.+use' as that matches on every Keyman keyboard and afaict excludes the handful of unrelated .kmn files in GitHub.

Ref github-linguist/linguist#5756 for current guidelines on popularity for linguist.

(Note: will consider this as part of 18.0 development, for both .kmn and LDML .xml)

@mcdurdin mcdurdin modified the milestones: Future, 18.0 Mar 29, 2024
@mcdurdin mcdurdin modified the milestones: 18.0, 19.0 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants