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
F13058860: D16428.id39507.diff
Fri, Apr 19, 3:13 PM
Unknown Object (File)
Thu, Apr 18, 11:26 PM
Unknown Object (File)
Thu, Apr 11, 3:10 AM
Unknown Object (File)
Thu, Apr 11, 3:07 AM
Unknown Object (File)
Mon, Apr 8, 12:14 AM
Unknown Object (File)
Sun, Mar 31, 8:34 PM
Unknown Object (File)
Thu, Mar 28, 12:35 PM
Unknown Object (File)
Mar 19 2024, 7:24 PM
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.