Skip to content

Commit

Permalink
feat(initial release): initial release. bugs are kind of expected
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaschel committed Aug 5, 2022
1 parent ad1cfbf commit 27004af
Show file tree
Hide file tree
Showing 130 changed files with 22,659 additions and 2,655 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test/* linguist-vendored
*.png binary
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.vsix
.DS_store
.vscode
*.sh
.hushlogin
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sudo: false
language: node_js
node_js:
- '10.8.0'
script: gulp compile-json
5 changes: 5 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.gitignore
src/**
test/**
gulpfile.js
travis.yml
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright for portions of project vscode-angular-html are held by [Clay Dunston, 2018]
as part of project vscode-angular-syntax. All other copyright for project
vscode-angular-html are held by [Guilherme Haschel, 2018].

MIT License

Copyright (c) 2018 Guilherme Haschel <ghaschel@gmail.com>

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.

133 changes: 131 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,132 @@
# vscode-angular-ts
# vscode-angular-html

WIP
[![SemVer](https://img.shields.io/github/tag/ghaschel/vscode-angular-html.svg)](https://img.shields.io/github/tag/ghaschel/vscode-angular-html.svg)
[![GitHub issues](https://img.shields.io/github/issues/ghaschel/vscode-angular-html.svg)](https://github.com/ghaschel/vscode-angular-html/issues)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ghaschel/vscode-angular-html/blob/master/LICENSE)
[![Build status](https://travis-ci.org/ghaschel/vscode-angular-html.svg?branch=master)](https://travis-ci.org/ghaschel/vscode-angular-html.svg?branch=master)
[![Installs](https://vsmarketplacebadge.apphb.com/installs-short/ghaschel.vscode-angular-html.svg?style=flat&color=blue)](https://marketplace.visualstudio.com/items?itemName=ghaschel.vscode-angular-html)
[![Version](https://vsmarketplacebadge.apphb.com/version-short/ghaschel.vscode-angular-html.svg?style=flat&color=blue)](https://marketplace.visualstudio.com/items?itemName=ghaschel.vscode-angular-html) [![Greenkeeper badge](https://badges.greenkeeper.io/ghaschel/vscode-angular-html.svg)](https://greenkeeper.io/)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

<div align="center">
<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/angular-html.png" title="vscode-angular-html" alt="Logo" />
</div>

## Angular HTML Template Syntax Highlighting

This plugin adds syntax highlighting for angular HTML template files in VS Code. It supports the angular syntax itself, HTML DOM events and emphasizes deprecated and obsolete tags and attributes usage according to the current status of HTML.

> Note: VSCode's default Dark+ theme doesn't have the highlighting displayed in these images. For that effect I recommend using [dark-plus-syntax](https://marketplace.visualstudio.com/items?itemName=dunstontc.dark-plus-syntax) theme.
> Other themes that have similar highlighting: [cobalt2](https://marketplace.visualstudio.com/items?itemName=wesbos.theme-cobalt2), [dracula / dracula soft](https://marketplace.visualstudio.com/items?itemName=dracula-theme.theme-dracula) and [and old hope classic](https://marketplace.visualstudio.com/items?itemName=dustinsanders.an-old-hope-theme-vscode).
## Summary

- [Angular directives](#angular-directives)
- [Doctype](#doctype)
- [Comments](#comments)
- [Invalid attributes](#invalid-attributes)
- [Angular interpolations](#angular-interpolations)
- [Angular structural tags](#angular-structural-tags)
- [Entities](#html-entities)
- [Regex](#regex)
- [Deprecated tags](#deprecated-tags)
- [DOM Events](#dom-events)
- [Style inline](#style-inline)
- [Style tag](#style-tag)
- [Script tags](#script-tags)
- [Generic attributes](#generic-attributes)

### Angular directives

<span name="angular-directives"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/angular-directives.gif" title="Angular directives" alt="Angular directives" />

### Doctype

<span name="doctype"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/doctype.png" title="vscode-angular-html" alt="Doctype" />

### Comments

<span name="comments"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/comments.png" title="vscode-angular-html" alt="Comments" />

### Invalid attributes [see complete list](DEPRECATED-ATTRIBUTES.md)

<span name="invalid-attributes"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/invalid-attributes.png" title="Invalid attributes" alt="Invalid attributes" />


### Angular interpolations (with safe navigation operator)

<span name="angular-interpolations"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/angular-interpolations.png" title="Angular Interpolations" alt="Angular Interpolations" />

### Angular structural tags

<span name="angular-structural-tags"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/angular-structural-tags.png" title="Angular Structural Tags" alt="Angular Structural Tags" />

### Entities

<span name="html-entities"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/html-entities.png" title="HTML Entities" alt="HTML Entities" />

### Regex

<span name="regex"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/regex.png" title="vscode-angular-html" alt="Regex" />

### Deprecated tags [see complete list](DEPRECATED-TAGS.md)

<span name="deprecated-tags"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/deprecated-tags.png" title="Deprecated tags" alt="Deprecated tags" />

### DOM events [see complete list](DOM-EVENTS.md)

<span name="dom-events"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/dom-events.png" title="DOM events" alt="DOM events" />

### Style inline

<span name="style-inline"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/style-inline.png" title="Style inline" alt="Style inline" />

### Style tag (scss/stylus)

<span name="style-tag"></span>

> Note: stylus is only supported via [language-stylus](https://marketplace.visualstudio.com/items?itemName=sysoev.language-stylus)
<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/style-tag.png" title="Style tag" alt="Style tag" />

### Script tag

<span name="script-tags"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/script-tag.png" title="Script tags" alt="Script tag" />

### Generic attributes

<span name="generic-attributes"></span>

<img src="https://raw.githubusercontent.com/ghaschel/vscode-angular-html/master/assets/generic-attributes.png" title="Generic attributes" alt="Generic attributes" />

## Disclaimer

> The development of this plugin serves as a way for me to train Regex, so may not be 100% correct. Feel free to submit a pull request if needed.
> Based in the original work of [dunstontc](https://github.com/dunstontc/vscode-angular-syntax)
## [Changelog](CHANGELOG.md)
Binary file added assets/angular-directives.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/angular-html.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/angular-interpolations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/angular-structural-tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/comments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/deprecated-tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/doctype.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/dom-events.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/generic-attributes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/html-entities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/invalid-attributes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/regex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/script-tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/style-inline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/style-tag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'improvement', 'perf', 'refactor', 'revert', 'style', 'test'],
],
},
};
69 changes: 69 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
const gulp = require("gulp");
const merge = require("gulp-merge-json");
const json5 = require("gulp-json5-to-json");
const package = require("./package.json");
const homedir = require("os").homedir();
const edit = require("gulp-json-editor");
const scopes = package.contributes.grammars.map((scope) => scope.scopeName);

function watch() {
return gulp.watch("./src/**/*.json5", gulp.series(["compile-json"]));
}

