Skip to content
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

Added support for Vento language #6733

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,9 @@
[submodule "vendor/grammars/typst-grammar"]
path = vendor/grammars/typst-grammar
url = https://github.com/michidk/typst-grammar.git
[submodule "vendor/grammars/vento"]
path = vendor/grammars/vento
url = https://github.com/oscarotero/vento.git
Copy link
Member

@lildude lildude Mar 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should only be one entry per language in this file and it should be for the grammar as added by the add-grammar script. The script also sorts the file. This is not the grammar repo so doesn't belong in this file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I run script/add-grammar twice. The first one passing this repository which gives me an error. So I run again with the vscode repository which contains the grammar. I guess this line was added in the first run. Will remove it.

[submodule "vendor/grammars/verilog.tmbundle"]
path = vendor/grammars/verilog.tmbundle
url = https://github.com/textmate/verilog.tmbundle
Expand Down Expand Up @@ -1353,6 +1356,9 @@
[submodule "vendor/grammars/vscode-vba"]
path = vendor/grammars/vscode-vba
url = https://github.com/serkonda7/vscode-vba.git
[submodule "vendor/grammars/vscode-vento"]
path = vendor/grammars/vscode-vento
url = https://github.com/oscarotero/vscode-vento.git
[submodule "vendor/grammars/vscode-vlang"]
path = vendor/grammars/vscode-vlang
url = https://github.com/0x9ef/vscode-vlang
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,8 @@ vendor/grammars/vscode-slice:
vendor/grammars/vscode-vba:
- source.vba
- source.wwb
vendor/grammars/vscode-vento:
- source.vento
vendor/grammars/vscode-vlang:
- source.v
vendor/grammars/vscode-wit:
Expand Down
9 changes: 9 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8525,3 +8525,12 @@ xBase:
tm_scope: source.harbour
ace_mode: text
language_id: 421
Vento:
type: markup
color: "#ff0080"
extensions:
- ".vto"
- ".vento"
Copy link
Member

@lildude lildude Mar 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Samples and representative search links need to be provided for all extensions being added. Note, all extensions need to meet our usage requirements before inclusion so if one is less popular than another, it's probably best to remove it and people can rely on an override to force the language until it meets the usage requirement for adding at a later date.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I guess .vto is the right extension. Will remove .vento.

tm_scope: text.html.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the scope from the grammar. It should be.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run the script/add-grammar passing the vscode plugin https://github.com/oscarotero/vscode-vento as argument. I guess it's not 100% compatible and needs some changes.

ace_mode: text
language_id: 757053899
20 changes: 20 additions & 0 deletions samples/Vento/index.vto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ layout "./base.vto" }}
<div class="doc">
{{ include "templates/header.vto" }}

<main class="doc-content">
<header class="doc-header">
<h1>
{{ title }}
</h1>
{{ description |> md }}

{{ include "templates/toc.vto" }}
</header>

<div class="doc-body">
{{ content |> md }}
</div>
</main>
</div>
{{ /layout }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the sample you reference in the PR template. Either update the template of this sample.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll search better examples.

1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **Vala:** [technosophos/Vala-TMBundle](https://github.com/technosophos/Vala-TMBundle)
- **Valve Data Format:** [Nixinova/NovaGrammars](https://github.com/Nixinova/NovaGrammars)
- **Velocity Template Language:** [animecyc/AtomLanguageVelocity](https://github.com/animecyc/AtomLanguageVelocity)
- **Vento:** [gregory-m/ejs-tmbundle](https://github.com/gregory-m/ejs-tmbundle)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤨 I have no idea how you did this. This file is automatically updated when you run the add-grammar script.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me neither :)
I will edit it with the correct repository URL.

- **Verilog:** [textmate/verilog.tmbundle](https://github.com/textmate/verilog.tmbundle)
- **Vim Help File:** [Alhadis/language-viml](https://github.com/Alhadis/language-viml)
- **Vim Script:** [Alhadis/language-viml](https://github.com/Alhadis/language-viml)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/vento
Submodule vento added at d4d804
1 change: 1 addition & 0 deletions vendor/grammars/vscode-vento
Submodule vscode-vento added at 2cd251
31 changes: 31 additions & 0 deletions vendor/licenses/git_submodule/vento.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: vento
version: d4d8040f9cc08b7c1ef977b1ec10f510745b6681
type: git_submodule
homepage: https://github.com/oscarotero/vento.git
license: mit
licenses:
- sources: LICENSE
text: |
MIT License

Copyright (c) 2023 Óscar Otero

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.
notices: []
31 changes: 31 additions & 0 deletions vendor/licenses/git_submodule/vscode-vento.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: vscode-vento
version: 2cd2511e14fd0df66428ea34afd22e86a33ddb91
type: git_submodule
homepage: https://github.com/oscarotero/vscode-vento.git
license: mit
licenses:
- sources: LICENSE
text: |-
MIT License

Copyright (c) 2023 - Oscar Otero

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.
notices: []