Sha256: e186ebc84a6ac02e65e3187b57819a27484b69c51e60ff67b2a1e2ed50480929

Contents?: true

Size: 886 Bytes

Versions: 24

Compression:

Stored size: 886 Bytes

Contents

# frozen_string_literal: true

module ThemeCheck
  module LanguageServer
    def self.partial_tag(tag)
      %r{
        \{\%-?\s*#{tag}\s+'(?<partial>[^']*)'|
        \{\%-?\s*#{tag}\s+"(?<partial>[^"]*)"|

        # in liquid tags the whole line is white space until the tag
        ^\s*#{tag}\s+'(?<partial>[^']*)'|
        ^\s*#{tag}\s+"(?<partial>[^"]*)"
      }mix
    end

    PARTIAL_RENDER = partial_tag('render')
    PARTIAL_INCLUDE = partial_tag('include')
    PARTIAL_SECTION = partial_tag('section')

    ASSET_INCLUDE = %r{
      \{\{-?\s*'(?<partial>[^']*)'\s*\|\s*asset_url|
      \{\{-?\s*"(?<partial>[^"]*)"\s*\|\s*asset_url|

      # in liquid tags the whole line is white space until the asset partial
      ^\s*(?:echo|assign[^=]*\=)\s*'(?<partial>[^']*)'\s*\|\s*asset_url|
      ^\s*(?:echo|assign[^=]*\=)\s*"(?<partial>[^"]*)"\s*\|\s*asset_url
    }mix
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
theme-check-1.15.0 lib/theme_check/language_server/constants.rb
theme-check-1.14.0 lib/theme_check/language_server/constants.rb
theme-check-1.13.0 lib/theme_check/language_server/constants.rb
theme-check-1.12.1 lib/theme_check/language_server/constants.rb
theme-check-1.12.0 lib/theme_check/language_server/constants.rb
theme-check-1.11.0 lib/theme_check/language_server/constants.rb
theme-check-1.10.3 lib/theme_check/language_server/constants.rb
theme-check-1.10.2 lib/theme_check/language_server/constants.rb
theme-check-1.10.1 lib/theme_check/language_server/constants.rb
theme-check-1.10.0 lib/theme_check/language_server/constants.rb
theme-check-1.9.2 lib/theme_check/language_server/constants.rb
theme-check-1.9.1 lib/theme_check/language_server/constants.rb
theme-check-1.9.0 lib/theme_check/language_server/constants.rb
theme-check-1.8.0 lib/theme_check/language_server/constants.rb
theme-check-1.7.2 lib/theme_check/language_server/constants.rb
theme-check-1.7.1 lib/theme_check/language_server/constants.rb
theme-check-1.7.0 lib/theme_check/language_server/constants.rb
theme-check-1.6.2 lib/theme_check/language_server/constants.rb
theme-check-1.6.1 lib/theme_check/language_server/constants.rb
theme-check-1.6.0 lib/theme_check/language_server/constants.rb