Skip to content

Commit

Permalink
more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
harrydowning committed Aug 25, 2024
1 parent 2922685 commit a8af8f8
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 967 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ The following list shows all valid identifiers for the built-in languages:
| clojure | `clojure` |
| coffeescript | `coffee` |
| cpp | `cpp`, `c++` |
| csharp | `csharp` |
| csharp | `csharp`, `c#` |
| css | `css` |
| cuda-cpp | `cuda` |
| dart | `dart` |
| diff | `diff` |
| dockercompose | `dockercompose` |
| dockerfile | `dockerfile` |
| fsharp | `fsharp` |
| fsharp | `fsharp`, `f#` |
| git-commit | `commit` |
| git-rebase | `rebase` |
| go | `go` |
Expand Down
34 changes: 25 additions & 9 deletions example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,9 @@ handlebars-example: | # handlebars
{{Hello}}, {{World}}!
hlsl-example: | # hlsl
// First Line Issue
#ifdef GL_ES
precision mediump float;
#endif
uniform float u_time;
void main() {
gl_FragColor = vec4(1.0,0.0,0.0,1.0);
float4 PS_Main(float4 pos : SV_Position) : SV_Target
{
return float4(1.0f, 0.0f, 0.0f, 1.0f);
}
html-example: | # html
Expand Down Expand Up @@ -304,3 +298,25 @@ scss-example: | # scss
h1::before {
content: $content;
}
shaderlab-example: | # shaderlab
Shader "Examples/ShaderSyntax"
{
CustomEditor = "ExampleCustomEditor"
Properties
{
// Material property declarations go here
}
SubShader
{
// The code that defines the rest of the SubShader goes here
Pass
{
// The code that defines the Pass goes here
}
}
Fallback "ExampleFallbackShader"
}
21 changes: 10 additions & 11 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const LANGUAGES = {
bat: "source.batchfile",
bibtex: "text.bibtex",
c: "source.c",
"c#": {
name: "csharp",
scopeName: "source.cs",
},
"c\\+\\+": {
name: "cpp",
scopeName: "source.cpp",
Expand Down Expand Up @@ -43,6 +47,10 @@ const LANGUAGES = {
},
dockercompose: "source.yaml",
dockerfile: "source.dockerfile",
"f#": {
name: "fsharp",
scopeName: "source.fsharp",
},
fsharp: "source.fsharp",
go: "source.go",
groovy: "source.groovy",
Expand Down Expand Up @@ -190,7 +198,7 @@ const getRepository = (languages) => {
entries.map(([id, { scopeName, stripIndent }]) => [
`${id}-${REPOSITORY_SUFFIX}`,
{
begin: `(?i)(?:(\\|)|(>))([1-9])?([-+])?[ \t]+(#[ \t]*(?:${id})[ \t]*\\n)`,
begin: `(?i)(?:(\\|)|(>))([1-9])?([-+])?\\s+(#\\s*(?:${id})\\s*\\n)`,
beginCaptures: {
1: {
name: "keyword.control.flow.block-scalar.literal.yaml",
Expand All @@ -205,16 +213,7 @@ const getRepository = (languages) => {
name: "storage.modifier.chomping-indicator.yaml",
},
5: {
patterns: [
{
begin: "#",
beginCaptures: {
0: { name: "punctuation.definition.comment.yaml" },
},
end: "\\n",
},
],
name: "comment.line.number-sign.yaml",
name: "entity.name.type.yaml",
},
},
end: "^(?=\\S)|(?!\\G)",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"meta.embedded.inline.bat": "bat",
"meta.embedded.inline.bibtex": "bibtex",
"meta.embedded.inline.c": "c",
"meta.embedded.inline.c#": "csharp",
"meta.embedded.inline.c\\+\\+": "cpp",
"meta.embedded.inline.clojure": "clojure",
"meta.embedded.inline.coffee": "coffeescript",
Expand All @@ -50,6 +51,7 @@
"meta.embedded.inline.diff": "diff",
"meta.embedded.inline.dockercompose": "dockercompose",
"meta.embedded.inline.dockerfile": "dockerfile",
"meta.embedded.inline.f#": "fsharp",
"meta.embedded.inline.fsharp": "fsharp",
"meta.embedded.inline.go": "go",
"meta.embedded.inline.groovy": "groovy",
Expand Down
Loading

0 comments on commit a8af8f8

Please sign in to comment.