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

Add RBS language #6369

Merged
merged 7 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
83 changes: 83 additions & 0 deletions samples/RBS/cli.rbs
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/vscode-rbs-syntax
ybiquitous marked this conversation as resolved.
Show resolved Hide resolved
Submodule vscode-rbs-syntax added at 164e36
31 changes: 31 additions & 0 deletions vendor/licenses/git_submodule/vscode-rbs-syntax.dep.yml
Original file line number Diff line number Diff line change
@@ -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: []
-