{"name":"@codemirror/language","version":"6.12.0","keywords":["editor","code"],"author":{"url":"http://marijnhaverbeke.nl","name":"Marijn Haverbeke","email":"marijn@haverbeke.berlin"},"license":"MIT","_id":"@codemirror/language@6.12.0","maintainers":[{"name":"adrianheine","email":"mail@adrianheine.de"},{"name":"marijn","email":"marijn@haverbeke.berlin"}],"homepage":"https://github.com/codemirror/language#readme","bugs":{"url":"https://github.com/codemirror/language/issues"},"dist":{"shasum":"f9d8651ded78e66bd00bf12a32b7e9b41387de1c","tarball":"http://registry-npm.ywwl.com/@codemirror/language/download/@codemirror/language-6.12.0.tgz","fileCount":9,"integrity":"sha512-MyihkdizhhxkFkKvfE2iGZZ4CUOESMWYipFTGVN2wrSgbb4pWlkRRZY/DzEnTRBzoCTSSC8wKVc4I3KyQlcADQ==","signatures":[{"sig":"MEUCIQDJ+f3GPwmMd2xezSNmLrUugaGovhTG+/5dqiJ+kLGf5QIgSOCwXSo+a/0yHNnuUmVZr7fhvXIT3nbagMYIW+dnMW4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":310982,"size":83333,"noattachment":false,"key":"/@codemirror/language/-/@codemirror/language-6.12.0.tgz"},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"gitHead":"43dadca7e6340cfc19087452ef6f79ef72c3b502","scripts":{"test":"cm-runtests","prepare":"cm-buildhelper src/index.ts"},"_npmUser":{"name":"marijn","email":"marijn@haverbeke.berlin"},"repository":{"url":"git+https://github.com/codemirror/language.git","type":"git"},"_npmVersion":"11.7.0","description":"Language support infrastructure for the CodeMirror code editor","directories":{},"sideEffects":false,"_nodeVersion":"22.20.0","dependencies":{"@lezer/lr":"^1.0.0","style-mod":"^4.0.0","@lezer/common":"^1.1.0","@codemirror/view":"^6.23.0","@lezer/highlight":"^1.0.0","@codemirror/state":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@lezer/javascript":"^1.0.0","@codemirror/buildhelper":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/language_6.12.0_1766396684524_0.18800780758908697","host":"s3://npm-registry-packages-npm-production"},"readme":"# @codemirror/language [![NPM version](https://img.shields.io/npm/v/@codemirror/language.svg)](https://www.npmjs.org/package/@codemirror/language)\n\n[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#language) | [**ISSUES**](https://code.haverbeke.berlin/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/) | [**CHANGELOG**](https://code.haverbeke.berlin/codemirror/language/src/branch/main/CHANGELOG.md) ]\n\nThis package implements the language support infrastructure for the\n[CodeMirror](https://codemirror.net/) code editor.\n\nThe [project page](https://codemirror.net/) has more information, a\nnumber of [examples](https://codemirror.net/examples/) and the\n[documentation](https://codemirror.net/docs/).\n\nThis code is released under an\n[MIT license](https://code.haverbeke.berlin/codemirror/language/tree/main/LICENSE).\n\nWe aim to be an inclusive, welcoming community. To make that explicit,\nwe have a [code of\nconduct](http://contributor-covenant.org/version/1/1/0/) that applies\nto communication around the project.\n\n## Usage\n\nSetting up a language from a [Lezer](https://lezer.codemirror.net)\nparser looks like this:\n\n```javascript\nimport {parser} from \"@lezer/json\"\nimport {LRLanguage, continuedIndent, indentNodeProp,\n        foldNodeProp, foldInside} from \"@codemirror/language\"\n\nexport const jsonLanguage = LRLanguage.define({\n  name: \"json\",\n  parser: parser.configure({\n    props: [\n      indentNodeProp.add({\n        Object: continuedIndent({except: /^\\s*\\}/}),\n        Array: continuedIndent({except: /^\\s*\\]/})\n      }),\n      foldNodeProp.add({\n        \"Object Array\": foldInside\n      })\n    ]\n  }),\n  languageData: {\n    closeBrackets: {brackets: [\"[\", \"{\", '\"']},\n    indentOnInput: /^\\s*[\\}\\]]$/\n  }\n})\n```\n\nOften, you'll also use this package just to access some specific\nlanguage-related features, such as accessing the editor's syntax\ntree...\n\n```javascript\nimport {syntaxTree} from \"@codemirror/language\"\n\nconst tree = syntaxTree(view)\n```\n\n... or computing the appriate indentation at a given point.\n\n```javascript\nimport {getIndentation} from \"@codemirror/language\"\n\nconsole.log(getIndentation(view.state, view.state.selection.main.head))\n```\n","publish_time":1766396684734,"_cnpm_publish_time":1766396684734,"dist-tags":{"latest":"6.13.1"}}