-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add Koka #7320
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
Add Koka #7320
Conversation
@toh995 I don't think
|
Hi @TimWhiting. Thanks for the advice. I was going off of this part of the textmate grammar: https://github.com/koka-lang/koka/blob/e55036d/support/vscode/koka.language-koka/syntaxes/koka.json#L3 I had thought that there was a one-to-one mapping between file extensions vs. file types. But looks like that is not actually the case? Which file extensions would you recommend adding linguist support for, amongst the three? Obviously we'd like EDIT: Maybe we can add |
I've made a change in the original textmate grammar in the Koka repo to reflect the actual file type. I'd say add all of the extensions unless there is any concern from the linguist side. They all should be highlighted using this grammar if they show up in a repository or on github issues. We probably should add examples of those files though. |
All extensions need to meet our usage requirements. Any that don't will hold back the PR from being merged. Once merged and deployed, users can use an override to set the language for the less poor extensions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several of your samples are too big… if the diff suppresses them, they're too big for our needs. Please remove or replace the large samples. We don't need many, just a few most representative of real usage of the language.
Thanks @lildude for weighing in RE: file extensions! Looks like |
@lildude I've addressed your comments! I'd appreciate another round of review. Also - another question - how is the grammar git submodule kept up-to-date? i.e. suppose the upstream grammar repo gets updated (e.g. in our case, koka-community/koka-textmate-grammar). How does linguist pick up on these upstream changes? Do we need to manually update linguist for every upstream change? |
@toh995 It looks like most languages only have one sample per extension, it looks like multiple samples are not necessary unless there are other languages with the same extension to disambiguate which actual language it better matches. Since no other language uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since no other language uses
.kk
I think we only need one sample.
As suggested, we don't need this many samples. Adding two or three now will ensure we have sufficient samples if a new language is added with a matching extension.
Thanks @lildude for the review! For the code samples, is it okay if it doesn't contain all possible language features? I guess that's why I added so many samples, I wanted to ensure we get reasonable coverage of all language features 😅 |
@toh995 I don't think we need all features, just enough to distinguish from another language using the From looking at the other languages in the samples folder it seems like there is a wide variety of lengths and numbers of samples, and many have only one or two samples per extension type. For example, Kotlin, Dart, ReScript and Scala have very few samples (1-2). There are others that have a lot (Swift). I feel like the ones that have a lot are going overboard. What other programming language is going to use the |
Co-authored-by: Colin Seymour <[email protected]>
@lildude I believe this is ready for re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Important
The changes in this PR will not appear on GitHub until the next release has been made and deployed. See here for more details.
Description
Add support for koka.
Checklist:
samples/Koka/community-docs.kk
, I consolidated various examples from https://github.com/koka-community/koka-docs/tree/0bf7262 into a single file.samples/Koka/official-tutorial1.kk
andsamples/Koka/official-tutorial2.kk
- this code was consolidated/extracted from the official "language tutorial" docs https://github.com/koka-lang/koka/blob/8b18c48a32398c7cc98a9e33e7d25832d418e9ec/doc/spec/tour.kk.mdsamples/Koka/community-docs.kk
, the code is licensed under MIT (included in a comment at the top of the file). This license was copied from https://github.com/koka-community/koka-docs/blob/6be3e57/LICENSE.#215166
[ ] I have updated the heuristics to distinguish my language from others using the same extension.N/A, there are no other languages with the same extensions