# frozen_string_literal: true module PlatformosCheck module LanguageServer def self.partial_tag(tag) / \{%-?\s*#{tag}\s+'(?[^']*)'| \{%-?\s*#{tag}\s+"(?[^"]*)"| # in liquid tags the whole line is white space until the tag ^\s*#{tag}\s+'(?[^']*)'| ^\s*#{tag}\s+"(?[^"]*)" /mix end PARTIAL_RENDER = partial_tag('render') PARTIAL_INCLUDE = partial_tag('include') PARTIAL_SECTION = partial_tag('section') ASSET_INCLUDE = / \{\{-?\s*'(?[^']*)'\s*\|\s*asset_url| \{\{-?\s*"(?[^"]*)"\s*\|\s*asset_url| # in liquid tags the whole line is white space until the asset partial ^\s*(?:echo|assign[^=]*=)\s*'(?[^']*)'\s*\|\s*asset_url| ^\s*(?:echo|assign[^=]*=)\s*"(?[^"]*)"\s*\|\s*asset_url /mix end end