Sha256: d83f416671bb6237ac4f856007ea0d08417a15c5dd6f2a18c3e181fd137766ac

Contents?: true

Size: 841 Bytes

Versions: 1

Compression:

Stored size: 841 Bytes

Contents

# frozen_string_literal: true

module ThemeCheck
  module LanguageServer
    class CompletionProvider
      include CompletionHelper
      include RegexHelpers

      attr_reader :storage

      CurrentToken = Struct.new(:content, :cursor, :absolute_cursor, :buffer)

      class << self
        def all
          @all ||= []
        end

        def inherited(subclass)
          all << subclass
        end
      end

      def initialize(storage = InMemoryStorage.new)
        @storage = storage
      end

      def completions(relative_path, line, col)
        raise NotImplementedError
      end

      def doc_hash(content)
        return {} if content.nil? || content.empty?

        {
          documentation: {
            kind: MarkupKinds::MARKDOWN,
            value: content,
          },
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
theme-check-1.12.0 lib/theme_check/language_server/completion_provider.rb