Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
msaraiva committed Jul 27, 2021
0 parents commit f95bb76
Show file tree
Hide file tree
Showing 11 changed files with 877 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.vsix
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
]
}
4 changes: 4 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## v0.1.0 (WIP)

- Initial release
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2021 Marlus Saraiva

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Phoenix package for VS Code (WIP)

Syntax highlighting support for Phoenix templates.

## Features

* Support syntax highlighting for `.heex` files
* Extends Elixir's syntax highlighting to support HEEx's syntax inside `~F`

## License

Copyright (c) 2021, Marlus Saraiva.

Source code is licensed under the [MIT License](LICENSE).
Binary file added images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"comments": {
"blockComment": ["<%#", "%>"]
},
"brackets": [
["<", ">"],
["{", "}"],
["(", ")"],
["[", "]"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["<%", " %>"],
["'", "'"],
["\"", "\""]
],
"surroundingPairs": [
["'", "'"],
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"],
["%", "%"],
["\"", "\""]
]
}
50 changes: 50 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "phoenix",
"displayName": "Phoenix Framework",
"homepage": "https://www.phoenixframework.org",
"description": "Syntax highlighting support for HEEx",
"version": "0.1.0",
"author": "Marlus Saraiva",
"publisher": "msaraiva",
"license": "MIT",
"icon": "images/logo.png",
"repository": {
"type": "git",
"url": "https://github.com/phoenixframework/vscode-phoenix.git"
},
"engines": {
"vscode": "^1.25.1"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
"id": "phoenix-heex",
"aliases": [
"HEEx",
"heex"
],
"extensions": [
".heex"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "phoenix-heex",
"scopeName": "source.heex",
"path": "./syntaxes/heex.json"
},
{
"scopeName": "source.elixir.heex",
"path": "./syntaxes/elixir-heex.json",
"injectTo": [
"source.elixir"
]
}
]
}
}
112 changes: 112 additions & 0 deletions syntaxes/elixir-heex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"injectionSelector": "L:source.elixir -comment -text -string",
"name": "elixir-heex",
"patterns": [
{
"comment": "HEEx sigil with heredoc (double quotes)",
"name": "text.html.heex",
"begin": "\\s?(~H\"\"\")$",
"beginCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"end": "^\\s*(\"\"\"[a-z]*)$",
"endCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"patterns": [
{
"include": "source.heex"
}
]
},
{
"comment": "HEEx sigil with double quotes",
"name": "text.html.heex",
"begin": "~H\\\"",
"beginCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"end": "\\\"[a-z]*",
"endCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"patterns": [
{
"include": "source.heex"
}
]
},
{
"comment": "HEEx sigil with square brackets",
"name": "text.html.heex",
"begin": "~H\\[",
"beginCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"end": "\\][a-z]*",
"endCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"patterns": [
{
"include": "source.heex"
}
]
},
{
"comment": "HEEx sigil with parentheses",
"name": "text.html.heex",
"begin": "~H\\(",
"beginCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"end": "\\)[a-z]*",
"endCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"patterns": [
{
"include": "source.heex"
}
]
},
{
"comment": "HEEx sigil with curly brackets",
"name": "text.html.heex",
"begin": "~H\\{",
"beginCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"end": "\\}[a-z]*",
"endCaptures": {
"0": {
"name": "string.quoted.double.heredoc.elixir"
}
},
"patterns": [
{
"include": "source.heex"
}
]
}
],
"scopeName": "source.elixir.heex"
}
Loading

0 comments on commit f95bb76

Please sign in to comment.