Project
More Languages for Adobe Brackets — Editor Syntax Plugin
I developed and published an Adobe Brackets plugin that registers existing CodeMirror modes for 19 additional languages and connects them to file extensions and comment shortcuts.
Explore the language registrations
My extension supplies the language registrations. CodeMirror 5.62.2 supplies the recorded highlighting, shown in this site’s colors. The browser displays the samples without running them.
temperature.ps1
The same source text appears in both views.
Plain text
# Convert Celsius to kelvin.
$celsius = 20
$kelvin = $celsius + 273.15
Write-Output $kelvinRecorded highlighting
# Convert Celsius to kelvin.
$celsius = 20
$kelvin = $celsius + 273.15
Write-Output $kelvinLanguage registration
| Setting | Value |
|---|---|
| Language | PowerShell |
| CodeMirror mode | powershell |
| File extensions | .ps1 |
| Line comment | # |
| Block comment | <# … #> |
temperature.swift
The same source text appears in both views.
Plain text
// Convert Celsius to kelvin.
let celsius = 20.0
let kelvin = celsius + 273.15
print(kelvin)Recorded highlighting
// Convert Celsius to kelvin.
let celsius = 20.0
let kelvin = celsius + 273.15
print(kelvin)Language registration
| Setting | Value |
|---|---|
| Language | Swift |
| CodeMirror mode | swift |
| File extensions | .swift |
| Line comment | // |
| Block comment | /* … */ |
temperature.lisp
The same source text appears in both views.
Plain text
;; Convert Celsius to kelvin.
(defun kelvin (celsius)
(+ celsius 273.15))
(print (kelvin 20.0))Recorded highlighting
;; Convert Celsius to kelvin.
(defun kelvin (celsius)
(+ celsius 273.15))
(print (kelvin 20.0))Language registration
| Setting | Value |
|---|---|
| Language | Common Lisp |
| CodeMirror mode | commonlisp |
| File extensions | .cl, .lisp |
| Line comment | ;; |
temperature.f90
The same source text appears in both views.
Plain text
! Convert Celsius to kelvin.
program temperature
implicit none
real :: celsius, kelvin
celsius = 20.0
kelvin = celsius + 273.15
print *, kelvin
end program temperatureRecorded highlighting
! Convert Celsius to kelvin.
program temperature
implicit none
real :: celsius, kelvin
celsius = 20.0
kelvin = celsius + 273.15
print *, kelvin
end program temperatureLanguage registration
| Setting | Value |
|---|---|
| Language | Fortran |
| CodeMirror mode | fortran |
| File extensions | .F, .F03, .F08, .F90, .F95, .FOR, .FPP, .FTN, .f, .f03, .f08, .f90, .f95, .for, .fpp, .ftn |
| Line comment | ! |
mean_temperature.jl
The same source text appears in both views.
Plain text
# Average three temperature readings.
temperatures = [18.5, 20.0, 21.5]
mean_value = sum(temperatures) / length(temperatures)
println("Mean temperature: ", mean_value)Recorded highlighting
# Average three temperature readings.
temperatures = [18.5, 20.0, 21.5]
mean_value = sum(temperatures) / length(temperatures)
println("Mean temperature: ", mean_value)Language registration
| Setting | Value |
|---|---|
| Language | Julia |
| CodeMirror mode | julia |
| File extensions | .jl |
| Line comment | # |
| Block comment | #= … =# |
mean_temperature.R
The same source text appears in both views.
Plain text
# Average three temperature readings.
temperatures <- c(18.5, 20.0, 21.5)
mean_value <- mean(temperatures)
print(mean_value)Recorded highlighting
# Average three temperature readings.
temperatures <- c(18.5, 20.0, 21.5)
mean_value <- mean(temperatures)
print(mean_value)Language registration
| Setting | Value |
|---|---|
| Language | R |
| CodeMirror mode | r |
| File extensions | .R, .RData, .r, .rda, .rds, .Rproj |
| Line comment | # |
Extension source (opens in a new tab)CodeMirror 5.62.2 (opens in a new tab)CodeMirror licenseRecorded tokens
Adobe Brackets was a good editor with a narrow idea of which languages existed. Open a COBOL or Fortran or IDL file and you got a wall of uniform gray text. This plugin fixed that for nineteen languages it had left out.
Context
I was working across a wider spread of languages than a web-focused editor expected — scientific and legacy ones especially — and Brackets treated most as plain text. Rather than switch tools, I extended the one I liked and published the result.
The problem
Brackets is built on CodeMirror, which already knows how to highlight far more languages than Brackets exposed. The missing piece was the wiring: registering each language’s CodeMirror mode, mapping it to file extensions, and hooking it into the editor’s comment commands so the new languages behaved like first-class citizens.
Approach
The plugin registers CodeMirror modes for 19 languages Brackets didn’t ship — COBOL, Fortran, IDL, Julia, Lisp, Mathematica, R, Swift, and more — binding each to its file extensions so highlighting works on open, and wiring them into Brackets’ line- and block-comment shortcuts. Released under AGPL-3.0.
Outcome
It’s published on GitHub and makes Brackets usable for a much broader range of code than it shipped supporting. It’s the most-starred project on my GitHub.