# @codemirror/lang-liquid [](https://www.npmjs.org/package/@codemirror/lang-liquid) [ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-liquid/blob/main/CHANGELOG.md) ] This package implements [Liquid template](https://shopify.github.io/liquid/) support for the [CodeMirror](https://codemirror.net/) code editor. The [project page](https://codemirror.net/) has more information, a number of [examples](https://codemirror.net/examples/) and the [documentation](https://codemirror.net/docs/). This code is released under an [MIT license](https://github.com/codemirror/lang-liquid/tree/main/LICENSE). We aim to be an inclusive, welcoming community. To make that explicit, we have a [code of conduct](http://contributor-covenant.org/version/1/1/0/) that applies to communication around the project. ## Usage ```javascript import {EditorView, basicSetup} from "codemirror" import {liquid} from "@codemirror/lang-liquid" const view = new EditorView({ parent: document.body, doc: `{% if a.active %}{{ a.title }}{% endif %}`, extensions: [basicSetup, liquid()] }) ``` ## API Reference
liquid(config?: LiquidCompletionConfig & Object = {}) → LanguageSupportLiquid template support.
liquidLanguage: LRLanguageA language provider for Liquid templates.
type
LiquidCompletionConfigConfiguration options to
liquidCompletionSource.
Adds additional completions when completing a Liquid tag.
filters?: readonly Completion[]Add additional filter completions.
variables?: readonly Completion[]Add variable completions.
properties?: fn(path: readonly string[], state: EditorState, context: CompletionContext) → readonly Completion[]Provides completions for properties completed under the given
path. For example, when completing user.address., path will
be ["user", "address"].
liquidCompletionSource(config?: LiquidCompletionConfig = {}) → fn(context: CompletionContext) → CompletionResult | nullReturns a completion source for liquid templates. Optionally takes a configuration that adds additional custom completions.
closePercentBrace: ExtensionThis extension will, when the user types a % between two
matching braces, insert two percent signs instead and put the
cursor between them.