class LSP::DocumentFilter

Overview

A document filter denotes a document through properties like language, scheme or pattern.

An example is a filter that applies to TypeScript files on disk. Another example is a filter the applies to JSON files with name package.json:

{ language: 'typescript', scheme: 'file' }
{ language: 'json', pattern: '**/package.json' }

Included Modules

Defined in:

base/document_filter.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(**args) #

[View source]

Instance Method Detail

def language : String | Nil #

A language id, like typescript.


[View source]
def language=(language : String | Nil) #

A language id, like typescript.


[View source]
def pattern : String | Nil #

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)

[View source]
def pattern=(pattern : String | Nil) #

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)

[View source]
def scheme : String | Nil #

A Uri scheme, like file or untitled.


[View source]
def scheme=(scheme : String | Nil) #

A Uri scheme, like file or untitled.


[View source]