diff --git a/.gitmodules b/.gitmodules index 7e22d7ba2e..cb82439195 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1238,6 +1238,9 @@ [submodule "vendor/grammars/turtle.tmbundle"] path = vendor/grammars/turtle.tmbundle url = https://github.com/peta/turtle.tmbundle +[submodule "vendor/grammars/typespec"] + path = vendor/grammars/typespec + url = https://github.com/microsoft/typespec.git [submodule "vendor/grammars/typst-grammar"] path = vendor/grammars/typst-grammar url = https://github.com/michidk/typst-grammar.git diff --git a/grammars.yml b/grammars.yml index 4a05ec7ead..cae55fab4e 100644 --- a/grammars.yml +++ b/grammars.yml @@ -1105,6 +1105,8 @@ vendor/grammars/toml.tmbundle: vendor/grammars/turtle.tmbundle: - source.sparql - source.turtle +vendor/grammars/typespec: +- source.tsp vendor/grammars/typst-grammar: - source.typst vendor/grammars/verilog.tmbundle: diff --git a/lib/linguist/heuristics.yml b/lib/linguist/heuristics.yml index 67891bd2ab..c8125abfde 100644 --- a/lib/linguist/heuristics.yml +++ b/lib/linguist/heuristics.yml @@ -772,6 +772,12 @@ disambiguations: - language: XML pattern: ' { + @statusCode _: 304; + @body body: Body; +} + +@friendlyName("{name}ListResults", Item) +model ResponsePage { + items: Item[]; + nextLink?: string; +} + +model PetId { + @path petId: int32; +} + +@doc("Manage your pets.") +@route("/pets") +namespace Pets { + @doc("Delete a pet.") + @delete + op delete(...PetId): OkResponse | Error; + + @fancyDoc("List pets.") + op list(@query nextLink?: string): ResponsePage | Error; + + @doc("Returns a pet. Supports eTags.") + op read(...PetId): Pet | (NotModifiedResponse & Pet) | Error; + + @post op create(@body pet: Pet): Pet | Error; +} + +@route("/pets/{petId}/toys") +namespace ListPetToysResponse { + op list(@path petId: string, @query nameFilter: string): ResponsePage | Error; +} \ No newline at end of file diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 8277ceba53..5e8825b8cf 100755 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -1023,6 +1023,13 @@ def test_ts_by_heuristics }) end + def test_tsp_by_heuristics + assert_heuristics({ + "TypeSpec" => all_fixtures("TypeSpec", "*.tsp"), + "TSPLIB data" => all_fixtures("TSPLIB data", "*.tsp") + }) + end + def test_tst_by_heuristics assert_heuristics({ "GAP" => all_fixtures("GAP", "*.tst"), diff --git a/vendor/README.md b/vendor/README.md index 71363f19a7..9d985ecdac 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -590,6 +590,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **Twig:** [Anomareh/PHP-Twig.tmbundle](https://github.com/Anomareh/PHP-Twig.tmbundle) - **Type Language:** [goodmind/language-typelanguage](https://github.com/goodmind/language-typelanguage) - **TypeScript:** [tree-sitter/tree-sitter-typescript](https://github.com/tree-sitter/tree-sitter-typescript) 🐌 +- **TypeSpec:** [microsoft/typespec](https://github.com/microsoft/typespec) - **Typst:** [michidk/typst-grammar](https://github.com/michidk/typst-grammar) - **Unified Parallel C:** [textmate/c.tmbundle](https://github.com/textmate/c.tmbundle) - **Unity3D Asset:** [atom/language-yaml](https://github.com/atom/language-yaml) diff --git a/vendor/grammars/typespec b/vendor/grammars/typespec new file mode 160000 index 0000000000..ce9c567e5b --- /dev/null +++ b/vendor/grammars/typespec @@ -0,0 +1 @@ +Subproject commit ce9c567e5bfb441bb6415699a6b6fa797bc08f2e diff --git a/vendor/licenses/git_submodule/typespec.dep.yml b/vendor/licenses/git_submodule/typespec.dep.yml new file mode 100644 index 0000000000..9e4cd91a61 --- /dev/null +++ b/vendor/licenses/git_submodule/typespec.dep.yml @@ -0,0 +1,31 @@ +--- +name: typespec +version: ce9c567e5bfb441bb6415699a6b6fa797bc08f2e +type: git_submodule +homepage: https://github.com/Microsoft/typespec.git +license: mit +licenses: +- sources: LICENSE + text: |2 + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + 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: []