You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
introduce attribute and nesting validation + lsp features
This commit introduces an entirely new system that validates attributes
and element nesting, alongside all the major features expected by a
language server.
Note that all new validation is not compatible with templating languages,
support for that will be explored in the near future, but for now this is
strictly for vanilla html (validation is disabled entirely for SuperHTML
templates at the moment as well).
All of this code is considered experimental so if you build superhtml
from this commit, be warned that you will probably encounter bugs, but
beta testing is appreciated at this stage.
If you want to report a bug, please take a good read at the Issue
templates, as I'm asking submitters to provide a reference to the HTML
spec section that the bug pertains to, in order to minimize the amount
of bad issues that complain about correct -- but maybe lesser known
-- errors.
On the front of the language server, we now provide:
- diagnostics for all kinds of errors
- autocomplete for element names, attribute names, and attribute values
- symbol rename on element names to change both tags at once
- linked edits to achieve the same as above (when supported by the
editor, see #74)
- duplicate class name warnings
- find all references for class names
- descriptions for all elements, attributes and attribute values of
enumerated attributes (i.e. attributes whose values are options in a
list).
The autoformatter uses now a new formatting layout where the first
attribute is kept on the same line as the element name.
Additionally, the autoformatter now uses tabs for indentation and spaces
for alignment. This is also experimental and might be reverted in the
future.
about: "If you are reporting a problem relative to HTML diagnostics you will need to provide a referece to the WHATWG Living HTML specification that points out the discrepancy".
description: Report an error with how SuperHTML validates HTML.
3
+
labels: ["diagnostic"]
4
+
body:
5
+
- type: input
6
+
id: version
7
+
attributes:
8
+
label: SuperHTML Version
9
+
description: "The output of `superhtml version` (or the VSCode extension version)"
10
+
placeholder: "v0.5.3-dev.59+0336596"
11
+
validations:
12
+
required: true
13
+
- type: markdown
14
+
id: repro
15
+
attributes:
16
+
label: Steps to Reproduce and Observed Behavior
17
+
description: What exactly can someone else do, in order to observe the problem that you observed? Include error messages, if any.
18
+
validations:
19
+
required: true
20
+
- type: markdown
21
+
id: expected
22
+
attributes:
23
+
label: Expected Output according to the HTML spec
24
+
description: "NOTE: failing to provide a quote from the WHATWG HTML living specification that shows the discrepancy might cause your issue to be closed without any explanation."
0 commit comments