Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
harshdoesdev committed Jul 21, 2023
1 parent 7817d16 commit 839db7b
Show file tree
Hide file tree
Showing 7 changed files with 284 additions and 26 deletions.
41 changes: 17 additions & 24 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
BSD 3-Clause License
MIT License

Copyright (c) 2023, fastn-stack
Copyright (c) 2020 rwbeast

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
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:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# fastn-vscode
The fastn language syntax highlighter for VSCode editor
# Fastn (FTD) Language Syntax Highlighting for Visual Studio Code

This extension provides syntax highlighting support for the Fastn (FTD) or FifthTry Document language in Visual Studio Code. Enjoy enhanced readability of your FTD code with vibrant and accurate syntax highlighting.

## Usage

Install the extension and open any `.ftd` file to automatically enable syntax highlighting for the FTD language.

## Feedback and Contributions

We welcome feedback and contributions. Please visit our GitHub repository to report issues or submit pull requests.

Enjoy coding with the FTD Language Syntax Highlighting extension for Visual Studio Code!
Binary file added fastn-syntax-0.0.3.vsix
Binary file not shown.
8 changes: 8 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"comments": {
"lineComment": ";;",
},
"brackets": [],
"autoClosingPairs": [],
"surroundingPairs": []
}
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "fastn-syntax",
"version": "0.0.3",
"publisher": "FifthTry private limited",
"engines": {
"vscode": "^1.0.0"
},
"repository": "https://github.com/harshdoesdev/fastn-syntax",
"categories": [
"Programming Languages"
],
"license": "MIT",
"contributes": {
"languages": [
{
"id": "ftd",
"aliases": [
"FifthTry Document"
],
"extensions": [
"ftd"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "ftd",
"scopeName": "source.ftd",
"path": "./syntax/ftd.tmLanguage.json"
}
],
"icon": "resources/[email protected]"
}
}
Binary file added resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
211 changes: 211 additions & 0 deletions syntax/ftd.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "FifthTry Document (.ftd)",
"comment": "Fastn (FTD) Language Syntax Highlighting",
"fileTypes": ["ftd"],
"scopeName": "source.ftd",
"patterns": [
{
"name": "entity.section.begin.container.ftd",
"match": "(--\\s*)(ftd\\..*|component|integer|decimal|string)\\s+(\\w+)|(import):",
"captures": {
"1": { "name": "punctuation.definition.section.begin.ftd" },
"2": { "name": "storage.type.ftd" },
"3": { "name": "entity.name.section.container.ftd" }
}
},
{
"name": "keyword.other.ftd",
"match": "\\b(caption|body|optional|integer|decimal|string|record|list)\\b",
"captures": {
"0": { "name": "keyword.other.ftd" }
}
},
{
"name": "entity.section.begin.record.ftd",
"match": "--\\s*record\\s+(\\w+):",
"captures": {
"1": { "name": "entity.name.section.record.ftd" }
}
},
{
"name": "entity.section.begin.user-defined.ftd",
"match": "(--\\s*)(\\w+.*):",
"captures": {
"1": { "name": "punctuation.definition.section.begin.ftd" },
"2": { "name": "entity.name.section.user-defined.ftd" }
}
},
{
"name": "entity.section.end.ftd",
"match": "(--\\s*)(end:)\\s*(\\w+)",
"captures": {
"1": { "name": "punctuation.definition.section.end.ftd" },
"2": { "name": "entity.name.section.end.ftd" }
}
},
{
"name": "entity.section.begin.element.ftd",
"match": "--\\s*(\\w+):",
"captures": {
"1": { "name": "entity.name.section.element.ftd" }
}
},
{
"name": "entity.variable.ftd",
"match": "(--\\s*)(integer|decimal|string|record)\\s+(\\w+):\\s+(.*)",
"captures": {
"1": { "name": "punctuation.definition.variable.begin.ftd" },
"2": { "name": "storage.type.ftd" },
"3": { "name": "variable.other.dollar-sign.ftd" },
"4": { "name": "meta.property.value.ftd" }
}
},
{
"name": "entity.property.name.ftd",
"match": "\\b[\\w.]+(\\s*-\\s*[\\w.]+)*(?=\\s*:\\s)",
"captures": {
"0": { "name": "entity.name.tag.ftd" }
}
},
{
"name": "entity.property.ftd",
"begin": "\\b\\w+(\\s*-\\s*\\w+)*\\s*:",
"end": "(?=$|\\r?\\n)",
"captures": {
"0": { "name": "meta.property.name.ftd" }
},
"patterns": [
{
"name": "string.value.ftd",
"match": "\\b\\w+\\b",
"captures": {
"0": { "name": "constant.other.key.ftd" }
}
},
{
"name": "string.value.ftd",
"match": "'.*?'",
"captures": {
"0": { "name": "string.quoted.single.ftd" }
}
},
{
"name": "string.value.ftd",
"match": "\".*?\"",
"captures": {
"0": { "name": "string.quoted.double.ftd" }
}
},
{
"name": "number.value.ftd",
"match": "\\b\\d+(?:\\.\\d+)?\\b",
"captures": {
"0": { "name": "constant.numeric.ftd" }
}
},
{
"name": "string.value.ftd",
"match": "\\\\[^\n]*",
"captures": {
"0": { "name": "comment.block.escape.ftd" }
}
},
{
"name": "meta.comment.inline.ftd",
"match": ";.*",
"captures": {
"0": { "name": "comment.line.semicolon.ftd" }
}
}
]
},
{
"name": "meta.comment.inline.ftd",
"match": "(?<!\\\\);;.*",
"captures": {
"0": { "name": "comment.line.semicolon.ftd" }
}
},
{
"name": "meta.comment.escape.ftd",
"match": "\\\\[-a-zA-Z0-9_:.]+",
"captures": {
"0": { "name": "comment.block.escape.ftd" }
}
},
{
"name": "comment.block.outline.ftd",
"begin": "\\\\--",
"end": "(?=(--\\s*end:\\s*\\w+)|(--\\s*\\w+.*:)|$)",
"captures": {
"0": { "name": "comment.block.outline.begin.ftd" }
}
},
{
"name": "comment.block.element.ftd",
"begin": "\\\\--\\s*(\\w+):",
"end": "(?=(--\\s*\\w+.*:)|$)",
"captures": {
"1": { "name": "entity.name.section.element.ftd" }
}
},
{
"name": "keyword.control.ftd",
"match": "if:",
"captures": {
"0": { "name": "keyword.control.if.ftd" }
}
},
{
"name": "keyword.operator.ftd",
"match": "\\+|-|\\*|/|%|\\^|>=|<=|==|!=|>|<",
"captures": {
"0": { "name": "keyword.operator.ftd" }
}
},
{
"name": "variable.internal.ftd",
"match": "\\$inherited\\$",
"captures": {
"0": { "name": "variable.other.internal.ftd" }
}
},
{
"name": "variable.processor.ftd",
"match": "\\$\\w+\\$",
"captures": {
"0": { "name": "variable.other.processor.ftd" }
}
},
{
"name": "variable.loop.ftd",
"match": "\\$\\w+\\$\\s+\\w+\\s+(as)\\s+\\w+",
"captures": {
"0": { "name": "variable.other.loop.ftd" },
"2": { "name": "keyword.other.loop.as.ftd" },
"3": { "name": "variable.other.loop.name.ftd" }
}
},
{
"name": "variable.access.ftd",
"match": "\\$\\w+\\b",
"captures": {
"0": { "name": "variable.other.dollar-sign.ftd" }
}
}
],
"repository": {
"string": {
"patterns": [
{
"name": "constant.character.escape.ftd",
"match": "\\\\.",
"captures": {
"0": { "name": "constant.character.escape.ftd" }
}
}
]
}
}
}

0 comments on commit 839db7b

Please sign in to comment.