{"_id":"codemirror-languageservice","_rev":"6-a5cecb574c6df74fd5d5cc1fff250df8","name":"codemirror-languageservice","dist-tags":{"latest":"0.2.3"},"versions":{"0.1.0":{"name":"codemirror-languageservice","version":"0.1.0","keywords":["code","codemirror","code-mirror","editor","languageserver","languageservice","language-server","language-service","lsp"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"codemirror-languageservice@0.1.0","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://github.com/remcohaszing/codemirror-languageservice#readme","bugs":{"url":"https://github.com/remcohaszing/codemirror-languageservice/issues"},"dist":{"shasum":"32dff38a3e4ff74406ad3331c6497b4a2a71e635","tarball":"https://registry.npmjs.org/codemirror-languageservice/-/codemirror-languageservice-0.1.0.tgz","fileCount":43,"integrity":"sha512-6UjlufS2595e98ybX8Ty0Wwe/ND6t+0nIZG4Bp39oy8Wsk7V2t81c+xzPmNrV0jOV3HZKhyLnVHbPTxw75a0JQ==","signatures":[{"sig":"MEYCIQDcJOmAh3v7Gd2RFouAMaIFdOAZ753TOyCgS2OxMb1+XAIhAINH2h5E6JO/wcRq4v+6Cm6wLHLOC+7d0VsbwJhs5fFi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/codemirror-languageservice@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":69356},"type":"module","_from":"file:codemirror-languageservice-0.1.0.tgz","exports":"./dist/codemirror-languageservice.js","funding":"https://github.com/sponsors/remcohaszing","scripts":{"test":"vitest run","start":"vite example","prepack":"tsc --build","prestart":"tsc --build"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/codemirror-languageservice/codemirror-languageservice/codemirror-languageservice-0.1.0.tgz","_integrity":"sha512-6UjlufS2595e98ybX8Ty0Wwe/ND6t+0nIZG4Bp39oy8Wsk7V2t81c+xzPmNrV0jOV3HZKhyLnVHbPTxw75a0JQ==","repository":{"url":"git+https://github.com/remcohaszing/codemirror-languageservice.git","type":"git"},"_npmVersion":"10.8.2","description":"Integrate an LSP compatible language service into CodeMirror","directories":{},"sideEffects":false,"_nodeVersion":"22.5.1","dependencies":{"vscode-languageserver-protocol":"^3.0.0","vscode-languageserver-textdocument":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.0","eslint":"^8.0.0","vitest":"^2.0.0","prettier":"^3.0.0","playwright":"^1.0.0","remark-cli":"^12.0.0","typescript":"^5.0.0","@vitest/browser":"^2.0.0","hast-util-to-dom":"^4.0.0","mdast-util-to-hast":"^13.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-json":"^6.0.0","mdast-util-from-markdown":"^2.0.0","@vitest/coverage-istanbul":"^2.0.0","@codemirror/theme-one-dark":"^6.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^3.0.0","vscode-languageserver-types":"^3.0.0"},"peerDependencies":{"@codemirror/lint":"^6.0.0","@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/autocomplete":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/codemirror-languageservice_0.1.0_1722173189546_0.9177281938409863","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"codemirror-languageservice","version":"0.1.1","keywords":["code","codemirror","code-mirror","editor","languageserver","languageservice","language-server","language-service","lsp"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"codemirror-languageservice@0.1.1","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://github.com/remcohaszing/codemirror-languageservice#readme","bugs":{"url":"https://github.com/remcohaszing/codemirror-languageservice/issues"},"dist":{"shasum":"ae9c8357d9cb8f18a4db0a286e9ec569d784f228","tarball":"https://registry.npmjs.org/codemirror-languageservice/-/codemirror-languageservice-0.1.1.tgz","fileCount":43,"integrity":"sha512-A57Cm+sORDxqwKDtKBJS7QwOlSkqiG2h1VT5KrD/ooESVNfdPy9U/cbzY1FBCZtAhNcshxYHNjNi8kdFdg+feA==","signatures":[{"sig":"MEQCIEbe6OgqxsViBcevSJFKVnhHawiMlpx1ADNNGNQ55SCJAiBsr7w4D4jnIv2Me17rWwTthlSxNq+dmxrayafY0+BIdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/codemirror-languageservice@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":69610},"type":"module","_from":"file:codemirror-languageservice-0.1.1.tgz","exports":"./dist/codemirror-languageservice.js","funding":"https://github.com/sponsors/remcohaszing","scripts":{"test":"vitest run","start":"vite example","prepack":"tsc --build","prestart":"tsc --build"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/codemirror-languageservice/codemirror-languageservice/codemirror-languageservice-0.1.1.tgz","_integrity":"sha512-A57Cm+sORDxqwKDtKBJS7QwOlSkqiG2h1VT5KrD/ooESVNfdPy9U/cbzY1FBCZtAhNcshxYHNjNi8kdFdg+feA==","repository":{"url":"git+https://github.com/remcohaszing/codemirror-languageservice.git","type":"git"},"_npmVersion":"10.8.2","description":"Integrate a Language Server Protocol compatible language service into CodeMirror","directories":{},"sideEffects":false,"_nodeVersion":"22.5.1","dependencies":{"vscode-languageserver-protocol":"^3.0.0","vscode-languageserver-textdocument":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.0","eslint":"^8.0.0","vitest":"^2.0.0","prettier":"^3.0.0","playwright":"^1.0.0","remark-cli":"^12.0.0","typescript":"^5.0.0","@vitest/browser":"^2.0.0","hast-util-to-dom":"^4.0.0","mdast-util-to-hast":"^13.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-json":"^6.0.0","mdast-util-from-markdown":"^2.0.0","@vitest/coverage-istanbul":"^2.0.0","@codemirror/theme-one-dark":"^6.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^3.0.0","vscode-languageserver-types":"^3.0.0"},"peerDependencies":{"@codemirror/lint":"^6.0.0","@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/autocomplete":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/codemirror-languageservice_0.1.1_1722510904719_0.14015950941929578","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"codemirror-languageservice","version":"0.2.0","keywords":["code","codemirror","code-mirror","editor","languageserver","languageservice","language-server","language-service","lsp"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"codemirror-languageservice@0.2.0","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://github.com/remcohaszing/codemirror-languageservice#readme","bugs":{"url":"https://github.com/remcohaszing/codemirror-languageservice/issues"},"dist":{"shasum":"1065ef55b3ca3ff1d49428b2e6d198e02dabdcb2","tarball":"https://registry.npmjs.org/codemirror-languageservice/-/codemirror-languageservice-0.2.0.tgz","fileCount":43,"integrity":"sha512-YD14HCaof6R5OtZRhc90+AOhxKtodcqzKLlWkXWZ0bFb8Q/SnVUbQTCSu9USJEH9ujUQX+Aj3m+hjfLcdRjo6Q==","signatures":[{"sig":"MEYCIQDpK6vtB29FJ31gSIVuG+wojXS+quN/sZ1+1XIPr8UCLwIhAP1KHylWvwGUG5JPQAyiT/Ke7mDOPF0400lJ6nOLTaCm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/codemirror-languageservice@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70702},"type":"module","_from":"file:codemirror-languageservice-0.2.0.tgz","exports":"./dist/codemirror-languageservice.js","funding":"https://github.com/sponsors/remcohaszing","scripts":{"test":"vitest run","start":"vite example","prepack":"tsc --build","prestart":"tsc --build"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/codemirror-languageservice/codemirror-languageservice/codemirror-languageservice-0.2.0.tgz","_integrity":"sha512-YD14HCaof6R5OtZRhc90+AOhxKtodcqzKLlWkXWZ0bFb8Q/SnVUbQTCSu9USJEH9ujUQX+Aj3m+hjfLcdRjo6Q==","repository":{"url":"git+https://github.com/remcohaszing/codemirror-languageservice.git","type":"git"},"_npmVersion":"10.8.2","description":"Integrate a Language Server Protocol compatible language service into CodeMirror","directories":{},"sideEffects":false,"_nodeVersion":"22.5.1","dependencies":{"vscode-languageserver-protocol":"^3.0.0","vscode-languageserver-textdocument":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.0","eslint":"^8.0.0","vitest":"^2.0.0","prettier":"^3.0.0","playwright":"^1.0.0","remark-cli":"^12.0.0","typescript":"^5.0.0","@vitest/browser":"^2.0.0","hast-util-to-dom":"^4.0.0","mdast-util-to-hast":"^13.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-json":"^6.0.0","mdast-util-from-markdown":"^2.0.0","@vitest/coverage-istanbul":"^2.0.0","@codemirror/theme-one-dark":"^6.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^3.0.0","vscode-languageserver-types":"^3.0.0"},"peerDependencies":{"@codemirror/lint":"^6.0.0","@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/autocomplete":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/codemirror-languageservice_0.2.0_1722846922608_0.30635271686253707","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"codemirror-languageservice","version":"0.2.1","keywords":["code","codemirror","code-mirror","editor","languageserver","languageservice","language-server","language-service","lsp"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"codemirror-languageservice@0.2.1","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://github.com/remcohaszing/codemirror-languageservice#readme","bugs":{"url":"https://github.com/remcohaszing/codemirror-languageservice/issues"},"dist":{"shasum":"efa00f550227363d7643562b3ad590380b02807c","tarball":"https://registry.npmjs.org/codemirror-languageservice/-/codemirror-languageservice-0.2.1.tgz","fileCount":43,"integrity":"sha512-ZpdlNA8y7ysgquWLah9poH7QdBoixyGcM7LXSuhooqgaaeQB5FjB+QnIud+p61sXAIUQAL7texhb2wA6zZw+Sw==","signatures":[{"sig":"MEYCIQCnozj4oalPDrUtzcRZfGUn3UVahKtDrfQzWJGaEYCwMAIhAI/OvchhcaV58MugrBA9IQqCDTJeMMjFxptfAsycmTBS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/codemirror-languageservice@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":71445},"type":"module","_from":"file:codemirror-languageservice-0.2.1.tgz","exports":"./dist/codemirror-languageservice.js","funding":"https://github.com/sponsors/remcohaszing","scripts":{"test":"vitest run","start":"vite example","prepack":"tsc --build","prestart":"tsc --build"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/codemirror-languageservice/codemirror-languageservice/codemirror-languageservice-0.2.1.tgz","_integrity":"sha512-ZpdlNA8y7ysgquWLah9poH7QdBoixyGcM7LXSuhooqgaaeQB5FjB+QnIud+p61sXAIUQAL7texhb2wA6zZw+Sw==","repository":{"url":"git+https://github.com/remcohaszing/codemirror-languageservice.git","type":"git"},"_npmVersion":"10.8.2","description":"Integrate a Language Server Protocol compatible language service into CodeMirror","directories":{},"sideEffects":false,"_nodeVersion":"22.6.0","dependencies":{"vscode-languageserver-protocol":"^3.0.0","vscode-languageserver-textdocument":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.0","eslint":"^8.0.0","vitest":"^2.0.0","prettier":"^3.0.0","playwright":"^1.0.0","remark-cli":"^12.0.0","typescript":"^5.0.0","@vitest/browser":"^2.0.0","hast-util-to-dom":"^4.0.0","mdast-util-to-hast":"^13.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-json":"^6.0.0","mdast-util-from-markdown":"^2.0.0","@vitest/coverage-istanbul":"^2.0.0","@codemirror/theme-one-dark":"^6.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^3.0.0","vscode-json-languageservice":"^5.0.0","vscode-languageserver-types":"^3.0.0"},"peerDependencies":{"@codemirror/lint":"^6.0.0","@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/autocomplete":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/codemirror-languageservice_0.2.1_1723203731606_0.371445270336924","host":"s3://npm-registry-packages"}},"0.2.2":{"name":"codemirror-languageservice","version":"0.2.2","keywords":["code","codemirror","code-mirror","editor","languageserver","languageservice","language-server","language-service","lsp"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"codemirror-languageservice@0.2.2","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://codemirror-languageservice.js.org","bugs":{"url":"https://github.com/remcohaszing/codemirror-languageservice/issues"},"dist":{"shasum":"f826d665e25deb1ca9fd8e8f870d5b6b7ca4ef57","tarball":"https://registry.npmjs.org/codemirror-languageservice/-/codemirror-languageservice-0.2.2.tgz","fileCount":43,"integrity":"sha512-KOVRKNEreiexFngfr53jXuULmM/bPobGrmaifVK0Skw2H6ufBHheAI/yfqT9c68qzpGWL6slPmf+ijA1dQQRtw==","signatures":[{"sig":"MEUCIQD9whJcwjZRWA8wuAmj/TE5t2N11BWt3wVYZB32RvzU/AIge071CBmj8EtSt8t9vsvRQ+ftt1gfDe1LvSzWhP9/yH4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/codemirror-languageservice@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72116},"type":"module","_from":"file:codemirror-languageservice-0.2.2.tgz","exports":"./dist/codemirror-languageservice.js","funding":"https://github.com/sponsors/remcohaszing","scripts":{"test":"vitest run","start":"vite example","prepack":"tsc --build","prestart":"tsc --build"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/codemirror-languageservice/codemirror-languageservice/codemirror-languageservice-0.2.2.tgz","_integrity":"sha512-KOVRKNEreiexFngfr53jXuULmM/bPobGrmaifVK0Skw2H6ufBHheAI/yfqT9c68qzpGWL6slPmf+ijA1dQQRtw==","repository":{"url":"git+https://github.com/remcohaszing/codemirror-languageservice.git","type":"git"},"_npmVersion":"10.8.2","description":"Integrate a Language Server Protocol compatible language service into CodeMirror","directories":{},"sideEffects":false,"_nodeVersion":"22.6.0","dependencies":{"vscode-languageserver-protocol":"^3.0.0","vscode-languageserver-textdocument":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.0","eslint":"^8.0.0","vitest":"^2.0.0","prettier":"^3.0.0","playwright":"^1.0.0","remark-cli":"^12.0.0","typescript":"^5.0.0","@vitest/browser":"^2.0.0","hast-util-to-dom":"^4.0.0","mdast-util-to-hast":"^13.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-json":"^6.0.0","mdast-util-from-markdown":"^2.0.0","@vitest/coverage-istanbul":"^2.0.0","@codemirror/theme-one-dark":"^6.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^3.0.0","vscode-json-languageservice":"^5.0.0","vscode-languageserver-types":"^3.0.0"},"peerDependencies":{"@codemirror/lint":"^6.0.0","@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/autocomplete":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/codemirror-languageservice_0.2.2_1723637248826_0.5150327638743806","host":"s3://npm-registry-packages"}},"0.2.3":{"name":"codemirror-languageservice","version":"0.2.3","description":"Integrate a Language Server Protocol compatible language service into CodeMirror","keywords":["code","codemirror","code-mirror","editor","languageserver","languageservice","language-server","language-service","lsp"],"homepage":"https://codemirror-languageservice.js.org","bugs":{"url":"https://github.com/remcohaszing/codemirror-languageservice/issues"},"repository":{"type":"git","url":"git+https://github.com/remcohaszing/codemirror-languageservice.git"},"funding":"https://github.com/sponsors/remcohaszing","license":"MIT","author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"sideEffects":false,"type":"module","exports":"./dist/codemirror-languageservice.js","scripts":{"prepack":"tsc --build","prestart":"tsc --build","start":"vite example","test":"vitest run"},"dependencies":{"vscode-languageserver-protocol":"^3.0.0","vscode-languageserver-textdocument":"^1.0.0"},"peerDependencies":{"@codemirror/autocomplete":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/lint":"^6.0.0","@codemirror/state":"^6.0.0","@codemirror/view":"^6.0.0"},"devDependencies":{"@codemirror/commands":"^6.0.0","@codemirror/lang-javascript":"^6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/theme-one-dark":"^6.0.0","@remcohaszing/eslint":"^11.0.0","@vitest/browser":"^3.0.0","@vitest/coverage-istanbul":"^3.0.0","@volar/jsdelivr":"~2.4.0","@volar/language-service":"~2.4.0","@volar/typescript":"~2.4.0","hast-util-to-dom":"^4.0.0","mdast-util-from-markdown":"^2.0.0","mdast-util-to-hast":"^13.0.0","playwright":"^1.0.0","prettier":"^3.0.0","remark-cli":"^12.0.0","remark-preset-remcohaszing":"^3.0.0","typescript":"^5.0.0","vite":"^6.0.0","vitest":"^3.0.0","volar-service-typescript":"0.0.64","vscode-json-languageservice":"^5.0.0","vscode-languageserver-types":"^3.0.0","vscode-uri":"^3.0.0"},"_id":"codemirror-languageservice@0.2.3","_integrity":"sha512-VUUsdw+9A3JhCCj3+WiF3P/oELWDXdTWd73RiHbADCf5KyiKLbkakSztazb1PMKwNDywQ/wh4JaZh6Qo4gwhfA==","_resolved":"/home/runner/work/codemirror-languageservice/codemirror-languageservice/codemirror-languageservice-0.2.3.tgz","_from":"file:codemirror-languageservice-0.2.3.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-VUUsdw+9A3JhCCj3+WiF3P/oELWDXdTWd73RiHbADCf5KyiKLbkakSztazb1PMKwNDywQ/wh4JaZh6Qo4gwhfA==","shasum":"f270368caad616ac71290c51882edefe19eab578","tarball":"https://registry.npmjs.org/codemirror-languageservice/-/codemirror-languageservice-0.2.3.tgz","fileCount":43,"unpackedSize":72988,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/codemirror-languageservice@0.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDTQB2iRma+lfPxzQ5vX7SIOSlSkyGpVMV0xESLHJiYFwIgclc1fBZ0cghxhybZTKIYJjmjbjDzuVC9TqL8Aij7aB4="}]},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"directories":{},"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/codemirror-languageservice_0.2.3_1744802989969_0.9750482575912915"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-28T13:26:29.447Z","modified":"2025-04-16T11:29:50.573Z","0.1.0":"2024-07-28T13:26:29.723Z","0.1.1":"2024-08-01T11:15:04.883Z","0.2.0":"2024-08-05T08:35:22.760Z","0.2.1":"2024-08-09T11:42:11.860Z","0.2.2":"2024-08-14T12:07:28.983Z","0.2.3":"2025-04-16T11:29:50.195Z"},"bugs":{"url":"https://github.com/remcohaszing/codemirror-languageservice/issues"},"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","homepage":"https://codemirror-languageservice.js.org","keywords":["code","codemirror","code-mirror","editor","languageserver","languageservice","language-server","language-service","lsp"],"repository":{"type":"git","url":"git+https://github.com/remcohaszing/codemirror-languageservice.git"},"description":"Integrate a Language Server Protocol compatible language service into CodeMirror","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"readme":"# codemirror-languageservice\n\n[![github actions](https://github.com/remcohaszing/codemirror-languageservice/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/codemirror-languageservice/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/remcohaszing/codemirror-languageservice/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/codemirror-languageservice)\n[![npm version](https://img.shields.io/npm/v/codemirror-languageservice)](https://www.npmjs.com/package/codemirror-languageservice)\n[![npm downloads](https://img.shields.io/npm/dm/codemirror-languageservice)](https://www.npmjs.com/package/codemirror-languageservice)\n\nIntegrate a [Language Server Protocol][lsp] compatible language service into [CodeMirror][].\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n  - [`createCompletionSource(options)`](#createcompletionsourceoptions)\n  - [`createHoverTooltipSource(options)`](#createhovertooltipsourceoptions)\n  - [`createLintSource(options)`](#createlintsourceoptions)\n  - [`dispatchTextEdits(view, edits)`](#dispatchtexteditsview-edits)\n  - [`getTextDocument(state)`](#gettextdocumentstate)\n  - [`textDocument(uri?)`](#textdocumenturi)\n- [Example](#example)\n- [Compatibility](#compatibility)\n- [Contributing](#contributing)\n- [Related projects](#related-projects)\n- [License](#license)\n\n## Installation\n\nThis package has peer dependencies on the following packages:\n\n- [`@codemirror/autocomplete`](https://www.npmjs.com/package/@codemirror/autocomplete)\n- [`@codemirror/language`](https://www.npmjs.com/package/@codemirror/language)\n- [`@codemirror/lint`](https://www.npmjs.com/package/@codemirror/lint)\n- [`@codemirror/state`](https://www.npmjs.com/package/@codemirror/state)\n- [`@codemirror/view`](https://www.npmjs.com/package/@codemirror/view)\n\nSince you will probably import these directly yourself, it’s recommended to install all of them\nexplicitly.\n\n```sh\nnpm install \\\n  @codemirror/autocomplete \\\n  @codemirror/language \\\n  @codemirror/lint \\\n  @codemirror/state \\\n  @codemirror/view \\\n  codemirror-languageservice\n```\n\n## Usage\n\n- First, create a [CodeMirror][] `EditorView` as usual.\n- Since [LSP][] is based heavily on files and URIs, you need to add the `textDocument()` extension\n  to your editor. It’s recommended to pass a file URI. If none is given, a URI is generated that\n  uses the `inmemory://` protocol.\n- It’s recommended to add a language extension. This is used to detect the `languageId` for text\n  documents. If this isn’t available, the `plaintext` language is used.\n- Since [LSP][] uses markdown, you need to provide a function to convert markdown to DOM. A good\n  option is to combine [`hast-util-to-dom`](https://github.com/syntax-tree/hast-util-to-dom),\n  [`mdast-util-from-markdown`](https://github.com/syntax-tree/mdast-util-from-markdown), and\n  [`mdast-util-to-hast`](https://github.com/syntax-tree/mdast-util-to-hast).\n- Add your language service integrations.\n\n```js\nimport { autocompletion } from '@codemirror/autocomplete'\nimport { json } from '@codemirror/lang-json'\nimport { linter } from '@codemirror/lint'\nimport { EditorView, hoverTooltip } from '@codemirror/view'\nimport {\n  createCompletionSource,\n  createHoverTooltipSource,\n  createLintSource,\n  textDocument\n} from 'codemirror-languageservice'\nimport { toDom } from 'hast-util-to-dom'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { toHast } from 'mdast-util-to-hast'\n\nimport { doComplete, doDiagnostics, doHover } from './my-language-service.js'\n\nfunction markdownToDom(markdown) {\n  const mdast = fromMarkdown(markdown)\n  const hast = toHast(mdast)\n  return toDom(hast, { fragment: true })\n}\n\nconst view = new EditorView({\n  doc: '',\n  parent: document.getElementById('my-editor'),\n  extensions: [\n    json(),\n    textDocument('file:///example.txt'),\n    autocompletion({\n      override: [createCompletionSource({ doComplete, markdownToDom })]\n    }),\n    hoverTooltip(createHoverTooltipSource({ doHover, markdownToDom })),\n    linter(createLintSource({ doDiagnostics }))\n  ]\n})\n```\n\n## API\n\n### `createCompletionSource(options)`\n\nCreate an LSP based completion source.\n\n#### Options\n\n- `doComplete` (`Function`) — Provide LSP completions items.\n- `markdownToDom` (`Function`) — Convert a markdown string to DOM.\n- `fromCompletionItemKind` (`Function`, optional) — Convert an LSP completion item kind to a\n  CodeMirror completion type.\n- `section` (`string`, optional) — The section to use for completions.\n- `triggerCharacters` (`string`) — Only trigger completions automatically when one of these\n  characters is typed.\n\n#### Returns\n\nA CodeMirror completion source that uses LSP based completions.\n([`CompletionSource`](https://codemirror.net/docs/ref/#autocomplete.CompletionSource))\n\n### `createHoverTooltipSource(options)`\n\nCreate an LSP based hover tooltip provider.\n\n#### Options\n\n- `doHover` (`Function`) — Provide LSP hover info\n- `markdownToDom` (`Function`) — Convert a markdown string to DOM.\n\n#### Returns\n\nA CodeMirror hover tooltip source that uses LSP based hover information.\n([`HoverTooltipSource`](https://codemirror.net/docs/ref/#view.HoverTooltipSource))\n\n### `createLintSource(options)`\n\nCreate an LSP based lint source.\n\nBy default CodeMirror provides styling for the `cm-lintRange-hint`, `cm-lintRange-info`,\n`cm-lintRange-warning`, and `cm-lintRange-error` classes. This extension also uses the\n`cm-lintRange-deprecated` and `cm-lintRange-unnecessary` classes which you may want to style. For\nexample:\n\n```css\n.cm-lintRange-deprecated {\n  background-image: none !important;\n  text-decoration: line-through;\n}\n\n.cm-lintRange-unnecessary {\n  background-repeat: no-repeat !important;\n  opacity: 0.4;\n}\n```\n\n#### Options\n\n- `doDiagnostics` (`Function`) — Provide LSP diagnostics\n- `formatSource` (`Function`, optional) — Format the source of a diagnostic.\n- `markClass` (`string`, optional) — An additional class for all diagnostics provided by this\n  validation.\n\n#### Returns\n\nA CodeMirror lint source that uses LSP based diagnostics.\n([`LintSource`](https://codemirror.net/docs/ref/#lint.LintSource))\n\n### `dispatchTextEdits(view, edits)`\n\nApply LSP text edits to an CodeMirror `EditorView`.\n\n#### Parameters\n\n- `view` ([`EditorView`](https://codemirror.net/docs/ref/#view.EditorView)) — The view to dispatch\n  the changes to.\n- `edits`\n  ([`TextEdit[]`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textEditArray))\n  — The edits that should be applied.\n\n### `getTextDocument(state)`\n\nGet the text document for a CodeMirror editor state.\n\n#### Parameters\n\n- `state` ([`EditorState`](https://codemirror.net/docs/ref/#state.EditorState)) — The editor state\n  to get the text document for.\n\n#### Returns\n\nThe text document.\n([`TextDocument`](https://github.com/microsoft/vscode-languageserver-node/tree/main/textDocument))\n\n### `textDocument(uri?)`\n\nAssign a text document to an editor state.\n\nThis text document is used by other extensions provided by `codemirror-languageservice`.\n\nThe language ID is determined from the name of the [language](https://codemirror.net/#languages)\nused. If this isn’t found, the language ID defaults to `plaintext`.\n\n#### Parameters\n\n- `uri` (`string`) —The URI to use for the text document. If this is left unspecified, an\n  auto-incremented `inmemory://` URI is used.\n\n#### Returns\n\nA CodeMirror extension. ([`Extension`](https://codemirror.net/docs/ref/#state.Extension))\n\n## Example\n\nThere’s an example available in the\n[`example`](https://github.com/remcohaszing/codemirror-languageservice/blob/main/example) directory.\n\n## Compatibility\n\nThis project is compatible with [evergreen](https://www.w3.org/2001/tag/doc/evergreen-web) browsers.\n\n## Contributing\n\nThis project provides [LSP][] based integrations for [CodeMirror][]. However, not all LSP features\nmap well to CodeMirror. The goal is only to provide integrations that make sense for CodeMirror. If\nyou have a pragmatic idea to integrate another LSP method, feel free to open a\n[new issue](https://github.com/remcohaszing/codemirror-languageservice/issues/new).\n\nOn top of that, see my general\n[contributing guidelines](https://github.com/remcohaszing/.github/blob/main/CONTRIBUTING.md).\n\n## Related projects\n\n- [CodeMirror][] — CodeMirror is a code editor component for the web.\n- [Language Server Protocol][LSP] — The Language Server Protocol (LSP) defines the protocol used\n  between an editor or IDE and a language server that provides language features like auto complete,\n  go to definition, find all references etc.\n- [Transloadit](https://transloadit.com) — A simple API to handle any file in your app.\n  `codemirror-languageservice` was developed as part of the Transloadit JSON editor.\n\nKnown language services that you could use this for:\n\n- [`vscode-css-languageservice`](https://github.com/microsoft/vscode-css-languageservice) — CSS,\n  LESS & SCSS language service extracted from VSCode to be reused.\n- [`vscode-html-languageservice`](https://github.com/microsoft/vscode-html-languageservice) —\n  Language services for HTML.\n- [`vscode-json-languageservice`](https://github.com/microsoft/vscode-json-languageservice) — JSON\n  language service extracted from VSCode to be reused.\n- [`vscode-markdown-languageservice`](https://github.com/microsoft/vscode-markdown-languageservice)\n  — The language service that powers VS Code’s Markdown support.\n- [`yaml-language-server`](https://github.com/redhat-developer/yaml-language-server) — Language\n  Server for YAML Files.\n- [`@tailwindcss/language-service`](https://github.com/tailwindlabs/tailwindcss-intellisense) —\n  About Intelligent Tailwind CSS tooling.\n- [`@volar/language-service`](https://volarjs.dev) — The Embedded Language Tooling Framework.\n\n## License\n\n[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)\n\n[codemirror]: https://codemirror.net\n[lsp]: https://microsoft.github.io/language-server-protocol\n","readmeFilename":"README.md"}