Skip to content

Convert syntax file to Typescript #20

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 2 commits into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Autogenerated synax files
syntax/syntaxes/Scala.tmLanguage.json

syntax/node_modules
11 changes: 11 additions & 0 deletions syntax/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
{
"version": "0.1.0",
"configurations": [
{
"type": "extensionHost",
"request": "launch",
"name": "Build && Launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"preLaunchTask": "Generate Scala language file"
},

{
"name": "Launch Extension",
"type": "extensionHost",
Expand Down
16 changes: 16 additions & 0 deletions syntax/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Generate Scala language file",
"type": "shell",
"command": "npx ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
5 changes: 5 additions & 0 deletions syntax/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode/**
.vscode-test/**
.gitignore
tests/**
src/**
16 changes: 16 additions & 0 deletions syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,25 @@ Extension providing Scala syntax.

No requirements.

## Development

The source language file is located at `src/typescript/Scala.tmlanguage.ts`. The output tmLanguage file `syntaxes/Scala.tmLanguage.json` is marked as ignored in git and shouldn't be commited.

To generate the ouput file either use build command or run:

```bash
npm install
npm build
npx ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json
```

The output file is validated against the json schema before being written.


## Based on
* Plugin: https://github.com/daltonjorge/vscode-scala
* Template: https://github.com/sellmerfud/scala.tmbundle (https://github.com/mads-hartmann/scala.tmbundle)
* Textmate json schema: https://github.com/Septh/tmlanguage/blob/master/tmLanguage.schema.json

## License
[MIT](LICENSE)
Expand Down
136 changes: 136 additions & 0 deletions syntax/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions syntax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"icon": "images/smooth-spiral.png",
"categories": [
"Languages"
"Programming Languages"
],
"contributes": {
"languages": [
Expand All @@ -37,8 +37,15 @@
{
"language": "scala",
"scopeName": "source.scala",
"path": "./syntaxes/Scala.tmLanguage"
"path": "./syntaxes/Scala.tmLanguage.json"
}
]
},
"devDependencies": {
"@types/node": "^11.11.4",
"ajv": "^6.10.0",
"ts-node": "^8.0.2",
"tsc": "^1.20150623.0",
"typescript": "^3.3.3"
}
}
Loading