Procfile
extension for Visual Studio Code
A Visual Studio Code extension with support for
Procfile
s.
The Procfile
is mostly known for its use by Heroku and Foreman. However, it
is supported by a number of other services and utilities, and is extremely handy for
development. With this .env
file:
DJANGO_SETTINGS_MODULE=my_site.settings.local
WEB_HOST=0.0.0.0:8000
BROWSERSYNC_PORT=9000
… and this Procfile
:
# Run the Django Web app.
django: django-admin runserver "$WEB_HOST"
# Monitor and rebuild all static/front-end assets.
assets: npm run watch
# Run Browser Sync proxied to the Django Web app.
djsync: browser-sync start --proxy="$WEB_HOST" --port="$BROWSERSYNC_PORT"
You can run honcho start
and have it all up and running!
Features
This extension is packed with features, especially for one that you will hardly
ever have to use! However, I believe both you and the humble Procfile
deserve only
the best. :)
Syntax Highlighting
As seen above, the files are highlighted not only to show what a valid process
definition is, but it also highlights the command to run using the shell highlighter.
Some services, such as Heroku, give special meaning to certain process names.
Hovering over those will now give a description and a link to documentation.
Having whitespace between the process name and the command is optional. This
extension exposes an insertSpace
(default: true
) setting to its formatters. All
three types of formatting are provided: on-type, selection, and complete document.
Diagnostics
A Procfile
must have unique process names. The extension provides feedback when a
name has been duplicated.
Symbol Navigation
You have probably never seen a long Procfile
, but just in case you do, this
extension has you covered! You can navigate through the processes with the
breadcrumbs or the command palette.
Release Notes
See CHANGELOG.
Todo
There are still a few things I plan to do.
Cleanup
- Write tests:
- core
- diagnostics
- formatters
- hovers
- symbols
- Clean up core modules (reconsider the Line/Text setup)
- Consider releasing core module as own procfile package
Features
- Add automatic tasks (t1, t2) for running Procfiles.
Procfile
runners: Foreman & Clones
The most used and robust are:
Others include:
- node-foreman (Node) — n.b. How on earth is this not named “Noreman”?
I insist on referring to it as such!
- Shoreman (Shell)
- forego (Go)
There is no published standard for Procfile
syntax, but Foreman can be used as the
reference implementation. Though the various runners recognize different things as
comments, process, or errors, Foreman’s syntax is recognized by this extension.
Procfile |
Foreman |
Honcho |
Goreman |
Noreman |
Shoreman |
forego |
n0:·… |
✓ |
✓ |
✓ |
✓ |
✓ |
✓ |
n1:… |
✓ |
✓ |
✓ |
✓ |
✗ |
✓ |
n-4:·… |
✓ |
# * |
✓ |
✓ |
✓ |
✓ |
# n3:·… |
# |
# |
# |
# |
# |
✗ |
#n4:·… |
# |
# |
# |
# |
# |
✗ |
n5·:… |
# |
# |
✓ |
✗ |
✓ |
✗ |
·n6:·… |
# |
# |
✓ |
✗ |
✓ |
✗ |
n·7:·… |
# |
# |
✓ |
✗ |
✓ / ✗ |
✗ |
n8·:·… |
# |
# |
✓ |
✗ |
✓ |
✗ |
n9·… |
# |
# |
# |
✗ |
✗ |
✗ |
legend |
|
valid process |
✓ |
ignored / comment |
# |
error / hang |
✗ |
* Support for dashes is coming to Honcho (PR #218).