Skip to content

Commit

Permalink
Merge pull request #3 from torxjs/develop
Browse files Browse the repository at this point in the history
Update for Torx v1.0.0
  • Loading branch information
stephen-ullom authored May 9, 2022
2 parents 8f367e7 + 5cff212 commit ff4fb62
Show file tree
Hide file tree
Showing 12 changed files with 169 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.DS_Store
*.vsix
/node_modules
/out
/dist
37 changes: 20 additions & 17 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"group": {
"kind": "build",
"isDefault": true
},
"label": "tsc: watch - tsconfig.json"
}
]
}
"version": "2.0.0",
"tasks": [
{
"label": "TypeScript | Watch",
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": ["$tsc-watch"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "Extention | Package",
"command": "vsce package"
}
]
}
34 changes: 23 additions & 11 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
## 1.0.1

8 May 2022

- Fix icon position

## 1.0.0

8 May 2022

- Support for Torx v1.0.0

## 0.3.0

11 Sept 2021

- Fixed code formatting.
- Increased supported Code version to 1.14.0 and later.
- Fixed code formatting.
- Increased supported Code version to 1.14.0 and later.

## 0.2.2

31 July 2021

- Respect user tab size configuration.
- Respect user tab size configuration.

## 0.2.1

18 Mar 2021

- Fix default language for html files.
- Update readme.
- Fix default language for html files.
- Update readme.

## 0.2.0

20 Dec 2020

- Removed `@//` comment.
- Improved formatting.
- Improved syntax highlighting.
- Removed `@//` comment.
- Improved formatting.
- Improved syntax highlighting.

## 0.1.0

8 Dec 2020

- Added Torx formatter.
- Improved icon.
- Added Torx formatter.
- Improved icon.

## 0.0.1

6 Mar 2018

