Skip to content

Commit

Permalink
Initial support for the Elm 0.19 compiler
Browse files Browse the repository at this point in the history
Drops support for Elm 0.18 for now, since it is so different. Also drops support for autocompletion and displaying type information with elm-oracle, which does not yet support Elm 0.19.

For now, supporting only a single build type (building the current file to /dev/null). The full project build will return in a later version.
  • Loading branch information
sentience committed Jun 24, 2018
1 parent 36314c6 commit b6a8091
Show file tree
Hide file tree
Showing 17 changed files with 321 additions and 688 deletions.
67 changes: 7 additions & 60 deletions Build Systems/Elm Make.sublime-build
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,14 @@
"selector": "source.elm",
"cmd":
[
"elm-make",
"{elm_binary}",
"make",
"$file",
"--output={null}",
"--report=json",
"--yes"
"--output=/dev/null",
"--report=json"
],
"working_dir": "$project_path",
"file_regex": "^\\-\\- \\w+: (?=.+ \\- (.+?):(\\d+):(\\d+))(.+) \\- .*$",
"error_format": "-- $type: $tag - $file:$line:$column\n$message\n",
"info_format": ":: $info\n",
"syntax": "Packages/Elm Language Support/Syntaxes/Elm Compile Messages.sublime-syntax",
"null_device": "/dev/null",
"warnings": "true",
"osx":
"cancel":
{
"path": "/usr/local/bin:$PATH"
},
"linux":
{
"path": "$HOME/.cabal/bin:/usr/local/bin:$PATH"
},
"variants":
[
{
"name": "Run",
"cmd":
[
"elm-make",
"$file",
"--output={output}",
"--report=json",
"--yes"
]
},
{
"name": "Ignore Warnings",
"warnings": "false"
},
{
"name": "Run - debug",
"cmd":
[
"elm-make",
"$file",
"--output={output}",
"--report=json",
"--debug",
"--yes"
]
},
{
"name": "Run - Ignore Warnings",
"warnings": "false",
"cmd":
[
"elm-make",
"$file",
"--output={output}",
"--report=json",
"--yes"
]
}
]
"kill": true
}
}
11 changes: 0 additions & 11 deletions Commands/Show Type.sublime-commands

This file was deleted.

8 changes: 0 additions & 8 deletions Keymaps/Default.sublime-keymap

This file was deleted.

13 changes: 0 additions & 13 deletions Menus/Context.sublime-menu

This file was deleted.

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
| type | ``type`` |
| typea | ``type alias (Record)`` |

