Class: LanguageServer::Protocol::Interface::FileOperationFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/file_operation_filter.rb,
sig/language_server/protocol/interface/file_operation_filter.rbs

Overview

A filter to describe in which file operation requests or notifications the server is interested in receiving.

Since:

  • 3.16.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scheme: nil, pattern:) ⇒ FileOperationFilter

Returns a new instance of FileOperationFilter.

Parameters:

  • scheme: (String) (defaults to: nil)
  • pattern: (Object)

Since:

  • 3.16.0



11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interface/file_operation_filter.rb', line 11

def initialize(scheme: nil, pattern:)
  @attributes = {}

  @attributes[:scheme] = scheme if scheme
  @attributes[:pattern] = pattern

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.16.0



36
37
38
# File 'lib/language_server/protocol/interface/file_operation_filter.rb', line 36

def attributes
  @attributes
end

Instance Method Details

#patternFileOperationPattern

The actual file operation pattern.

Returns:

Since:

  • 3.16.0



32
33
34
# File 'lib/language_server/protocol/interface/file_operation_filter.rb', line 32

def pattern
  attributes.fetch(:pattern)
end

#schemestring

A Uri scheme like file or untitled.

Returns:

  • (string)

Since:

  • 3.16.0



24
25
26
# File 'lib/language_server/protocol/interface/file_operation_filter.rb', line 24

def scheme
  attributes.fetch(:scheme)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.16.0



38
39
40
# File 'lib/language_server/protocol/interface/file_operation_filter.rb', line 38

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)

Since:

  • 3.16.0



42
43
44
# File 'lib/language_server/protocol/interface/file_operation_filter.rb', line 42

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