-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(kotlin) remove very old keywords and update example code #2623
Conversation
There aren’t valid Kotlin keywords. Also remove the `trait` usage from the example and format the code according to the Kotlin coding conventions.
Your removing 5 different keywords here, not just trait. Do you know when they were they removed from the Kotlin language? We don't have a specific policy on handling deprecations like this but in general if code still exists using these things we'd like to still be highlighting them - so we've never been in a hurry to remove older keywords. Auto-detect is never guaranteed and not a justification in and of itself for removing older keywords. |
As far as I know, none of these were ever valid keywords. I don’t know why they’re in the syntax definition to begin with. They’re nowhere to be found in the list of keywords in the Kotlin language documentation. |
Trait most definitely was. Though I'm happy to say 5 years was "some time ago though"... I wonder about the other keywords. Would be nice to have a Kotlin person weigh in on this. If the problem that let you here is truly just relevancy though how about updating the comment to "old syntax" and simply making them all 0 relevancy? Are they harming current highlighting of Kotlin code? |
Ok let me review this again. I think we can put some weigh into Sannis's comment 4 years ago: "delete soon". af601cb So lets go ahead and remove them. :) |
I don’t think they harm anything. The reason I removed them was because I saw the example on the hljs website using |
Can you please also add an entry to CHANGES.md? |
I’ll do that. |
Ah I forget we use the detect samples as sample code for the website. |
@kageru Thanks for spotting! |
These aren’t valid Kotlin keywords and just cause issues with autodetection
because Scala, which is syntactically quite similar to kotlin, actually has a
trait
keyword.It even says
// to be deleted soon
, whenever soon is, so I decided to do it now.Also replace
trait
in the example(which would no longer be highlighted)
and format the code according to the Kotlin coding conventions.