Class DocumentFilter

java.lang.Object
org.graalvm.tools.lsp.server.types.JSONBase
org.graalvm.tools.lsp.server.types.DocumentFilter

public class DocumentFilter extends JSONBase
A document filter denotes a document by different properties like the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName). 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`)
Samples:
  • A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`
  • A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`
  • Method Details

    • getLanguage

      public String getLanguage()
      A language id, like `typescript`.
    • setLanguage

      public DocumentFilter setLanguage(String language)
    • getScheme

      public String getScheme()
      A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
    • setScheme

      public DocumentFilter setScheme(String scheme)
    • getPattern

      public String getPattern()
      A glob pattern, like `*.{ts,js}`.
    • setPattern

      public DocumentFilter setPattern(String pattern)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • create

      public static DocumentFilter create()