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) #

def self.new(**args) #

Instance Method Detail

def language : String? #

A language id, like typescript.


def language=(language : String?) #

A language id, like typescript.


def pattern : String? #

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)

def pattern=(pattern : String?) #

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)

def scheme : String? #

A Uri scheme, like file or untitled.


def scheme=(scheme : String?) #

A Uri scheme, like file or untitled.