{"_id":"@codemirror/language@6.13.1","dist":{"shasum":"61eb04c0265102ff9bb24d9a3ee633d37e84e324","tarball":"http://registry-npm.ywwl.com/@codemirror/language/download/@codemirror/language-6.13.1.tgz","fileCount":8,"integrity":"sha512-zfvU2r3TyylQLMj/te+5CnQ0rSqZi8B1oTCBbQkagcLW4Xc6imab6qN+pEJhsuNOLaJqiRyBXp9UhWA1DhVvDw==","signatures":[{"sig":"MEUCIF2lk6kvMGJ+tlKbCyjWcWB8yA7lUQ8h3jG5RDOsI60qAiEAq2EctPGkaFBKjlMd9eH20eeRzwkqbp+Q7gEw8+CAZJY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAZeHbx7+0aFP2+3oU0rKu/uPu7w3KYmqn5BmmfelA56AiAMkptdkM0iLRldI8D1nT7pyhJluSILeaodeCv/1yyTog=="}],"unpackedSize":291304,"size":77933,"noattachment":false,"key":"/@codemirror/language/-/@codemirror/language-6.13.1.tgz"},"main":"dist/index.cjs","name":"@codemirror/language","type":"module","types":"dist/index.d.ts","author":{"url":"http://marijnhaverbeke.nl","name":"Marijn Haverbeke","email":"marijn@haverbeke.berlin"},"module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"gitHead":"21a38068286652eceb17d8e02da88cbed52f8263","license":"MIT","scripts":{"test":"cm-runtests","prepare":"cm-buildhelper src/index.ts"},"version":"6.13.1","_npmUser":{"name":"marijn","email":"marijn@haverbeke.berlin"},"keywords":["editor","code"],"repository":{"url":"git+https://code.haverbeke.berlin/codemirror/language.git","type":"git"},"_npmVersion":"11.19.0","description":"Language support infrastructure for the CodeMirror code editor","directories":{},"maintainers":[{"name":"marijn","email":"marijn@haverbeke.berlin"}],"sideEffects":false,"_nodeVersion":"24.21.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","@codemirror/streamparser":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@lezer/javascript":"^1.0.0","@codemirror/buildhelper":"^1.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/language_6.13.1_1791379236097_0.8411404282704944"},"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":1791379236281,"_cnpm_publish_time":1791379236281,"dist-tags":{"latest":"6.13.1"}}