@codemirror/language
Advanced tools
Comparing version 6.6.0 to 6.7.0
@@ -0,1 +1,7 @@ | ||
## 6.7.0 (2023-05-19) | ||
### New features | ||
Export `DocInput` class for feeding editor documents to a Lezer parser. | ||
## 6.6.0 (2023-02-13) | ||
@@ -2,0 +8,0 @@ |
@@ -1,5 +0,5 @@ | ||
import { NodeProp, SyntaxNode, Parser, Tree, TreeFragment, NodeType } from '@lezer/common'; | ||
import { NodeProp, SyntaxNode, Parser, Tree, Input, TreeFragment, NodeType } from '@lezer/common'; | ||
import { LRParser, ParserConfig } from '@lezer/lr'; | ||
import * as _codemirror_state from '@codemirror/state'; | ||
import { Facet, EditorState, Extension, StateField, Range } from '@codemirror/state'; | ||
import { Facet, EditorState, Extension, Text, StateField, Range } from '@codemirror/state'; | ||
import { EditorView, DecorationSet, Command, KeyBinding, ViewUpdate, BlockInfo, Decoration } from '@codemirror/view'; | ||
@@ -67,3 +67,3 @@ import { Highlighter, Tag } from '@lezer/highlight'; | ||
/** | ||
Syntax node prop used to register sublangauges. Should be added to | ||
Syntax node prop used to register sublanguages. Should be added to | ||
the top level node type for the language. | ||
@@ -216,2 +216,22 @@ */ | ||
/** | ||
Lezer-style | ||
[`Input`](https://lezer.codemirror.net/docs/ref#common.Input) | ||
object for a [`Text`](https://codemirror.net/6/docs/ref/#state.Text) object. | ||
*/ | ||
declare class DocInput implements Input { | ||
readonly doc: Text; | ||
private cursor; | ||
private cursorPos; | ||
private string; | ||
/** | ||
Create an input object for the given document. | ||
*/ | ||
constructor(doc: Text); | ||
get length(): number; | ||
private syncTo; | ||
chunk(pos: number): string; | ||
get lineChunks(): boolean; | ||
read(from: number, to: number): string; | ||
} | ||
/** | ||
A parse context provided to parsers working on the editor content. | ||
@@ -669,3 +689,3 @@ */ | ||
} | null; | ||
declare type DocRange = { | ||
type DocRange = { | ||
from: number; | ||
@@ -758,3 +778,3 @@ to: number; | ||
declare function codeFolding(config?: FoldConfig): Extension; | ||
declare type Handlers = { | ||
type Handlers = { | ||
[event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean; | ||
@@ -1164,2 +1184,2 @@ }; | ||
export { Config, HighlightStyle, IndentContext, LRLanguage, Language, LanguageDescription, LanguageSupport, MatchResult, ParseContext, StreamLanguage, StreamParser, StringStream, Sublanguage, TagStyle, TreeIndentContext, bracketMatching, bracketMatchingHandle, codeFolding, continuedIndent, defaultHighlightStyle, defineLanguageFacet, delimitedIndent, ensureSyntaxTree, flatIndent, foldAll, foldCode, foldEffect, foldGutter, foldInside, foldKeymap, foldNodeProp, foldService, foldState, foldable, foldedRanges, forceParsing, getIndentUnit, getIndentation, highlightingFor, indentNodeProp, indentOnInput, indentRange, indentService, indentString, indentUnit, language, languageDataProp, matchBrackets, sublanguageProp, syntaxHighlighting, syntaxParserRunning, syntaxTree, syntaxTreeAvailable, toggleFold, unfoldAll, unfoldCode, unfoldEffect }; | ||
export { Config, DocInput, HighlightStyle, IndentContext, LRLanguage, Language, LanguageDescription, LanguageSupport, MatchResult, ParseContext, StreamLanguage, StreamParser, StringStream, Sublanguage, TagStyle, TreeIndentContext, bracketMatching, bracketMatchingHandle, codeFolding, continuedIndent, defaultHighlightStyle, defineLanguageFacet, delimitedIndent, ensureSyntaxTree, flatIndent, foldAll, foldCode, foldEffect, foldGutter, foldInside, foldKeymap, foldNodeProp, foldService, foldState, foldable, foldedRanges, forceParsing, getIndentUnit, getIndentation, highlightingFor, indentNodeProp, indentOnInput, indentRange, indentService, indentString, indentUnit, language, languageDataProp, matchBrackets, sublanguageProp, syntaxHighlighting, syntaxParserRunning, syntaxTree, syntaxTreeAvailable, toggleFold, unfoldAll, unfoldCode, unfoldEffect }; |
{ | ||
"name": "@codemirror/language", | ||
"version": "6.6.0", | ||
"version": "6.7.0", | ||
"description": "Language support infrastructure for the CodeMirror code editor", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
244181
6160