coherent-language-support 1.0.0

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.
Files changed (55) hide show
  1. package/.vscodeignore +8 -0
  2. package/CHANGELOG.md +14 -0
  3. package/LICENSE +21 -0
  4. package/README.md +108 -0
  5. package/coherent-language-support-1.0.0.vsix +0 -0
  6. package/dist/extension.js +18075 -0
  7. package/dist/extension.js.map +7 -0
  8. package/esbuild.config.mjs +24 -0
  9. package/icon.png +0 -0
  10. package/icon.svg +10 -0
  11. package/package.json +78 -0
  12. package/server/analysis/coherent-analyzer.d.ts +93 -0
  13. package/server/analysis/coherent-analyzer.d.ts.map +1 -0
  14. package/server/analysis/coherent-analyzer.js +288 -0
  15. package/server/analysis/coherent-analyzer.js.map +1 -0
  16. package/server/analysis/element-validator.d.ts +45 -0
  17. package/server/analysis/element-validator.d.ts.map +1 -0
  18. package/server/analysis/element-validator.js +84 -0
  19. package/server/analysis/element-validator.js.map +1 -0
  20. package/server/analysis/nesting-validator.d.ts +49 -0
  21. package/server/analysis/nesting-validator.d.ts.map +1 -0
  22. package/server/analysis/nesting-validator.js +68 -0
  23. package/server/analysis/nesting-validator.js.map +1 -0
  24. package/server/data/element-attributes.d.ts +92 -0
  25. package/server/data/element-attributes.d.ts.map +1 -0
  26. package/server/data/element-attributes.generated.json +7085 -0
  27. package/server/data/element-attributes.js +282 -0
  28. package/server/data/element-attributes.js.map +1 -0
  29. package/server/data/nesting-rules.d.ts +67 -0
  30. package/server/data/nesting-rules.d.ts.map +1 -0
  31. package/server/data/nesting-rules.js +240 -0
  32. package/server/data/nesting-rules.js.map +1 -0
  33. package/server/providers/code-actions.d.ts +15 -0
  34. package/server/providers/code-actions.d.ts.map +1 -0
  35. package/server/providers/code-actions.js +191 -0
  36. package/server/providers/code-actions.js.map +1 -0
  37. package/server/providers/completion.d.ts +15 -0
  38. package/server/providers/completion.d.ts.map +1 -0
  39. package/server/providers/completion.js +247 -0
  40. package/server/providers/completion.js.map +1 -0
  41. package/server/providers/diagnostics.d.ts +26 -0
  42. package/server/providers/diagnostics.d.ts.map +1 -0
  43. package/server/providers/diagnostics.js +143 -0
  44. package/server/providers/diagnostics.js.map +1 -0
  45. package/server/providers/hover.d.ts +15 -0
  46. package/server/providers/hover.d.ts.map +1 -0
  47. package/server/providers/hover.js +215 -0
  48. package/server/providers/hover.js.map +1 -0
  49. package/server/server.d.ts +17 -0
  50. package/server/server.d.ts.map +1 -0
  51. package/server/server.js +82 -0
  52. package/server/server.js.map +1 -0
  53. package/snippets/coherent.json +226 -0
  54. package/src/extension.ts +75 -0
  55. package/tsconfig.json +18 -0
