ruby-lsp 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cacbd0ac625037e2671811471792d7f4557bfd71e8ee1259c306ecd81b71974b
4
+ data.tar.gz: 58442bd37eaf5954d486556bc0a2a94a093471627791e55c66701fcad3a7ebd4
5
+ SHA512:
6
+ metadata.gz: bb55d15c4be207b39516891c9e0fc3f82e1412e57e9712932e3c73b354a7b95cf35f3df15990a097d146b849ab3309490236f8ad72b2a678fb142a99a3246372
7
+ data.tar.gz: 86269ca803e98331eec3e432f75049ffdf9250439b675a1e3bf335e4ce429f7fdb20ca67a6b0daff2afda8f6a69dbfded2178c9e2e5ed687b000d0ca82b7e08c
@@ -0,0 +1,20 @@
1
+ version: 2
2
+ registries:
3
+ rubygems-server-pkgs-shopify-io:
4
+ type: rubygems-server
5
+ url: https://pkgs.shopify.io
6
+ username: ${{secrets.RUBYGEMS_SERVER_PKGS_SHOPIFY_IO_USERNAME}}
7
+ password: ${{secrets.RUBYGEMS_SERVER_PKGS_SHOPIFY_IO_PASSWORD}}
8
+ github-com:
9
+ type: git
10
+ url: https://github.com
11
+ username: ${{secrets.DEPENDENCIES_GITHUB_USER}}
12
+ password: ${{secrets.DEPENDENCIES_GITHUB_TOKEN}}
13
+ updates:
14
+ - package-ecosystem: bundler
15
+ directory: "/"
16
+ schedule:
17
+ interval: daily
18
+ open-pull-requests-limit: 100
19
+ insecure-external-code-execution: allow
20
+ registries: '*'
@@ -0,0 +1,2 @@
1
+ enabled:
2
+ - cla
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /.dev/
10
+ /**/node_modules/
11
+ /**/out/
12
+ /**/*.vsix
data/.rubocop.yml ADDED
@@ -0,0 +1,12 @@
1
+ inherit_gem:
2
+ rubocop-shopify: rubocop.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 3.1
6
+ Exclude:
7
+ - "vendor/**/*"
8
+ - "features/**/*"
9
+
10
+ Naming/FileName:
11
+ Exclude:
12
+ - "lib/ruby-lsp.rb"
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "rebornix.ruby"
4
+ ]
5
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Minitest - current line",
9
+ "type": "Ruby",
10
+ "cwd": "${workspaceRoot}",
11
+ "request": "launch",
12
+ "program": "${workspaceRoot}/bin/rails",
13
+ "args": [
14
+ "test",
15
+ "${file}:${lineNumber}"
16
+ ]
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,25 @@
1
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
2
+ // for the documentation about the tasks.json format
3
+ {
4
+ "version": "2.0.0",
5
+ "tasks": [
6
+ {
7
+ "type": "rake",
8
+ "task": "test",
9
+ "group": {
10
+ "kind": "test",
11
+ "isDefault": true
12
+ },
13
+ "problemMatcher": [],
14
+ "label": "rake: test",
15
+ "presentation": {
16
+ "echo": true,
17
+ "reveal": "always",
18
+ "focus": true,
19
+ "panel": "shared",
20
+ "showReuseMessage": true,
21
+ "clear": false
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,78 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to make participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies within all project spaces, and it also applies when
49
+ an individual is representing the project or its community in public spaces.
50
+ Examples of representing a project or community include using an official
51
+ project e-mail address, posting via an official social media account, or acting
52
+ as an appointed representative at an online or offline event. Representation of
53
+ a project may be further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at opensource@shopify.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq
77
+
78
+
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ gem "minitest", "~> 5.15"
8
+ gem "minitest-reporters", "~> 1.5"
9
+ gem "rake", "~> 13.0"
10
+ gem "rubocop", "~> 1.25"
11
+ gem "rubocop-shopify", "~> 2.4"
12
+ gem "rubocop-minitest", "~> 0.17.2"
13
+ gem "rubocop-rake", "~> 0.6.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ruby-lsp (0.0.1)
5
+ language_server-protocol
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ansi (1.5.0)
11
+ ast (2.4.2)
12
+ builder (3.2.4)
13
+ language_server-protocol (3.16.0.3)
14
+ minitest (5.15.0)
15
+ minitest-reporters (1.5.0)
16
+ ansi
17
+ builder
18
+ minitest (>= 5.0)
19
+ ruby-progressbar
20
+ parallel (1.21.0)
21
+ parser (3.1.1.0)
22
+ ast (~> 2.4.1)
23
+ rainbow (3.1.1)
24
+ rake (13.0.6)
25
+ regexp_parser (2.2.1)
26
+ rexml (3.2.5)
27
+ rubocop (1.25.1)
28
+ parallel (~> 1.10)
29
+ parser (>= 3.1.0.0)
30
+ rainbow (>= 2.2.2, < 4.0)
31
+ regexp_parser (>= 1.8, < 3.0)
32
+ rexml
33
+ rubocop-ast (>= 1.15.1, < 2.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (>= 1.4.0, < 3.0)
36
+ rubocop-ast (1.16.0)
37
+ parser (>= 3.1.1.0)
38
+ rubocop-minitest (0.17.2)
39
+ rubocop (>= 0.90, < 2.0)
40
+ rubocop-rake (0.6.0)
41
+ rubocop (~> 1.0)
42
+ rubocop-shopify (2.4.0)
43
+ rubocop (~> 1.24)
44
+ ruby-progressbar (1.11.0)
45
+ unicode-display_width (2.1.0)
46
+
47
+ PLATFORMS
48
+ arm64-darwin-21
49
+ x86_64-linux
50
+
51
+ DEPENDENCIES
52
+ minitest (~> 5.15)
53
+ minitest-reporters (~> 1.5)
54
+ rake (~> 13.0)
55
+ rubocop (~> 1.25)
56
+ rubocop-minitest (~> 0.17.2)
57
+ rubocop-rake (~> 0.6.0)
58
+ rubocop-shopify (~> 2.4)
59
+ ruby-lsp!
60
+
61
+ BUNDLED WITH
62
+ 2.3.7
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022-present, Shopify Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # ruby-lsp
2
+
3
+ Future home of monorepo for `ruby-lsp` Gem and VSCode extension
4
+
5
+ ## Contributing
6
+
7
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/ruby-lsp.
8
+ This project is intended to be a safe, welcoming space for collaboration, and contributors
9
+ are expected to adhere to the
10
+ [Contributor Covenant](https://github.com/Shopify/ruby-lsp/blob/main/CODE_OF_CONDUCT.md)
11
+ code of conduct.
12
+
13
+ ## License
14
+
15
+ The gem is available as open source under the terms of the
16
+ [MIT License](https://github.com/Shopify/ruby-lsp/blob/main/LICENSE.txt).
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: [:test]
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+
3
+ cd features/vscode_extension || exit
4
+ yarn run vscode:prepublish
5
+ yarn run package -o ../.. # drop the extension in the main directory
data/bin/rubocop ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("rubocop", "rubocop")
data/bin/style ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+
3
+ echo "Linting gem..."
4
+ bin/rubocop
5
+
6
+ echo
7
+ echo "Linting extension..."
8
+ cd features/vscode_extension || exit
9
+ yarn run lint
10
+ cd ../..
data/bin/test ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+
3
+ bundle exec rake "$@"
data/dev.yml ADDED
@@ -0,0 +1,20 @@
1
+ name: ruby-lsp
2
+
3
+ type: ruby
4
+
5
+ up:
6
+ - ruby: 3.1.1
7
+ - bundler
8
+ - node:
9
+ yarn: 1.22.17
10
+ version: v16.14.0
11
+ packages: ["./features/vscode_extension"]
12
+
13
+ commands:
14
+ style: bin/style
15
+ extension: bin/package_extension
16
+ test:
17
+ syntax:
18
+ argument: file
19
+ optional: args...
20
+ run: bin/test
data/exe/ruby-lsp ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative "../lib/ruby/lsp"
5
+
6
+ Ruby::Lsp::Cli.start(ARGV)
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "language_server-protocol"
4
+
5
+ module Ruby
6
+ module Lsp
7
+ module Cli
8
+ def self.start(_argv)
9
+ writer = LanguageServer::Protocol::Transport::Stdio::Writer.new
10
+ reader = LanguageServer::Protocol::Transport::Stdio::Reader.new
11
+
12
+ subscribers = {
13
+ initialize: -> {
14
+ LanguageServer::Protocol::Interface::InitializeResult.new(
15
+ capabilities: LanguageServer::Protocol::Interface::ServerCapabilities.new(
16
+ text_document_sync: LanguageServer::Protocol::Interface::TextDocumentSyncOptions.new(
17
+ change: LanguageServer::Protocol::Constant::TextDocumentSyncKind::FULL
18
+ ),
19
+ completion_provider: LanguageServer::Protocol::Interface::CompletionOptions.new(
20
+ resolve_provider: true,
21
+ trigger_characters: %w(.)
22
+ ),
23
+ definition_provider: true
24
+ )
25
+ )
26
+ }
27
+ }
28
+
29
+ reader.read do |request|
30
+ result = subscribers[request[:method].to_sym].call
31
+ writer.write(id: request[:id], result: result)
32
+ exit
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
data/lib/ruby/lsp.rb ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lsp/cli"
data/lib/ruby-lsp.rb ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./ruby/lsp"
data/ruby-lsp.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "ruby-lsp"
5
+ s.version = File.read("VERSION").strip
6
+ s.authors = ["Shopify"]
7
+ s.email = ["ruby@shopify.com"]
8
+ s.metadata["allowed_push_host"] = "https://rubygems.org"
9
+
10
+ s.summary = "A simple language server for ruby"
11
+ s.description = "A simple language server for ruby"
12
+ s.homepage = "https://github.com/Shopify/ruby-lsp"
13
+
14
+ s.files = Dir.chdir(File.expand_path(__dir__)) do
15
+ %x(git ls-files -z).split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
16
+ end
17
+ s.bindir = "exe"
18
+ s.executables = s.files.grep(/\Aexe/) { |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency "language_server-protocol"
22
+ end
data/service.yml ADDED
@@ -0,0 +1,2 @@
1
+ classification: library
2
+
data/shipit.yml ADDED
@@ -0,0 +1 @@
1
+ # default config
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-lsp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Shopify
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: language_server-protocol
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: A simple language server for ruby
28
+ email:
29
+ - ruby@shopify.com
30
+ executables:
31
+ - ruby-lsp
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".github/dependabot.yml"
36
+ - ".github/probots.yml"
37
+ - ".gitignore"
38
+ - ".rubocop.yml"
39
+ - ".vscode/extensions.json"
40
+ - ".vscode/launch.json"
41
+ - ".vscode/tasks.json"
42
+ - CODE_OF_CONDUCT.md
43
+ - Gemfile
44
+ - Gemfile.lock
45
+ - LICENSE.txt
46
+ - README.md
47
+ - Rakefile
48
+ - VERSION
49
+ - bin/package_extension
50
+ - bin/rubocop
51
+ - bin/style
52
+ - bin/test
53
+ - dev.yml
54
+ - exe/ruby-lsp
55
+ - lib/ruby-lsp.rb
56
+ - lib/ruby/lsp.rb
57
+ - lib/ruby/lsp/cli.rb
58
+ - ruby-lsp.gemspec
59
+ - service.yml
60
+ - shipit.yml
61
+ homepage: https://github.com/Shopify/ruby-lsp
62
+ licenses: []
63
+ metadata:
64
+ allowed_push_host: https://rubygems.org
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubygems_version: 3.2.20
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: A simple language server for ruby
84
+ test_files: []