class LanguageServer::Protocol::Interface::RelativePattern

A relative pattern is a helper to construct glob patterns that are matched relatively to a base URI. The common value for a ‘baseUri` is a workspace folder root, but it can be another absolute URI as well.

Attributes

attributes[R]

Public Class Methods

new(base_uri:, pattern:) click to toggle source
# File lib/language_server/protocol/interface/relative_pattern.rb, line 10
def initialize(base_uri:, pattern:)
  @attributes = {}

  @attributes[:baseUri] = base_uri
  @attributes[:pattern] = pattern

  @attributes.freeze
end

Public Instance Methods

base_uri() click to toggle source

A workspace folder or a base URI to which this pattern will be matched against relatively.

@return [string | WorkspaceFolder]

# File lib/language_server/protocol/interface/relative_pattern.rb, line 24
def base_uri
  attributes.fetch(:baseUri)
end
pattern() click to toggle source

The actual glob pattern;

@return [string]

# File lib/language_server/protocol/interface/relative_pattern.rb, line 32
def pattern
  attributes.fetch(:pattern)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/relative_pattern.rb, line 38
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/relative_pattern.rb, line 42
def to_json(*args)
  to_hash.to_json(*args)
end