diff --git a/solargraph/definitions.rb b/solargraph/definitions.rb new file mode 100644 index 0000000..2feb002 --- /dev/null +++ b/solargraph/definitions.rb @@ -0,0 +1,31 @@ +# The following comments fill some of the gaps in Solargraph's understanding of +# Rails apps. Since they're all in YARD, they get mapped in Solargraph but +# ignored at runtime. +# +# You can put this file anywhere in the project, as long as it gets included in +# the workspace maps. It's recommended that you keep it in a standalone file +# instead of pasting it into an existing one. +# +# @!parse +# class ActionController::Base +# include ActionController::MimeResponds +# extend ActiveSupport::Callbacks::ClassMethods +# extend AbstractController::Callbacks::ClassMethods +# end +# class ActiveRecord::Base +# extend ActiveRecord::QueryMethods +# extend ActiveRecord::FinderMethods +# extend ActiveRecord::Associations::ClassMethods +# extend ActiveRecord::Inheritance::ClassMethods +# include ActiveRecord::Persistence +# end +# @!override ActiveRecord::FinderMethods#find +# @overload find(id) +# @param id [Integer] +# @return [self] +# @overload find(list) +# @param list [Array] +# @return [Array] +# @overload find(*args) +# @return [Array] +# @return [self, Array] diff --git a/solargraph/solargraph.md b/solargraph/solargraph.md new file mode 100644 index 0000000..65f9e77 --- /dev/null +++ b/solargraph/solargraph.md @@ -0,0 +1,14 @@ +# Solargraph configuration + +# Prerequisites + +* `gem install solargraph` +* `gem install solargraph-rails` + +# Quick setup + +1. copy `.yml` file inside the root folder. +2. execute `solargraph download-core` +3. execute `yard gems` +4. execute `solargraph bundle` +5. copy `definitions.rb` into `${PROJECT}/config/` diff --git a/solargraph/solargraph.yml b/solargraph/solargraph.yml new file mode 100644 index 0000000..2bfade1 --- /dev/null +++ b/solargraph/solargraph.yml @@ -0,0 +1,24 @@ +--- +include: + - "app/**/*.rb" + - "lib/**/*.rb" +exclude: + - spec/**/* + - test/**/* + - vendor/**/* + - ".bundle/**/*" +require: [] +domains: [] +reporters: + - rubocop + - require_not_found +formatter: + rubocop: + cops: safe + except: [] + only: [] + extra_args: [] +require_paths: [] +plugins: + - solargraph-rails +max_files: 15000