From d610a6bb77f2f95f9e01b70e79e625958b66e523 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lek=C3=AB=20Mula?= <l.mula@finlink.de>
Date: Sat, 4 May 2024 21:31:42 +0200
Subject: [PATCH] Remove Rspec convention

Replaced by https://github.com/lekemula/solargraph-rspec plugin
---
 lib/solargraph/convention.rb       |  2 --
 lib/solargraph/convention/rspec.rb | 30 ------------------------------
 2 files changed, 32 deletions(-)
 delete mode 100644 lib/solargraph/convention/rspec.rb

diff --git a/lib/solargraph/convention.rb b/lib/solargraph/convention.rb
index db0faa7cb..056d4013d 100644
--- a/lib/solargraph/convention.rb
+++ b/lib/solargraph/convention.rb
@@ -9,7 +9,6 @@ module Solargraph
   module Convention
     autoload :Base,    'solargraph/convention/base'
     autoload :Gemfile, 'solargraph/convention/gemfile'
-    autoload :Rspec,   'solargraph/convention/rspec'
     autoload :Gemspec, 'solargraph/convention/gemspec'
     autoload :Rakefile, 'solargraph/convention/rakefile'
 
@@ -43,7 +42,6 @@ def self.for_global(yard_map)
 
     register Gemfile
     register Gemspec
-    register Rspec
     register Rakefile
   end
 end
diff --git a/lib/solargraph/convention/rspec.rb b/lib/solargraph/convention/rspec.rb
deleted file mode 100644
index 426e541a7..000000000
--- a/lib/solargraph/convention/rspec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-module Solargraph
-  module Convention
-    class Rspec < Base
-      def local source_map
-        return EMPTY_ENVIRON unless File.basename(source_map.filename) =~ /_spec\.rb$/
-        @environ ||= Environ.new(
-          requires: ['rspec'],
-          domains: ['RSpec::Matchers', 'RSpec::ExpectationGroups'],
-          pins: [
-            # This override is necessary due to an erroneous @return tag in
-            # rspec's YARD documentation.
-            # @todo The return types have been fixed (https://github.com/rspec/rspec-expectations/pull/1121)
-            Solargraph::Pin::Reference::Override.method_return('RSpec::Matchers#expect', 'RSpec::Expectations::ExpectationTarget')
-          ].concat(extras)
-        )
-      end
-
-      private
-
-      def extras
-        @@extras ||= SourceMap.load_string(%(
-          def describe(*args); end
-          def it(*args); end
-        )).pins
-      end
-    end
-  end
-end