Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codemirror/language

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/language - npm Package Compare versions

Comparing version 6.2.1 to 6.3.0

8

CHANGELOG.md

@@ -0,1 +1,9 @@

## 6.3.0 (2022-10-24)
### New features
`HighlightStyle` objects now have a `specs` property holding the tag styles that were used to define them.
`Language` objects now have a `name` field holding the language name.
## 6.2.1 (2022-07-21)

@@ -2,0 +10,0 @@

50

dist/index.d.ts

@@ -51,2 +51,6 @@ import { NodeProp, Parser, Tree, TreeFragment, SyntaxNode, NodeType } from '@lezer/common';

/**
A language name.
*/
readonly name: string;
/**
The extension value to install this as the document language.

@@ -74,4 +78,8 @@ */

[name: string]: any;
}>, parser: Parser, extraExtensions?: Extension[]);
}>, parser: Parser, extraExtensions?: Extension[],
/**
A language name.
*/
name?: string);
/**
Query whether this language is active at the given position.

@@ -108,2 +116,6 @@ */

/**
The [name](https://codemirror.net/6/docs/ref/#Language.name) of the language.
*/
name?: string;
/**
The parser to use. Should already have added editor-relevant

@@ -124,5 +136,5 @@ node props (and optionally things like dialect and top rule)

Create a new instance of this language with a reconfigured
version of its parser.
version of its parser and optionally a new name.
*/
configure(options: ParserConfig): LRLanguage;
configure(options: ParserConfig, name?: string): LRLanguage;
get allowsNesting(): boolean;

@@ -356,4 +368,6 @@ }

Facet that defines a way to provide a function that computes the
appropriate indentation depth at the start of a given line, or
`null` to indicate no appropriate indentation could be determined.
appropriate indentation depth, as a column number (see
[`indentString`](https://codemirror.net/6/docs/ref/#language.indentString)), at the start of a given
line, or `null` to indicate no appropriate indentation could be
determined.
*/

@@ -382,8 +396,9 @@ declare const indentService: Facet<(context: IndentContext, pos: number) => number | null, readonly ((context: IndentContext, pos: number) => number | null)[]>;

/**
Get the indentation at the given position. Will first consult any
[indent services](https://codemirror.net/6/docs/ref/#language.indentService) that are registered,
and if none of those return an indentation, this will check the
syntax tree for the [indent node prop](https://codemirror.net/6/docs/ref/#language.indentNodeProp)
and use that if found. Returns a number when an indentation could
be determined, and null otherwise.
Get the indentation, as a column number, at the given position.
Will first consult any [indent services](https://codemirror.net/6/docs/ref/#language.indentService)
that are registered, and if none of those return an indentation,
this will check the syntax tree for the [indent node
prop](https://codemirror.net/6/docs/ref/#language.indentNodeProp) and use that if found. Returns a
number when an indentation could be determined, and null
otherwise.
*/

@@ -486,4 +501,5 @@ declare function getIndentation(context: IndentContext | EditorState, pos: number): number | null;

with node types. Such a strategy is a function from an indentation
context to a column number or null, where null indicates that no
definitive indentation can be determined.
context to a column number (see also
[`indentString`](https://codemirror.net/6/docs/ref/#language.indentString)) or null, where null
indicates that no definitive indentation can be determined.
*/

@@ -743,2 +759,6 @@ declare const indentNodeProp: NodeProp<(context: TreeIndentContext) => number | null>;

/**
The tag styles used to create this highlight style.
*/
readonly specs: readonly TagStyle[];
/**
A style module holding the CSS rules for this highlight style.

@@ -1025,2 +1045,6 @@ When using

/**
A name for this language.
*/
name?: string;
/**
Produce a start state for the parser.

@@ -1027,0 +1051,0 @@ */

{
"name": "@codemirror/language",
"version": "6.2.1",
"version": "6.3.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc