https://github.com/dannymcgee/vscode-tagged-syntax
https://github.com/dannymcgee/vscode-tagged-syntax
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dannymcgee/vscode-tagged-syntax
- Owner: dannymcgee
- Created: 2022-07-03T22:45:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-03T22:45:47.000Z (almost 3 years ago)
- Last Synced: 2025-03-06T06:51:53.239Z (about 2 months ago)
- Language: TypeScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# VS Code Tagged grammar
This repo is a hacky mess. It generates embedded grammar bindings for various
tagged template literals in TypeScript for VS Code.For example, the text in this template will be highlighted as a regular expression:
```typescript
const ident = regex`/[$_a-zA-Z][$_a-zA-Z0-9]*/`;
```And this one will be highlighted as HTML:
```typescript
const message = "Hello, world!";
const heading = html`${message}
`;
```And here's some markdown:
```typescript
const markdown = md`
# To-Do List* Lorem **Ipsum**
* Dolor Sit _Amet_
* Consectetur
`;
```How about some GLSL:
```typescript
const vert = glsl`
attribute vec3 a_position;
varying vec2 v_uv;void main() {
gl_Position = vec4(a_position, 1.0);
v_uv = a_position.xy;
}
`;const frag = glsl`
varying vec2 v_uv;void main() {
gl_FragColor = vec4(v_uv, 0.0, 1.0);
}
`;
```The codebase is a wreck. I wrote it in a hurry about a year ago and never
bothered to clean it up or document anything. If you've somehow stumbled across
this and want to use it, just clone it and run:```sh
> yarn # install dependencies
> yarn test-run # build and install the extension
```Some day I might clean it up and publish it to the VS Code marketplace. But I
have a lot of projects competing for my attention, so probably not. :)