function compile(cb) {
scopes.forEach((scope) => {
gulp
.src("./src/**/*.json5")
.pipe(
merge({
fileName: `${scope}.json`,
json5: true,
})
)
.pipe(
json5({
beautify: true,
})
)
.pipe(
edit({
scopeName: `${scope}`,
})
)
.pipe(gulp.dest("./syntaxes"));
});

cb();
}

function copy(cb) {
scopes.forEach((scope) => {
gulp
.src(`./syntaxes/${scope}.json`)
.pipe(
gulp.dest(
`${homedir}/.vscode/extensions/ghaschel.vscode-angular-ts-${package.version}/syntaxes`
)
);
});

gulp
.src(`./package.json`)
.pipe(
gulp.dest(
`${homedir}/.vscode/extensions/ghaschel.vscode-angular-ts-${package.version}`
)
);

cb();
}

gulp.task("compile-json", gulp.series([compile, copy]));

gulp.task("watch", () => {
return watch();
});

gulp.task("default", () => {
return watch();
});
61 changes: 32 additions & 29 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "//",
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
"blockComment": [ "/*", "*/" ]
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
// symbols that that can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
]
}
"comments": {
"blockComment": ["<!--", "-->"]
},
"brackets": [
["<!--", "-->"],
["<", ">"],
["{", "}"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "<!--", "close": "-->", "notIn": ["comment", "string"] }
],
"surroundingPairs": [
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "<", "close": ">" }
],
"folding": {
"markers": {
"start": "^\\s*<!--\\s*#region\\b.*-->",
"end": "^\\s*<!--\\s*#endregion\\b.*-->"
}
}
}
Loading

0 comments on commit 27004af

Please sign in to comment.