pax_global_header00006660000000000000000000000064143254772070014525gustar00rootroot0000000000000052 comment=c2a19162a37b4155197d192b646a448e0ba1287f lang-java-6.0.1/000077500000000000000000000000001432547720700133715ustar00rootroot00000000000000lang-java-6.0.1/.github/000077500000000000000000000000001432547720700147315ustar00rootroot00000000000000lang-java-6.0.1/.github/workflows/000077500000000000000000000000001432547720700167665ustar00rootroot00000000000000lang-java-6.0.1/.github/workflows/dispatch.yml000066400000000000000000000006371432547720700213160ustar00rootroot00000000000000name: Trigger CI on: push jobs: build: name: Dispatch to main repo runs-on: ubuntu-latest steps: - name: Emit repository_dispatch uses: mvasigh/dispatch-action@main with: # You should create a personal access token and store it in your repository token: ${{ secrets.DISPATCH_AUTH }} repo: dev owner: codemirror event_type: push lang-java-6.0.1/.gitignore000066400000000000000000000001271432547720700153610ustar00rootroot00000000000000/node_modules package-lock.json /dist /test/*.js /test/*.d.ts /test/*.d.ts.map .tern-* lang-java-6.0.1/.npmignore000066400000000000000000000001001432547720700153570ustar00rootroot00000000000000/src /test /node_modules .tern-* rollup.config.js tsconfig.json lang-java-6.0.1/CHANGELOG.md000066400000000000000000000013311432547720700152000ustar00rootroot00000000000000## 6.0.1 (2022-10-24) ### Bug fixes Fix (non-)auto indentation in template strings and comments. ## 6.0.0 (2022-06-08) ### Breaking changes Update dependencies to 6.0.0 ## 0.20.1 (2022-05-29) ### Bug fixes Fix indentation of braced blocks. ## 0.20.0 (2022-04-20) ### Breaking changes Update dependencies to 0.20.0 ## 0.19.1 (2021-08-11) ### Bug fixes Fix incorrect versions for @lezer dependencies. ## 0.19.0 (2021-08-11) ### Breaking changes Update dependencies to 0.19.0 ## 0.18.0 (2021-03-03) ### Breaking changes Update dependencies to 0.18. ## 0.17.1 (2021-01-06) ### New features The package now also exports a CommonJS module. ## 0.17.0 (2020-12-29) ### Breaking changes First numbered release. lang-java-6.0.1/LICENSE000066400000000000000000000021301432547720700143720ustar00rootroot00000000000000MIT License Copyright (C) 2018-2021 by Marijn Haverbeke and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lang-java-6.0.1/README.md000066400000000000000000000032321432547720700146500ustar00rootroot00000000000000 # @codemirror/lang-java [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-java.svg)](https://www.npmjs.org/package/@codemirror/lang-java) [ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-java/blob/main/CHANGELOG.md) ] This package implements Java language 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-java/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. ## API Reference
java() → LanguageSupport

Java language support.

javaLanguage: LezerLanguage

A language provider based on the Lezer Java parser, extended with highlighting and indentation information.

lang-java-6.0.1/package.json000066400000000000000000000015721432547720700156640ustar00rootroot00000000000000{ "name": "@codemirror/lang-java", "version": "6.0.1", "description": "Java language support for the CodeMirror code editor", "scripts": { "test": "cm-runtests", "prepare": "cm-buildhelper src/java.ts" }, "keywords": [ "editor", "code" ], "author": { "name": "Marijn Haverbeke", "email": "marijnh@gmail.com", "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/language": "^6.0.0", "@lezer/java": "^1.0.0" }, "devDependencies": { "@codemirror/buildhelper": "^0.1.0" }, "repository": { "type": "git", "url": "https://github.com/codemirror/lang-java.git" } } lang-java-6.0.1/src/000077500000000000000000000000001432547720700141605ustar00rootroot00000000000000lang-java-6.0.1/src/README.md000066400000000000000000000020741432547720700154420ustar00rootroot00000000000000 # @codemirror/lang-java [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-java.svg)](https://www.npmjs.org/package/@codemirror/lang-java) [ [**WEBSITE**](https://codemirror.net/6/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-java/blob/main/CHANGELOG.md) ] This package implements Java language support for the [CodeMirror](https://codemirror.net/6/) code editor. The [project page](https://codemirror.net/6/) has more information, a number of [examples](https://codemirror.net/6/examples/) and the [documentation](https://codemirror.net/6/docs/). This code is released under an [MIT license](https://github.com/codemirror/lang-java/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. ## API Reference @java @javaLanguage lang-java-6.0.1/src/java.ts000066400000000000000000000030601432547720700154500ustar00rootroot00000000000000import {parser} from "@lezer/java" import {flatIndent, continuedIndent, indentNodeProp, delimitedIndent, foldNodeProp, foldInside, LRLanguage, LanguageSupport} from "@codemirror/language" /// A language provider based on the [Lezer Java /// parser](https://github.com/lezer-parser/java), extended with /// highlighting and indentation information. export const javaLanguage = LRLanguage.define({ name: "java", parser: parser.configure({ props: [ indentNodeProp.add({ IfStatement: continuedIndent({except: /^\s*({|else\b)/}), TryStatement: continuedIndent({except: /^\s*({|catch|finally)\b/}), LabeledStatement: flatIndent, SwitchBlock: context => { let after = context.textAfter, closed = /^\s*\}/.test(after), isCase = /^\s*(case|default)\b/.test(after) return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit }, Block: delimitedIndent({closing: "}"}), BlockComment: () => null, Statement: continuedIndent({except: /^{/}) }), foldNodeProp.add({ ["Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody " + "ConstructorBody InterfaceBody ArrayInitializer"]: foldInside, BlockComment(tree) { return {from: tree.from + 2, to: tree.to - 2} } }) ] }), languageData: { commentTokens: {line: "//", block: {open: "/*", close: "*/"}}, indentOnInput: /^\s*(?:case |default:|\{|\})$/ } }) /// Java language support. export function java() { return new LanguageSupport(javaLanguage) }