package/.vscodeignore ADDED
@@ -0,0 +1,8 @@
1
+ .vscode/**
2
+ src/**
3
+ node_modules/**
4
+ *.ts
5
+ tsconfig.json
6
+ esbuild.config.mjs
7
+ .gitignore
8
+ **/*.map
package/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # Change Log
2
+
3
+ All notable changes to the "Coherent.js Language Support" extension.
4
+
5
+ ## [1.0.0] - 2026-01-22
6
+
7
+ ### Added
8
+ - Autocomplete for HTML elements and attributes
9
+ - Element-specific attribute validation
10
+ - HTML nesting validation
11
+ - Hover information with type details
12
+ - Code snippets for common Coherent.js patterns
13
+ - Quick fixes for validation errors
14
+ - Go-to-definition for Coherent.js imports (via TypeScript types)
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Thomas Drouvin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # Coherent.js Language Support
2
+
3
+ IntelliSense, validation, and snippets for [Coherent.js](https://github.com/Tomdrouv1/coherent.js) - a high-performance server-side rendering framework built on pure JavaScript objects.
4
+
5
+ ## Features
6
+
7
+ ### IntelliSense & Autocomplete
8
+
9
+ - **Attribute completion** - Get suggestions for valid HTML attributes when typing in Coherent.js objects
10
+ - **Event handler completion** - Autocomplete for onClick, onChange, onSubmit, and other event handlers
11
+ - **Context-aware suggestions** - Suggestions based on the element type (div, input, form, etc.)
12
+
13
+ ### Validation & Diagnostics
14
+
15
+ - **Invalid attribute warnings** - Highlights attributes that are not valid for the element type
16
+ - **Nesting validation** - Warns about invalid HTML nesting (e.g., `<p>` inside `<p>`)
17
+ - **Typo detection** - Suggests fixes for common typos like `classname` instead of `className`
18
+
19
+ ### Code Snippets
20
+
21
+ Quick snippets for common Coherent.js patterns:
22
+
23
+ | Prefix | Description |
24
+ |--------|-------------|
25
+ | `cel` | Create a Coherent.js element |
26
+ | `ccomp` | Create a functional component |
27
+ | `ctext` | Text element with `text` property |
28
+ | `clink` | Anchor element |
29
+ | `cimg` | Image element |
30
+ | `cinput` | Input element with type choices |
31
+ | `cbtn` | Button element |
32
+ | `cform` | Form element |
33
+ | `clist` | List with mapped items |
34
+ | `cif` | Conditional rendering |
35
+ | `cevent` | Event handler property |
36
+ | `cdata` | Data attribute |
37
+ | `cpage` | Full page layout |
38
+ | `ccard` | Card component structure |
39
+ | `ctable` | Table with header and body |
40
+ | `cimport` | Import Coherent.js functions |
41
+ | `cserver` | Basic server setup |
42
+
43
+ ### Hover Information
44
+
45
+ Hover over attributes to see their type information and valid values.
46
+
47
+ ## Installation
48
+
49
+ ### From VS Code Marketplace
50
+
51
+ 1. Open VS Code
52
+ 2. Go to Extensions (Ctrl+Shift+X)
53
+ 3. Search for "Coherent.js Language Support"
54
+ 4. Click Install
55
+
56
+ ### From VSIX
57
+
58
+ 1. Download the `.vsix` file from [releases](https://github.com/Tomdrouv1/coherent.js/releases)
59
+ 2. Run: `code --install-extension coherent-language-support-1.0.0.vsix`
60
+
61
+ ## Usage
62
+
63
+ The extension activates automatically for JavaScript and TypeScript files. Simply start writing Coherent.js components:
64
+
65
+ ```javascript
66
+ // Type 'cel' and press Tab for a quick element
67
+ { div: {
68
+ className: 'container',
69
+ children: [
70
+ // Type 'ctext' for text elements
71
+ { p: { text: 'Hello, Coherent.js!' } }
72
+ ]
73
+ }}
74
+ ```
75
+
76
+ ### Configuration
77
+
78
+ Configure the extension in VS Code settings:
79
+
80
+ ```json
81
+ {
82
+ "coherent.trace.server": "off" // "off" | "messages" | "verbose"
83
+ }
84
+ ```
85
+
86
+ ## Requirements
87
+
88
+ - VS Code 1.85.0 or higher
89
+ - Working with JavaScript or TypeScript files
90
+
91
+ ## Extension Settings
92
+
93
+ | Setting | Default | Description |
94
+ |---------|---------|-------------|
95
+ | `coherent.trace.server` | `off` | Traces communication between VS Code and the language server |
96
+
97
+ ## Known Issues
98
+
99
+ - Language server features require the file to be saved at least once
100
+ - Very large files (>10,000 lines) may experience slower validation
101
+
102
+ ## Contributing
103
+
104
+ This extension is part of the [Coherent.js](https://github.com/Tomdrouv1/coherent.js) project. Contributions are welcome!
105
+
106
+ ## License
107
+
108
+ MIT