- Autocompletions plus type signature and documentation display for all functions inside packages in your `elm-package.json` file (requires [elm-oracle](https://www.npmjs.com/package/elm-oracle), which you can install with `npm install -g elm-oracle`)
1. Bring up the type panel with `alt+up` or through the right-click context menu
2. Close the type panel with `alt+down`
3. If you don't like these keybindings, rebind them in your User packages directory
![autocompletions screenshot](images/completions.png)![type signature screenshot](images/elm_types.png)![type panel screenshot](images/type_panel.png)
- Four standard build commands (<kbd>Super+[Shift]+B</kbd> or <kbd>Super+[Shift]+F7</kbd>)
1. `Build` just checks errors. Kudos to this [tweet][]!
2. `Run` additionally outputs your compiled program to an inferred path.
Expand All @@ -51,7 +46,6 @@
3. Compile message highlighting, embedded code highlighting, and color scheme for output panel. ![compile messages screenshot](images/elm_make.jpg)
- Integration with popular plugins (installed separately)
1. [SublimeREPL][] — Run `elm-repl` in an editor tab with syntax highlighting. ![SublimeREPL screenshot](images/elm_repl.jpg)
2. [Highlight Build Errors][] — Does what it says on the box … usually.
- Integration with [elm format](https://github.com/avh4/elm-format)
1. Make sure `elm-format` is in your PATH
2. Run the "Elm Language Support: Run elm-format" command from the Command Palette to run elm-format on the current file
Expand Down
4 changes: 2 additions & 2 deletions Settings/Elm Language Support.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"debug": false,
"enabled": true,
"elm_binary": "elm",
"elm_format_binary": "elm-format",
"elm_format_on_save": true,
"elm_format_filename_filter": "",
"elm_paths": "",
"build_error_color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme"
"elm_paths": ""
}
3 changes: 2 additions & 1 deletion Settings/Elm User Strings.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"logging.prefix": "[Elm says]: ",
"logging.prefix": "Elm Language Support: ",
"logging.missing_plugin": "Missing plugin: {0}",

"make.missing_plugin": "To highlight build errors: Install with Package Control: Highlight Build Errors",
"make.logging.json": "JSON from elm-make: {0}",
"make.logging.invalid_json": "Invalid JSON from elm-make: {0}",

"open_in_browser.not_found": "HTML file NOT found to open: {0}",
Expand Down
58 changes: 34 additions & 24 deletions Syntaxes/Elm Compile Messages.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ name: Elm Compile Messages
hidden: true
file_extensions: []
scope: text.html.mediawiki.elm-build-output

contexts:
main:
- meta_scope: meta.report.elm-build-output
- match: "^(::) "
comment: "|> Unparsed Compile Message"
push:
Expand All @@ -20,7 +22,7 @@ contexts:
comment: Successfully generated
scope: constant.language.boolean.true.elm-build-output
- match: |-
(?x) # Minimally modified `file_regex` from `Elm Make.sublime-build`
(?x) # Minimally modified `file_regex` from `Elm Make.sublime-build`
^\-\-[ ] # Leading delimiter
((error) # \2: error
|(warning) # \3: warning
Expand All @@ -32,7 +34,7 @@ contexts:
(\d+): # \6: $line
(\d+) # \7: $column
\n$ # End
comment: '-- TAG - file:line:column\nOverview\nDetail\n'
comment: '-- type: TAG - file:line:column\nMessage\n'
captures:
0: markup.heading.4.elm-build-output
1: support.constant.type.elm-build-output
Expand All @@ -42,31 +44,39 @@ contexts:
5: markup.underline.link.elm-build-output
6: constant.numeric.elm-build-output
7: constant.numeric.elm-build-output
- match: (`)(?!`)
comment: Inline `variable`
scope: punctuation.definition.raw.elm-build-output
push:
- meta_scope: meta.report.elm-build-output
- meta_content_scope: string.unquoted.elm-build-output
- match: ^\n$
captures:
0: meta.separator.elm-build-output
pop: true
- match: (`)(?!`)
comment: Inline `variable`
- meta_scope: markup.raw.inline.elm-build-output
- meta_content_scope: variable.other.elm.elm-build-output
- match: \1
captures:
0: punctuation.definition.raw.elm-build-output
push:
- meta_scope: markup.raw.inline.elm-build-output
- meta_content_scope: variable.other.elm.elm-build-output
- match: \1
captures:
0: punctuation.definition.raw.elm-build-output
pop: true
- match: "(?m)^ {4}"
comment: Code Block
push:
- meta_scope: markup.raw.block.elm-build-output
- match: '\n+(?!^ {4})'
pop: true
- include: scope:source.elm
pop: true
- match: '(<)([^>]+)(>)'
comment: Inline <url>
captures:
1: punctuation.definition.link.elm-build-output
2: markup.underline.link.elm-build-output
3: punctuation.definition.link.elm-build-output
- match: '^Hint:'
scope: markup.heading.5.elm-build-output
- match: "^ +([x^]+)$"
comment: error jaggy underline
captures:
1: punctuation.definition.raw.elm-build-output
- match: "^ {4}"
comment: code block
embed: Elm.sublime-syntax
escape: \n
- match: '^(\d+)(\|( |>))'
captures:
1: constant.numeric.line-number.elm-build-output
2: punctuation.definition.raw.elm-build-output
comment: line-numbered code block
embed: scope:source.elm
escape: \n
- match: ^\[
comment: '[Finished in 4.2s]'
push:
Expand Down
19 changes: 0 additions & 19 deletions beta-repository.json

This file was deleted.

Loading

0 comments on commit b6a8091

Please sign in to comment.