{"name":"@codemirror/language","version":"6.12.4","description":"Language support infrastructure for the CodeMirror code editor","scripts":{"test":"cm-runtests","prepare":"cm-buildhelper src/index.ts"},"keywords":["editor","code"],"author":{"name":"Marijn Haverbeke","email":"marijn@haverbeke.berlin","url":"http://marijnhaverbeke.nl"},"type":"module","main":"dist/index.cjs","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"types":"dist/index.d.ts","module":"dist/index.js","sideEffects":false,"license":"MIT","dependencies":{"@codemirror/state":"^6.0.0","@codemirror/view":"^6.23.0","@lezer/common":"^1.5.0","@lezer/highlight":"^1.0.0","@lezer/lr":"^1.0.0","style-mod":"^4.0.0"},"devDependencies":{"@codemirror/buildhelper":"^1.0.0","@lezer/javascript":"^1.0.0"},"repository":{"type":"git","url":"git+https://code.haverbeke.berlin/codemirror/language.git"},"gitHead":"89974ce5d39539ce6c5cfea5278443fa9381cbf2","_id":"@codemirror/language@6.12.4","_nodeVersion":"22.20.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-1q4PaT+o6PbgpkJt4Q8Fv5XJxTy4FUZ4MWETtyiDw3J0Pyr9E2vqcKL+k9wcvjNTIsauxvE7OfmWj3FRPHQ76A==","shasum":"01e70fd5aa3a8a067ff1dfec75d5b6394cdfa058","tarball":"http://registry-npm.ywwl.com/@codemirror/language/download/@codemirror/language-6.12.4.tgz","fileCount":8,"unpackedSize":310005,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDTiTEka5j17FAi47HXundIxA14DVAvRnzEfzAXaFpamAIhAPNIn3kUZOqwjQxEaaE5EXBuIKaRpOQnF6q/U8fTvwRD"}],"size":82953,"noattachment":false,"key":"/@codemirror/language/-/@codemirror/language-6.12.4.tgz"},"_npmUser":{"name":"marijn","email":"marijn@haverbeke.berlin"},"directories":{},"maintainers":[{"name":"marijn","email":"marijn@haverbeke.berlin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/language_6.12.4_1782372876115_0.053878378415447514"},"_hasShrinkwrap":false,"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":1782372876294,"_cnpm_publish_time":1782372876294,"dist-tags":{"latest":"6.13.1"}}