Sha256: 28707f3464a528b173552f6ff9f7b4f0cfe4a4ae669c56870cf456d2ec1c481c

Contents?: true

Size: 849 Bytes

Versions: 3

Compression:

Stored size: 849 Bytes

Contents

require_relative "base_symbol_source.rb"
require_relative "../languages.rb"
require_relative "../languages/sass_language.rb"

module Docks
  module SymbolSources
    class Sass < Base
      VALUE_SYMBOLS = %w(arglist bool color list map null number string)

      def recognizes?(symbol, options = {})
        language = options.fetch(:language, nil)
        return false if language && Languages.language_for(language) != Languages::Sass.instance

        symbol = symbol.downcase
        VALUE_SYMBOLS.include?(symbol) || symbol == "function"
      end

      def path_for(symbol)
        if symbol.downcase == "function"
          "http://sass-lang.com/documentation/Sass/Script/Script/Functions.html"
        else
          "http://sass-lang.com/documentation/Sass/Script/Value/#{symbol.capitalize}.html"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
docks_app-0.0.3 lib/docks/symbol_sources/sass_symbol_source.rb
docks_app-0.0.2 lib/docks/symbol_sources/sass_symbol_source.rb
docks_app-0.0.1 lib/docks/symbol_sources/sass_symbol_source.rb