{"name":"@codemirror/language","version":"6.12.2","keywords":["editor","code"],"author":{"url":"http://marijnhaverbeke.nl","name":"Marijn Haverbeke","email":"marijn@haverbeke.berlin"},"license":"MIT","_id":"@codemirror/language@6.12.2","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":"7db5a46757411cf251e8f450474c05710c27d42c","tarball":"http://registry-npm.ywwl.com/@codemirror/language/download/@codemirror/language-6.12.2.tgz","fileCount":9,"integrity":"sha512-jEPmz2nGGDxhRTg3lTpzmIyGKxz3Gp3SJES4b0nAuE5SWQoKdT5GoQ69cwMmFd+wvFUhYirtDTr0/DRHpQAyWg==","signatures":[{"sig":"MEUCIGeDyXF82j+0jibTlaJ1SoACLBW7qRBNBIGZ+KDIJbtvAiEA8qCfy/sF+xqNEb55P3R9wCeNw16Aux1zEcXTfkPDM/Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":309514,"size":83041,"noattachment":false,"key":"/@codemirror/language/-/@codemirror/language-6.12.2.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":"b5cd54b2ffc8e6edb0f2ae464aa2a59d600d8352","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.9.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.5.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.2_1772026779207_0.8128229849682067","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":1772026779354,"_cnpm_publish_time":1772026779354,"dist-tags":{"latest":"6.13.1"}}