- Initial Commit.
- Initial Commit.
Binary file modified images/icon.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 modified images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion language-configuration.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"comments": {
"lineComment": "@//",
"lineComment": "@/",
"blockComment": ["@*", "*@"]
},
"brackets": [
Expand Down
128 changes: 64 additions & 64 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
{
"name": "torx",
"displayName": "Torx",
"description": "Torx syntax and snippets.",
"version": "0.3.0",
"publisher": "stephen-ullom",
"engines": {
"vscode": "^1.14.0"
},
"categories": [
"Programming Languages",
"Formatters",
"Snippets"
],
"repository": {
"type": "git",
"url": "https://github.com/stephen-ullom/vscode-torx.git"
},
"icon": "images/icon.png",
"galleryBanner": {
"color": "#111111",
"theme": "dark"
},
"activationEvents": [
"onLanguage:torx"
],
"main": "out/extension.js",
"contributes": {
"commands": [
{
"command": "extension.torx",
"title": "Torx: Format document"
}
],
"languages": [
{
"id": "torx",
"extensions": [
".torx"
],
"aliases": [
"Torx",
"torx"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "torx",
"scopeName": "text.torx",
"path": "./syntaxes/torx.tmLanguage.json"
}
],
"snippets": [
{
"language": "torx",
"path": "./snippets/torx.snippets.json"
}
]
},
"devDependencies": {
"@types/node": "^16.7.10",
"@types/vscode": "^1.14.0"
}
"name": "torx",
"displayName": "Torx",
"description": "Torx syntax and snippets.",
"version": "1.0.1",
"publisher": "slulego",
"engines": {
"vscode": "^1.14.0"
},
"categories": [
"Programming Languages",
"Formatters",
"Snippets"
],
"repository": {
"type": "git",
"url": "https://github.com/torxjs/vscode-torx.git"
},
"icon": "images/icon.png",
"galleryBanner": {
"color": "#111111",
"theme": "dark"
},
"activationEvents": [
"onLanguage:torx"
],
"main": "dist/extension.js",
"contributes": {
"commands": [
{
"command": "extension.torx",
"title": "Torx: Format document"
}
],
"languages": [
{
"id": "torx",
"extensions": [
".torx"
],
"aliases": [
"Torx",
"torx"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "torx",
"scopeName": "text.torx",
"path": "./syntaxes/torx.tmLanguage.json"
}
],
"snippets": [
{
"language": "torx",
"path": "./snippets/torx.snippets.json"
}
]
},
"devDependencies": {
"@types/node": "^16.7.10",
"@types/vscode": "^1.14.0"
}
}
18 changes: 6 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# Torx for Visual Studio Code

![Screenshot](https://raw.githubusercontent.com/stephen-ullom/vscode-torx/master/images/screenshot.png "Editor Screenshot")

## Features

- Formatting
- Syntax highlighting
- Snippets

## Download
Torx is the TypeScript template engine for node.

Install the [npm package](https://www.npmjs.com/package/torx).

Install the extension from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Slulego.torx).
## Features

## Contribute
- Code formatting
- Syntax highlighting
- Snippets

View the extension repository on [GitHub](https://github.com/stephen-ullom/vscode-torx)
![Screenshot](https://raw.githubusercontent.com/torxjs/vscode-torx/develop/images/screenshot.png "Editor Screenshot")
101 changes: 36 additions & 65 deletions snippets/torx.snippets.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,37 @@
{
"For Loop": {
"prefix": "f@or",
"body": [
"@for (let ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {",
"\t$0",
"}"
],
"description": "For Loop"
},
"For-In Loop": {
"prefix": "@forin",
"body": [
"@for (const ${1:key} in ${2:object}) {",
"\t$0",
"}"
],
"description": "For-In Loop"
},
"For-Of Loop": {
"prefix": "@forof",
"body": [
"@for (const ${1:iterator} of ${2:object}) {",
"\t$0",
"}"
],
"description": "For-Of Loop"
},
"Function Statement": {
"prefix": "@function",
"body": [
"@function ${1:name}(${2:params}:${3:type}) {",
"\t$0",
"}"
],
"description": "Function Statement"
},
"Include Function": {
"prefix": "@include",
"body": [
"@include(${1:filePath}) () {",
"\t$0"
],
"description": "Inlude Function"
},
"If Statement": {
"prefix": "@if",
"body": [
"@if (${1:condition}) {",
"\t$0",
"}"
],
"description": "If Statement"
},
"If-Else Statement": {
"prefix": "@ifelse",
"body": [
"@if (${1:condition}) {",
"\t$0",
"} else {",
"\t",
"}"
],
"description": "If-Else Statement"
}
}
"For Loop": {
"prefix": "@for",
"body": ["@for (let ${1:index} = 0; ${1:index} < ${2:array}.length; ${1:index}++) {", "\t$0", "}"],
"description": "For loop"
},
"For-In Loop": {
"prefix": "@forin",
"body": ["@for (const ${1:key} in ${2:object}) {", "\t$0", "}"],
"description": "Loop through keys"
},
"For-Of Loop": {
"prefix": "@forof",
"body": ["@for (const ${1:iterator} of ${2:object}) {", "\t$0", "}"],
"description": "Loop through values"
},
"Function Statement": {
"prefix": "@function",
"body": ["@function ${1:name}(${2:params}:${3:type}) {", "\t$0", "}"],
"description": "Define a new function"
},
"Include File": {
"prefix": "@include",
"body": ["@include(${1:filePath}, ${2:data})"],
"description": "Include a file"
},
"If Statement": {
"prefix": "@if",
"body": ["@if (${1:condition}) {", "\t$0", "}"],
"description": "If statement"
},
"If-Else Statement": {
"prefix": "@ifelse",
"body": ["@if (${1:condition}) {", "\t$0", "} else {", "\t", "}"],
"description": "If-Else statement"
}
}
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function formatDocument(document: vscode.TextDocument, useSpaces = true, tabSize
// start multiline comment
charIndex++;
commentDepth++;
} else if (lineTextRemaining.charAt(1) === "/" && lineTextRemaining.charAt(2) === "/") {
} else if (lineTextRemaining.charAt(1) === "/") {
// single line comment
charIndex += lineTextRemaining.length;
}
Expand Down
Loading

0 comments on commit ff4fb62

Please sign in to comment.