diff --git a/.gitmodules b/.gitmodules index 7de9fd0d02..349dee2838 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1242,6 +1242,9 @@ [submodule "vendor/grammars/vscode-proto3"] path = vendor/grammars/vscode-proto3 url = https://github.com/zxh0/vscode-proto3 +[submodule "vendor/grammars/vscode-rbs-syntax"] + path = vendor/grammars/vscode-rbs-syntax + url = https://github.com/soutaro/vscode-rbs-syntax.git [submodule "vendor/grammars/vscode-scala-syntax"] path = vendor/grammars/vscode-scala-syntax url = https://github.com/scala/vscode-scala-syntax diff --git a/grammars.yml b/grammars.yml index 052574ba58..e321e0a777 100644 --- a/grammars.yml +++ b/grammars.yml @@ -1119,6 +1119,8 @@ vendor/grammars/vscode-procfile: vendor/grammars/vscode-proto3: - markdown.codeblock.proto - source.proto +vendor/grammars/vscode-rbs-syntax: +- source.rbs vendor/grammars/vscode-scala-syntax: - source.scala vendor/grammars/vscode-singularity: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index b9139595b4..18b38257d0 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -5512,6 +5512,17 @@ RAML: extensions: - ".raml" language_id: 308 +RBS: + type: data + ace_mode: ruby + codemirror_mode: ruby + codemirror_mime_type: text/x-ruby + extensions: + - ".rbs" + color: "#701516" + tm_scope: source.rbs + group: Ruby + language_id: 899227493 RDoc: type: prose color: "#701516" diff --git a/samples/RBS/cli.rbs b/samples/RBS/cli.rbs new file mode 100644 index 0000000000..f1d370ce34 --- /dev/null +++ b/samples/RBS/cli.rbs @@ -0,0 +1,83 @@ +module RBS + class CLI + class LibraryOptions + attr_accessor core_root: Pathname? + attr_accessor config_path: Pathname? + + attr_reader libs: Array[String] + attr_reader dirs: Array[String] + attr_reader repos: Array[String] + + def initialize: () -> void + + def loader: () -> EnvironmentLoader + + def setup_library_options: (OptionParser) -> OptionParser + end + + interface _IO + def puts: (*untyped) -> void + + def print: (*untyped) -> void + + def flush: () -> void + end + + attr_reader stdout: _IO + attr_reader stderr: _IO + + # The copy of `args` passed to `run`. + # + # `OptionParser#order!` mutates given `arg`, the `run_***` actions should read `original_args` to get the original commandline arguments. + # + # Returns `nil` if called before `#run` call. + # + attr_reader original_args: Array[String] + + def initialize: (stdout: IO, stderr: IO) -> void + + COMMANDS: Array[Symbol] + + def library_parse: (OptionParser, options: LibraryOptions) -> void + + def parse_logging_options: (OptionParser) -> void + + def has_parser?: () -> bool + + def run: (Array[String] args) -> void + + def run_ast: (Array[String], LibraryOptions) -> void + + def run_list: (Array[String], LibraryOptions) -> void + + def run_ancestors: (Array[String], LibraryOptions) -> void + + def run_methods: (Array[String], LibraryOptions) -> void + + def run_method: (Array[String], LibraryOptions) -> void + + def run_validate: (Array[String], LibraryOptions) -> void + + def run_constant: (Array[String], LibraryOptions) -> void + + def run_paths: (Array[String], LibraryOptions) -> void + + def run_prototype: (Array[String], LibraryOptions) -> void + + def run_prototype_file: (String format, Array[String]) -> void + + def run_vendor: (Array[String], LibraryOptions) -> void + + def run_parse: (Array[String], LibraryOptions) -> void + + def run_test: (Array[String], LibraryOptions) -> void + + def run_collection: (Array[String], LibraryOptions) -> void + + def run_annotate: (Array[String], top) -> void + + def test_opt: (LibraryOptions) -> String? + + def collection_options: (Array[String]) -> OptionParser + end +end diff --git a/vendor/README.md b/vendor/README.md index f94010a8a5..4ece242bc9 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -436,6 +436,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **Quake:** [newgrammars/quake](https://github.com/newgrammars/quake) - **R:** [textmate/r.tmbundle](https://github.com/textmate/r.tmbundle) - **RAML:** [atom/language-yaml](https://github.com/atom/language-yaml) +- **RBS:** [soutaro/vscode-rbs-syntax](https://github.com/soutaro/vscode-rbs-syntax) - **RDoc:** [joshaven/RDoc.tmbundle](https://github.com/joshaven/RDoc.tmbundle) - **REALbasic:** [peters-ben-0007/VBDotNetSyntax](https://github.com/peters-ben-0007/VBDotNetSyntax) - **REXX:** [mblocker/rexx-sublime](https://github.com/mblocker/rexx-sublime) diff --git a/vendor/grammars/vscode-rbs-syntax b/vendor/grammars/vscode-rbs-syntax new file mode 160000 index 0000000000..164e36d3d3 --- /dev/null +++ b/vendor/grammars/vscode-rbs-syntax @@ -0,0 +1 @@ +Subproject commit 164e36d3d39c0f187a04f7370cea7ba22453b662 diff --git a/vendor/licenses/git_submodule/vscode-rbs-syntax.dep.yml b/vendor/licenses/git_submodule/vscode-rbs-syntax.dep.yml new file mode 100644 index 0000000000..37dfd79486 --- /dev/null +++ b/vendor/licenses/git_submodule/vscode-rbs-syntax.dep.yml @@ -0,0 +1,31 @@ +--- +name: vscode-rbs-syntax +version: 164e36d3d39c0f187a04f7370cea7ba22453b662 +type: git_submodule +homepage: https://github.com/soutaro/vscode-rbs-syntax.git +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2019 Seiei Miyagi and Soutaro Matsumoto + + 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: []