Skip to content

chore: add vscode highlight extension #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@typescript-eslint/quotes": "off",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-explicit-any": "off",
"arrow-body-style": "error",
"arrow-body-style": "off",
"brace-style": ["error", "1tbs"],
"curly": "error",
"eol-last": "error",
Expand Down
2 changes: 2 additions & 0 deletions projects/vscode-atl-render/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set default behavior to automatically normalize line endings.
* text=auto
2 changes: 2 additions & 0 deletions projects/vscode-atl-render/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
*.vsix
17 changes: 17 additions & 0 deletions projects/vscode-atl-render/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
]
}
4 changes: 4 additions & 0 deletions projects/vscode-atl-render/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md
15 changes: 15 additions & 0 deletions projects/vscode-atl-render/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Change Log

All notable changes to the "vscode-testing-library-render" extension will be documented in this file.

## 0.0.3

- docs: add logo

## 0.0.2

- fix: highlight on next line

## 0.0.1

- feat: initial release
3 changes: 3 additions & 0 deletions projects/vscode-atl-render/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# vscode-atl-render

This extension adds HTML highlighting to the render method of the Angular Testing Library.
30 changes: 30 additions & 0 deletions projects/vscode-atl-render/language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"comments": {
"blockComment": ["<!--", "-->"]
},
"brackets": [
["<!--", "-->"],
["<", ">"],
["{", "}"],
["(", ")"],
["[", "]"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "<!--", "close": "-->", "notIn": ["comment", "string"] },
{ "open": "/**", "close": "*/", "notIn": ["string"] }
],
"surroundingPairs": [
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "`", "close": "`" },
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "<", "close": ">" }
]
}
Binary file added projects/vscode-atl-render/other/hedgehog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions projects/vscode-atl-render/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "vscode-atl-render",
"displayName": "Angular Testing Library Render Highlighting",
"description": "HTML highlighting in ATL the render method",
"version": "0.0.3",
"icon": "other/hedgehog.png",
"publisher": "timdeschryver",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/testing-library/angular-testing-library.git"
},
"homepage": "https://github.com/testing-library/angular-testing-library/blob/main/README.md",
"engines": {
"vscode": "^1.57.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"configuration": [
{
"id": "atl-render",
"title": "Angular Testing Library Render",
"properties": {
"atl-render.format.enabled": {
"type": "boolean",
"description": "Enable/disable formatting of render template strings.",
"default": true
}
}
}
],
"grammars": [
{
"scopeName": "atl.render",
"path": "./syntaxes/atl-render.json",
"injectTo": [
"source.ts"
],
"embeddedLanguages": {
"text.html": "html"
}
}
]
}
}
62 changes: 62 additions & 0 deletions projects/vscode-atl-render/syntaxes/atl-render.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"scopeName": "atl.render",
"injectionSelector": "L:source.ts -comment",
"name": "atl.render",
"patterns": [
{
"include": "#renderMethod"
}
],
"repository": {
"renderMethod": {
"name": "renderMethod",
"begin": "(?x)(\\b(?:\\w+\\.)*(?:render)\\s*)(\\()",
"beginCaptures": {
"1": {
"name": "entity.name.function.ts"
},
"2": {
"name": "meta.brace.round.ts"
}
},
"end": "(\\))",
"endCaptures": {
"0": {
"name": "meta.brace.round.ts"
}
},
"patterns": [
{
"include": "#renderTemplate"
},
{
"include": "source.ts"
}
]
},
"renderTemplate": {
"contentName": "text.html",
"begin": "[`|'|\"]",
"beginCaptures": {
"0": {
"name": "string"
}
},
"end": "\\0",
"endCaptures": {
"0": {
"name": "string"
}
},
"patterns": [
{
"include": "text.html.derivative"
},
{
"include": "template.ng"
}
]
}
}
}