Page MenuHomePhabricator

Add support for synta highlighting kotlin files
Needs ReviewPublic

Authored by kageiit on Aug 20 2016, 11:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Aug 14, 7:59 AM
Unknown Object (File)
Sat, Aug 13, 2:01 PM
Unknown Object (File)
Sat, Aug 6, 7:41 PM
Unknown Object (File)
Sat, Jul 30, 10:58 PM
Unknown Object (File)
Mon, Jul 25, 10:29 PM
Unknown Object (File)
Jul 9 2022, 4:02 AM
Unknown Object (File)
Jul 8 2022, 9:11 AM
Unknown Object (File)
Jul 8 2022, 12:05 AM
Tokens
"Like" token, awarded by yashasvigirdhar."Mountain of Wealth" token, awarded by andrewmunn.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Required Signatures
L28 Phacility Individual Contributor License Agreement
Summary

Pygments has had support for this for a while.

https://bitbucket.org/birkenfeld/pygments-main/pull-requests/58/add-support-for-kotlin-programming/diff

Just adding a mapping for kotlin files to find the right lexer

Test Plan

N/A

Diff Detail

Repository
rPHU libphutil
Branch
add_kotlin_syntax_highlighting
Lint
Lint Passed
Unit
Tests Skipped
Build Status
Buildable 13384
Build 17177: arc lint + arc unit

Event Timeline

kageiit retitled this revision from to Add support for synta highlighting kotlin files.
kageiit updated this object.
kageiit edited the test plan for this revision. (Show Details)
jigar123 added inline comments.
src/markup/syntax/highlighter/PhutilPygmentsSyntaxHighlighter.php
128

Why m for Objective C

See also T3626, which discusses this table with more context; I think we have better caching in place since that last surfaced, so maybe pygmentize -N isn't so bad now.

Kotlin has been picking up steam lately:

We’ve seen over 160’000 people using it during the last year. OSS projects on Github grew from 2.4M to 10M lines of Kotlin code (about 4x). Our Slack community has grown from 1’400 to over 5’700 people (over 4x).
Many well-known companies are using Kotlin: Pinterest, Coursera, Netflix, Uber, Square, Trello, Basecamp, amongst others. Corda, a distributed ledger developed by a consortium of well-known banks (such as Goldman Sachs, Wells Fargo, J.P. Morgan, Deutsche Bank, UBS, HSBC, BNP Paribas, Société Générale), has over 90% Kotlin in its codebase.
https://blog.jetbrains.com/kotlin/2017/03/kotlin-1-1/

We'd love to see this supported on Phabricator!

3oz8xZMZox78ZbWbFC.gif (281×480 px, 5 MB)

Add this to syntax.filemap in Config:

"@\\.kt$@": "kotlin"

T3626 discusses a larger problem here; we're very unlikely to make piecemeal changes which do not resolve the broader issues discussed there.