Skip to content

Rename gem to ruby-lsp-rails #34

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

Merged
merged 1 commit into from
Apr 19, 2023
Merged
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
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ AllCops:
Exclude:
- "test/dummy/db/**/*.rb"

Naming/FileName:
Exclude:
- "lib/ruby-lsp-rails.rb"

Sorbet/FalseSigil:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Specify your gem's dependencies in rails_ruby_lsp.gemspec.
# Specify your gem's dependencies in ruby_lsp_rails.gemspec.
gemspec

gem "puma"
Expand Down
12 changes: 7 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
rails_ruby_lsp (0.1.0)
ruby-lsp-rails (0.1.0)
rails (>= 6.0)
ruby-lsp (>= 0.4.0)
sorbet-runtime (>= 0.5.9897)
Expand Down Expand Up @@ -103,7 +103,7 @@ GEM
reline (>= 0.3.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
loofah (2.19.1)
loofah (2.20.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.8.1)
Expand All @@ -114,6 +114,7 @@ GEM
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.18.0)
mocha (2.0.2)
ruby2_keywords (>= 0.0.5)
Expand All @@ -128,9 +129,10 @@ GEM
net-protocol
netrc (0.11.0)
nio4r (2.5.9)
nokogiri (1.14.3-arm64-darwin)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.14.3-x86_64-linux)
nokogiri (1.14.3-arm64-darwin)
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we may need to add the right platforms in the Gemfile.lock.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, not sure why that changed 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(bundle lock --add-platform x86_64-linux doesn't do anything since x86_64-linux is still listed in PLATFORMS).

racc (~> 1.4)
parallel (1.22.1)
parser (3.2.2.0)
Expand Down Expand Up @@ -251,13 +253,13 @@ DEPENDENCIES
debug (>= 1.7.0)
mocha
puma
rails_ruby_lsp!
rubocop (~> 1.48)
rubocop-minitest (~> 0.30.0)
rubocop-rake (~> 0.6.0)
rubocop-shopify (~> 2.13)
rubocop-sorbet (~> 0.7)
ruby-lsp!
ruby-lsp-rails!
sorbet-static-and-runtime
sqlite3
tapioca (~> 0.11)
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rails Ruby Lsp
# Ruby LSP Rails

The Rails Ruby Lsp is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) extension for extra Rails editor features, such as:
Ruby LSP Rails is a [Ruby LSP](https://github.com/Shopify/ruby-lsp) extension for extra Rails editor features, such as:

- Displaying an ActiveRecord model's database columns and types when hovering over it
- (More to come!)
Expand All @@ -12,7 +12,7 @@ To install, add the following line to your application's Gemfile:

```ruby
group :development do
gem "rails_ruby_lsp"
gem "ruby-lsp-rails"
end
```

Expand All @@ -38,11 +38,11 @@ This is why the Rails server needs to be running for features to work.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/rails_ruby_lsp. This project is
Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/ruby-lsp-rails. This project is
intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the
[Contributor Covenant](https://github.com/Shopify/rails_ruby_lsp/blob/main/CODE_OF_CONDUCT.md) code of conduct.
[Contributor Covenant](https://github.com/Shopify/ruby-lsp-rails/blob/main/CODE_OF_CONDUCT.md) code of conduct.

## License

The gem is available as open source under the terms of the
[MIT License](https://github.com/Shopify/rails_ruby_lsp/blob/main/LICENSE.txt).
[MIT License](https://github.com/Shopify/ruby-lsp-rails/blob/main/LICENSE.txt).
1 change: 0 additions & 1 deletion app/assets/config/rails_ruby_lsp_manifest.js

This file was deleted.

1 change: 1 addition & 0 deletions app/assets/config/ruby_lsp_rails_manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= link_directory ../stylesheets/ruby_lsp_rails .css
7 changes: 0 additions & 7 deletions app/controllers/rails_ruby_lsp/application_controller.rb

This file was deleted.

30 changes: 0 additions & 30 deletions app/controllers/rails_ruby_lsp/models_controller.rb

This file was deleted.

9 changes: 9 additions & 0 deletions app/controllers/ruby_lsp/rails/application_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# typed: strict
# frozen_string_literal: true

module RubyLsp
module Rails
class ApplicationController < ActionController::Base
end
end
end
32 changes: 32 additions & 0 deletions app/controllers/ruby_lsp/rails/models_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# typed: strict
# frozen_string_literal: true

module RubyLsp
module Rails
class ModelsController < ApplicationController
extend T::Sig

sig { returns(T.untyped) }
def show
const = Object.const_get(params[:id]) # rubocop:disable Sorbet/ConstantsFromStrings

begin
schema_file = ActiveRecord::Tasks::DatabaseTasks.schema_dump_path(const.connection.pool.db_config)
rescue => e
warn("Could not locate schema: #{e.message}")
end

if const < ActiveRecord::Base
render(json: {
columns: const.columns.map { |column| [column.name, column.type] },
schema_file: schema_file,
})
else
head(:not_found)
end
rescue NameError, ActiveRecord::TableNotSpecified
head(:not_found)
end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# typed: strict
# frozen_string_literal: true

module RailsRubyLsp
module RubyLspRails
class ApplicationJob < ActiveJob::Base
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# typed: strict
# frozen_string_literal: true

module RailsRubyLsp
module RubyLspRails
class ApplicationMailer < ActionMailer::Base
default from: "[email protected]"
layout "mailer"
Expand Down
8 changes: 0 additions & 8 deletions app/models/rails_ruby_lsp/application_record.rb

This file was deleted.

10 changes: 10 additions & 0 deletions app/models/ruby_lsp/rails/application_record.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# typed: strict
# frozen_string_literal: true

module RubyLsp
module Rails
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
end
end
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Rails ruby lsp</title>
<title>Ruby LSP Rails</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<%= stylesheet_link_tag "rails_ruby_lsp/application", media: "all" %>
<%= stylesheet_link_tag "ruby_lsp_rails/application", media: "all" %>
</head>
<body>

Expand Down
2 changes: 1 addition & 1 deletion bin/rails
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# installed from the root of your application.

ENGINE_ROOT = File.expand_path("..", __dir__)
ENGINE_PATH = File.expand_path("../lib/rails_ruby_lsp/engine", __dir__)
ENGINE_PATH = File.expand_path("../lib/ruby_lsp_rails/engine", __dir__)
APP_PATH = File.expand_path("../test/dummy/config/application", __dir__)

# Set up gems listed in the Gemfile.
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# typed: strict
# frozen_string_literal: true

RailsRubyLsp::Engine.routes.draw do
RubyLsp::Rails::Engine.routes.draw do
resources :models, only: [:show]
end
2 changes: 1 addition & 1 deletion dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: rails-ruby-lsp
name: ruby-lsp-rails

type: ruby

Expand Down
9 changes: 0 additions & 9 deletions lib/rails_ruby_lsp.rb

This file was deleted.

28 changes: 0 additions & 28 deletions lib/rails_ruby_lsp/engine.rb

This file was deleted.

6 changes: 0 additions & 6 deletions lib/rails_ruby_lsp/version.rb

This file was deleted.

11 changes: 11 additions & 0 deletions lib/ruby-lsp-rails.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# typed: strict
# frozen_string_literal: true

require "sorbet-runtime"
require "ruby_lsp_rails/version"
require "ruby_lsp_rails/engine"

module RubyLSP
module Rails
end
end
24 changes: 0 additions & 24 deletions lib/ruby_lsp/rails_ruby_lsp/extension.rb

This file was deleted.

39 changes: 0 additions & 39 deletions lib/ruby_lsp/rails_ruby_lsp/hover.rb

This file was deleted.

Loading