-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7fdbf16
Showing
15 changed files
with
2,750 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "./tsconfig.json", | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@stylistic", | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/strict-type-checked", | ||
"plugin:@typescript-eslint/stylistic-type-checked" | ||
], | ||
"rules": { | ||
"@stylistic/quotes": ["error", "double"], | ||
"@stylistic/semi": ["error", "never"], | ||
"@stylistic/indent": ["error", 4], | ||
"@typescript-eslint/consistent-type-definitions": ["error", "type"], | ||
"curly": "error", | ||
"eqeqeq": "error", | ||
"no-throw-literal": "error", | ||
"prefer-const": "error" | ||
}, | ||
"ignorePatterns": [ | ||
"out", | ||
"dist", | ||
"**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Temporary files created by various text editors. | ||
*~ | ||
|
||
# Merge files created by git. | ||
*.orig | ||
# Reject files created by git. | ||
*.rej | ||
|
||
# Vim swap files. | ||
.*.sw? | ||
.sw? | ||
|
||
# OS X specific files. | ||
.DS_store | ||
|
||
# Build artifacts and outputs. | ||
/out | ||
/dist | ||
/node_modules | ||
/*.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// A launch configuration that compiles the extension and then opens it 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": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js" | ||
], | ||
"preLaunchTask": "watch" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"files.exclude": { | ||
"out": false // set this to true to hide the "out" folder with the compiled JS files | ||
}, | ||
"search.exclude": { | ||
"out": true // set this to false to include "out" folder in search results | ||
}, | ||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts | ||
"typescript.tsc.autoDetect": "off" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "watch", | ||
"type": "npm", | ||
"script": "watch", | ||
"options": { | ||
"shell": { | ||
"executable": "cmd.exe", | ||
"args": ["/d", "/c"] | ||
} | ||
}, | ||
"problemMatcher": "$tsc-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
.gitignore | ||
.yarnrc | ||
src/** | ||
**/tsconfig.json | ||
**/.eslintrc.json | ||
**/*.map | ||
**/*.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [0.1.0](https://github.com/deimonn/code-re2c/releases/tag/v0.1.0) - 2024-04-26 | ||
|
||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2024 Deimonn (a.k.a. Nahuel S. Cisterna) | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Code re2c | ||
|
||
Experimental linting and syntax highlighting for [re2c]! | ||
|
||
## How to use | ||
|
||
### File associations | ||
|
||
`re2c` code blocks will be automatically detected within C, C++, Go and Rust | ||
source files. In addition, this extension also creates the following default | ||
associations: | ||
|
||
Extension | Language | ||
-- | -- | ||
`*.re`, `*.c.re` | C | ||
`*.cc.re`, `*.cpp.re`, `*.cxx.re` | C++ | ||
`*.go.re` | Go | ||
`*.rs.re` | Rust | ||
|
||
If you don't like the default `*.re` being tied to C, you can override it by | ||
just modifying your `files.associations` in your `settings.json` file. For | ||
example, to make the default language C++: | ||
|
||
```JSON | ||
"files.associations": { | ||
"*.re": "cpp" | ||
} | ||
``` | ||
|
||
### Linting | ||
|
||
Linting occurs only when you open a document or save it, as it relies on running | ||
and parsing command output. | ||
|
||
A [re2c] binary somewhere in your system is required for it. If its not on your | ||
`PATH`, you can manually set the path to it in your settings: | ||
|
||
```JSON | ||
"code-re2c.re2c.path": "/path/to/re2c" | ||
``` | ||
|
||
By default, only the `-W` flag is passed to the re2c binary. You can override | ||
the arguments to pass in your settings: | ||
|
||
```JSON | ||
"code-re2c.re2c.arguments": ["-W", "-Werror-empty-character-class"] | ||
``` | ||
|
||
[re2c]: http://re2c.org/ | ||
|
||
## Known issues | ||
|
||
- Flex syntax mode is unsupported. Syntax highlighting is bound to be skewed | ||
when using features pertaining to it. | ||
|
||
- Code blocks of C/C++/Go/Rust *within* a re2c block won't get properly colored. | ||
TextMate is simply too much of a headache to implement such a thing. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.