Sha256: 19458c0652521039c7918c4805305f350ceeaf7bb7fee1f72115fc96f0b06691
Contents?: true
Size: 1.71 KB
Versions: 6
Compression:
Stored size: 1.71 KB
Contents
module LanguageServer module Protocol module Interface class DocumentFilter def initialize(language: nil, scheme: nil, pattern: nil) @attributes = {} @attributes[:language] = language if language @attributes[:scheme] = scheme if scheme @attributes[:pattern] = pattern if pattern @attributes.freeze end # # A language id, like `typescript`. # # @return [string] def language attributes.fetch(:language) end # # A Uri [scheme](#Uri.scheme), like `file` or `untitled`. # # @return [string] def scheme attributes.fetch(:scheme) end # # A glob pattern, like `*.{ts,js}`. # # 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 conditions (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 pattern attributes.fetch(:pattern) 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
6 entries across 6 versions & 1 rubygems