Skip to content

Commit dad7f3b

Browse files
authored
Merge pull request #12 from princemaple/rewrite-core
Rewrite core
2 parents 4fb0189 + 6fd6435 commit dad7f3b

37 files changed

+10198
-1421
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ on:
1313
- '**.tmPreferences'
1414

1515
jobs:
16-
syntax_tests:
17-
name: Run Syntax Tests
16+
st4_syntax_tests:
17+
name: Run ST4 Syntax Tests
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v2
2121
- uses: SublimeText/syntax-test-action@v2
2222
with:
23-
build: 4084 # or 'latest' for the latest ST3 build
23+
build: 4102
24+
default_packages: master
2425
package_name: ElixirSyntax

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.sublime-project
2+
*.sublime-workspace

BACKLOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Backlog
2+
3+
The backlog contains tasks that are planned to be worked on or ideas that may be useful.
4+
5+
* Elixir: allow setting the seed used for `mix test` via a command or similar.
6+
* Elixir: use ST4's branching feature to improve some rules.
7+
* Elixir: try to fix the rules that don't work due to the "context sanity limit" error.
8+
* Elixir: highlight `:atom`, `identifier`, `Module.X`, `M.func/1` in Markdown comments?

CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Changelog
2+
3+
## [v2.0.0] – 2021-04-27
4+
5+
The Elixir syntax definition has been reworked amounting to a complete rewrite
6+
bringing among other things the following features and improvements:
7+
8+
- Type highlighting in `@spec`, `@type`, `@typep`, `@opaque`, `@callback` and `@macrocallback`.
9+
- Parameter highlighting (also in `fn`, `case`, `with`, `for`, `try` and `receive`).
10+
- Function call highlighting (e.g. `inspect error`, `Enum.map(...)`).
11+
- Highlight `as: A` argument in alias/require statements.
12+
- Better matching for def/defmodule/etc. statements.
13+
- Highlight quoted member variables/functions (e.g. `:erlang."=/="(1, 2)`).
14+
- Fixes to strings, numerics, escapes, captures etc.
15+
- Newest Elixir operators and functions.
16+
- Highlight LiveView, YAML and JSON strings.
17+
- Syntax definition for EEx in Elixir (e.g. `defmodule <%= @module %>.View do end`)
18+
- Some keywords are variables depending on the context (e.g. `def = 0`).
19+
- Markdown highlighting within `@doc` comments and also Elixir code examples.
20+
- Highlight SQL (e.g. jsonb operators) inside the Ecto `fragment()` function (also for general usage: `sql("INSERT INTO ...")`).
21+
- Git merge conflicts are highlighted.
22+
- Added Monokai and Mariana theme color scheme rules.
23+
- Correct scope for symbol names for the "Go to Definition" command.
24+
- Speed optimizations: rules and regexps are ordered in such a way
25+
that they match the most likely occurring tokens first.
26+
- Snippets for `|> IO.inspect(label: "...")`, `|> then()` and `|> tap()`.
27+
- Extensive test-suite containing countless checks to ensure quality and avoid regressions.
28+
- Fixed Github CI syntax tests job.
29+
30+
## [v1.7.0] – 2020-05-20
31+
32+
Thanks @dkarter
33+
- Allow leex file to be picked up
34+
35+
## [v1.6.0] – 2019-11-20
36+
37+
Thanks to @azizk again
38+
- We now have regex syntax highlighting
39+
- EEx syntax highlighting now reuses html definition and interpolates Elixir parts into it
40+
- various fixes on general Elixir syntax definition
41+
- comprehensive sublime syntax tests
42+
43+
## [v1.3.0] – 2019-03-22
44+
45+
Thanks to @azizk
46+
- Also apply syntax to files with elixirc and iex in hashbang
47+
- Module names can only have ASCII letters, fixed regex to do that
48+
- Highlight module names as normal atoms when found in map/kwlist keys
49+
- Highlight unicode identifers for atoms, variables and function names
50+
51+
## [v1.2.0] – 2019-02-13
52+
53+
- Add Comment so we don't need https://github.com/elixir-editors/elixir-tmbundle alongside
54+
55+
## [v1.1.3] – 2019-02-01
56+
57+
- Fix binary `^^^` highlight
58+
- Highlight more operators
59+
60+
## [v1.1.0] – 2017-12-13
61+
62+
- Add HTML (EEX)

Elixir (EEx).sublime-syntax

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
%YAML 1.2
2+
---
3+
version: 2
4+
name: Elixir (EEx)
5+
file_extensions: [ex.eex, exs.eex]
6+
first_line_match: ^#\s*exs?\.eex
7+
scope: source.elixir.eex
8+
extends: Elixir.sublime-syntax
9+
10+
contexts:
11+
# Use prototype to work around the "context sanity limit" error.
12+
# An issue that remains is that "<% ... %>" embeds are not independent
13+
# of the surroundings.
14+
prototype:
15+
- include: eex_begin_tag
16+
- include: eex_end_tag
17+
18+
eex_begin_tag:
19+
- match: (<)(%(?>%=?|[=/|]?))
20+
captures:
21+
1: punctuation.section.embedded.begin.ex.eex
22+
2: entity.name.tag.ex.eex
23+
# # NB: causes "context sanity limit" error.
24+
# push: core_syntax
25+
# with_prototype:
26+
# - match: (?=%>|<%)
27+
# pop: true
28+
29+
eex_end_tag:
30+
- match: \s*(%)(>)
31+
captures:
32+
1: entity.name.tag.ex.eex
33+
2: punctuation.section.embedded.end.ex.eex

0 commit comments

Comments
 (0)