diff --git a/.gitignore b/.gitignore index 6704566..bf91931 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,5 @@ dist # TernJS port file .tern-port + +*.vsix diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0e191b5 --- /dev/null +++ b/.vscode/launch.json @@ -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}" + ] + } + ] +} \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..f369b5e --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..be3afe6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to the "meml" extension will be documented in this file. + +Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. + +## [Unreleased] + +- Initial release \ No newline at end of file diff --git a/README.md b/README.md index c5c7d7d..a0d64f3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# vscode -The VSCode extention for meml +# Fushra meml + +Meml syntax highlighting in vscode. diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..22a9f1a --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,30 @@ +{ + "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 can be used to surround a selection + "surroundingPairs": [ + //["{", "}"], + //["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..6119f7b --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "meml", + "displayName": "MEML", + "description": "MEML support for VSCode", + "publisher": "Fushra", + "version": "0.0.1", + "engines": { + "vscode": "^1.55.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [{ + "id": "meml", + "aliases": ["MEML", "meml"], + "extensions": [".meml"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "meml", + "scopeName": "source.meml", + "path": "./syntaxes/meml.tmLanguage" + }] + } +} \ No newline at end of file diff --git a/syntaxes/meml.tmLanguage b/syntaxes/meml.tmLanguage new file mode 100644 index 0000000..3141a79 --- /dev/null +++ b/syntaxes/meml.tmLanguage @@ -0,0 +1,147 @@ + + + + + + fileTypes + + meml + + name + meml + patterns + + + include + #main + + + scopeName + source.meml + uuid + + repository + + main + + patterns + + + match + (import|from|export) + name + keyword.meml + + + match + (component) + name + punctuation.definition.meml + + + match + ((?<=\(\s*)\w*(?=.*)) + name + entity.name.tag.meml + + + match + ((?<=\(component\ )\w*) + name + variable.other.constant.meml + + + match + ((?<=\()\w*(, \w*)*(?=\))) + name + variable.other.constant.meml + + + match + (\+|-|(?<!/)(/)(?!/)|\*|=) + name + punctuation.meml + + + match + (\(|\)) + name + punctuation.definition.tag.meml + + + match + ((\w*)(?==)) + name + variable.meml + + + match + (//.*) + name + comment.meml + + + begin + (") + beginCaptures + + 1 + + name + punctuation.definition.string.meml + + + contentName + string.meml + end + (") + endCaptures + + 1 + + name + punctuation.definition.string.meml + + + + + begin + (') + beginCaptures + + 1 + + name + punctuation.definition.string.meml + + + contentName + string.meml + end + (') + endCaptures + + 1 + + name + punctuation.definition.string.meml + + + + + + main__1 + + patterns + + + + main__2 + + patterns + + + + + + diff --git a/test.meml b/test.meml new file mode 100644 index 0000000..4a169af --- /dev/null +++ b/test.meml @@ -0,0 +1,22 @@ +(import (nav) from "./nav.meml") + +// Lets define a sample component +(component helloComponent (name) + (p "Hello " name ". This comes from a component!") +) +// The rest of the file +( + head + (title "Hello World!") +) +// This is a comment +( + body + (nav) + (p "Basic website made with MEML!") + (p "1 + 2 = " 1 + 2) + (p "BODMAS: " 5 - 5 * 5 + 5) + (helloComponent name="TrickyPR") +) + +(export (helloComponent)) \ No newline at end of file diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md new file mode 100644 index 0000000..0b31943 --- /dev/null +++ b/vsc-extension-quickstart.md @@ -0,0 +1,29 @@ +# Welcome to your VS Code Extension + +## What's in the folder + +* This folder contains all of the files necessary for your extension. +* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. +* `syntaxes/meml.tmLanguage` - this is the Text mate grammar file that is used for tokenization. +* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets. + +## Get up and running straight away + +* Make sure the language configuration settings in `language-configuration.json` are accurate. +* Press `F5` to open a new window with your extension loaded. +* Create a new file with a file name suffix matching your language. +* Verify that syntax highlighting works and that the language configuration settings are working. + +## Make changes + +* You can relaunch the extension from the debug toolbar after making changes to the files listed above. +* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. + +## Add more language features + +* To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs + +## Install your extension + +* To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. +* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.