Sha256: f5a3a21c29797b6c074c9b2b079c3a9e54f598b46e43ecbed203125bac8d501c

Contents?: true

Size: 1.94 KB

Versions: 106

Compression:

Stored size: 1.94 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # A pattern to describe in which file operation requests or notifications
      # the server is interested in.
      #
      class FileOperationPattern
        def initialize(glob:, matches: nil, options: nil)
          @attributes = {}

          @attributes[:glob] = glob
          @attributes[:matches] = matches if matches
          @attributes[:options] = options if options

          @attributes.freeze
        end

        #
        # The glob pattern to match. Glob patterns can have the following syntax:
        # - `*` to match one or more characters in a path segment
        # - `?` to match on one character in a path segment
        # - `**` to match any number of path segments, including none
        # - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}`
        # matches all TypeScript and JavaScript files)
        # - `[]` to declare a range of characters to match in a path segment
        # (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
        # - `[!...]` to negate a range of characters to match in a path segment
        # (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
        # not `example.0`)
        #
        # @return [string]
        def glob
          attributes.fetch(:glob)
        end

        #
        # Whether to match files or folders with this pattern.
        #
        # Matches both if undefined.
        #
        # @return [FileOperationPatternKind]
        def matches
          attributes.fetch(:matches)
        end

        #
        # Additional options used during matching.
        #
        # @return [FileOperationPatternOptions]
        def options
          attributes.fetch(:options)
        end

        attr_reader :attributes

        def to_hash
          attributes
        end

        def to_json(*args)
          to_hash.to_json(*args)
        end
      end
    end
  end
end

Version data entries

106 entries across 106 versions & 12 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
bison-0.1.0 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
study_line-0.2.7 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
study_line-0.2.6 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
study_line-0.2.5 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
study_line-0.2.4 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
study_line-0.2.3 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
study_line-0.2.2 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
study_line-0.2.1 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
study_line-0.2.0 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/file_operation_pattern.rb