@coherent.js/language-server 1.0.0-beta.1 → 1.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @coherent.js/language-server
|
|
2
|
+
|
|
3
|
+
Language Server Protocol (LSP) implementation for Coherent.js, providing autocomplete, validation, hover documentation, and quick-fix code actions for IDE integration.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Autocomplete** for HTML tag names and element-specific attributes in Coherent.js object syntax
|
|
8
|
+
- **Hover documentation** with element descriptions, attribute types, and usage examples
|
|
9
|
+
- **Diagnostics** for invalid attributes and HTML nesting rule violations
|
|
10
|
+
- **Code actions** with quick fixes for common validation errors
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @coherent.js/language-server
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Start the server with stdio transport:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx coherent-language-server --stdio
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The server handles JavaScript, TypeScript, JSX, and TSX files. It communicates using the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).
|
|
27
|
+
|
|
28
|
+
## VS Code
|
|
29
|
+
|
|
30
|
+
For VS Code, use the `coherent-language-support` extension in `packages/vscode-extension/`, which bundles this server automatically.
|
|
31
|
+
|
|
32
|
+
## Building
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pnpm build # extract attributes + compile TypeScript
|
|
36
|
+
pnpm start # run the server
|
|
37
|
+
pnpm dev # watch mode
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Architecture
|
|
41
|
+
|
|
42
|
+
- `src/server.ts` -- LSP connection and capability registration
|
|
43
|
+
- `src/providers/` -- completion, hover, diagnostics, and code-action handlers
|
|
44
|
+
- `src/analysis/` -- Coherent.js AST analyzer, attribute validator, nesting validator
|
|
45
|
+
- `src/data/` -- HTML element/attribute database and nesting rules
|
|
46
|
+
|
|
47
|
+
## Requirements
|
|
48
|
+
|
|
49
|
+
- Node.js >= 20.0.0
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coherent.js/language-server",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.7",
|
|
4
4
|
"description": "Language Server Protocol (LSP) server for Coherent.js providing autocomplete, validation, and hover information",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/server.js",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"url": "git+https://github.com/Tomdrouv1/coherent.js.git",
|
|
19
19
|
"directory": "packages/language-server"
|
|
20
20
|
},
|
|
21
|
+
"homepage": "https://github.com/Tomdrouv1/coherent.js",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/Tomdrouv1/coherent.js/issues"
|
|
24
|
+
},
|
|
21
25
|
"publishConfig": {
|
|
22
26
|
"access": "public",
|
|
23
27
|
"registry": "https://registry.npmjs.org/"
|