Sublime Forum

Ada support, various other questions from potential customer

#1

I’ve come across SublimeText, and would quite like to migrate all my programming to it, as I like a lot of its features, especially the fantastic multiediting and the ability to write pythong plugins. However, there are some issues that makes me hesitate:

No code folding - not that I use it a lot, but the few times I do, it helps with the overview.

Insufficient and disorganized documentation.

Ada was not one of the languages included, and as syntax highlighting is an important feature, a dealbreaker for me, I looked around and found an ada.tmlanguge file. While this gets me mostly decent highlighting, a few things are missing, and one is outright broken:

  • Operators don’t highlight - I strongly prefer them to be highlighted

  • ()Bracket matching is way too subtle - I would prefer actually changing the colour of the brackets to something vivid

  • Is it possible to change the syntax highlighting to bold for e.g. keywords (or any other category I want a different font or font effect for).

  • (This is the really broken bit) : a double quotes character (i.e. between single quotes) messes up all the syntax highlighting - it thinks it is the start of a string, so everything until the next (except the bits which are actual strings) ‘"’ gets highlighted as strings.

I guess there are ways to fix this by poking around in the respective files, but I don’t know how to (yet).

Ada.tmlanguage:

[code]<?xml version="1.0" encoding="UTF-8"?>

comment Ada -- chris@cjack.com. Feel free to modify, distribute, be happy. Share and enjoy. fileTypes adb ads foldingStartMarker \b(?i:(procedure|package|function|task|type|loop))\b foldingStopMarker \b(?i:(end))\b keyEquivalent ^~A name Ada patterns captures 1 name storage.type.function.ada 2 name entity.name.function.ada match \b(?i:(function|procedure))\b\s+(\w+(\.\w+)?|"(?:\+|-|=|\*|/)") name meta.function.ada captures 1 name storage.type.package.ada 2 name keyword.other.body.ada 3 name entity.name.type.package.ada match \b(?i:(package)(?:\b\s+(body))?)\b\s+(\w+(\.\w+)?|"(?:\+|-|=|\*|/)") name meta.function.ada captures 1 name storage.type.function.ada 2 name entity.name.function.ada match \b(?i:(end))\b\s+(\w+(\.\w+)?|"(\+|-|=|\*|/)")\s?; name meta.function.ada captures 1 name keyword.control.import.ada 2 name string.unquoted.import.ada match \b(?i:(with|use))\b\s+(\w+(\.\w+)?)\s?; name meta.function.ada match \b(?i:(begin|end|package))\b name keyword.control.ada match \b(?i:(\=>|abort|else|new|return|abs|elsif|not|reverse|abstract|null|accept|entry|select|access|exception|of|separate|aliased|exit|or|subtype|all|others|and|for|out|tagged|array|function|task|at|terminate|generic|pragma|then|goto|private|type|body|procedure|if|protected|until|case|in|use|constant|is|raise|range|when|declare|limited|record|while|delay|loop|rem|with|delta|renames|digits|mod|requeue|xor|do))\b name keyword.other.ada match \b((0(x|X)[0-9a-fA-F_]*)|(([0-9_]+\.?[0-9_]*)|(\.[0-9_]+))((e|E)(\+|-)?[0-9_]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b name constant.numeric.ada begin " beginCaptures 0 name punctuation.definition.string.begin.ada end " endCaptures 0 name punctuation.definition.string.end.ada name string.quoted.double.ada patterns match \n name invalid.illegal.lf-in-string.ada captures 1 name punctuation.definition.comment.ada match (--)(.*)$\n? name comment.line.double-dash.ada scopeName source.ada uuid 0AB8A36E-6B1D-11D9-B034-000D93589AF6 [/code]
0 Likes

#2

Try sublimetext.info. You’ll find some (unofficial) information there not available here. The plan is to add more soon as time permits.

0 Likes

#3

Re. syntax definitions, you can go directly here:

sublimetext.info/docs/extensibil … xdefs.html
sublimetext.info/docs/reference/syntaxdefs.html

HTH

0 Likes

#4

Sorry for digging up an old thread but I wanted to announce that I started to work on improving the available Ada.tmbundle for Sublime and this thread seemed appropriate.

I have no prior experience with creating TextMate/Sublime bundles but I hope to gradually improve the support it currently provides.

The bundle is available on github and is under active development: github.com/mulander/ada.tmbundle

Please report any problems/bugs/requests using github.com/mulander/ada.tmbundle/issues

Regards

EDIT: Forgot to mention that I fixed the messed up syntax highlighting the original post demonstrates :wink:

0 Likes