-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design documentation for CodeEditor linting #2752
Design documentation for CodeEditor linting #2752
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two bits of feedback, one non-blocking and not really necessary, while the other I think could benefit consumers (specifically designers) with how linting looks like.
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments, but looking good!
@@ -104,3 +105,6 @@ In **Figma** we provide a handful of example languages intended as visual exampl | |||
|
|||
If you wish to create custom examples using the Code Editor, we publish all of the relevant syntax highlighting variables in the [HDS Components v2.0](https://www.figma.com/design/iweq3r2Pi8xiJfD9e6lOhF/HDS-Components-v2.0?node-id=67166-37020&t=gWdKy44MzTP4cTRo-1) library. However, due to the number of languages supported by the component, the color variables use a generic naming schema (e.g., cyan, red, purple) to remain as agnostic as possible when being applied to different languages. | |||
For more details around syntax, visit the [specifications](/components/code-editor?tab=specifications). | |||
|
|||
## Linting (JSON language only) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Linting (JSON language only) | |
### Linting (JSON language only) |
I think it makes sense to have the content in this section. Maybe bump it down to an h3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should live under Language, it's its own feature like line-highlight and it happens to only be applicable to JSON. Open to moving it around if everyone disagrees with me though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This follows the setup in the showcase. It is it's own feature, but it technically won't work without language
. I'm indifferent I think.
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of comments around the structure here, but I do think that an image would go a long way for this feature. I also might suggest including something about this not being supported in Figma.
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I left a couple of minor suggestions.
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
The Code Editor supports "linting" (currently only of JSON code) a user's code. This feature will highlight an error with an underline and display an icon next to the line number, each of which will show a tooltip on hover. To view all alerts in the editor, users can open a dialog using Ctrl-Shift-m (Cmd-Shift-m on macOS). | ||
|
||
!!! Info | ||
Linting within the Code Editor is only supported for JSON. If you require linting for addition languages [contact](/about/support) the HDS team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong feelings about this, but I don't feel like these details need to go in the info banner. The first sentence is also above; the second could live as a standalone below the previous paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the notes! I updated all the suggestions and for this info banner I kept the callout that this is not supported in Figma (which we have in info banners on other components) to make it clear at a glance that this is in code only. I moved the contact support info to the end of the section as well. Let me know what you think!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like maybe something got reverted because I still see the first two sentences.
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is a little jarring in the flow of the content because the main element is on the right, while in the others, it's on the left. The left is most common in our documentation and is preferred. Could you orient this so the code editor itself is on the left?
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-editor/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, once the spelling error in the target branch gets fixed you can just re-run the failing test and it should be good to go.
c1811e4
to
0f49b5b
Compare
Co-authored-by: Heather Larsen <[email protected]>
…ines.md Co-authored-by: Lee White <[email protected]>
…ines.md Co-authored-by: Lee White <[email protected]>
…ines.md Co-authored-by: Lee White <[email protected]>
…ines.md Co-authored-by: Lee White <[email protected]>
…ines.md Co-authored-by: Lee White <[email protected]>
…ines.md Co-authored-by: Lee White <[email protected]>
e8c2b5c
to
6aa5247
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor updates, then I think this is good to go.
The Code Editor supports "linting" (currently only of JSON code) a user's code. This feature will highlight an error with an underline and display an icon next to the line number, each of which will show a tooltip on hover. To view all alerts in the editor, users can open a dialog using Ctrl-Shift-m (Cmd-Shift-m on macOS). | ||
|
||
!!! Info | ||
Linting within the Code Editor is only supported for JSON. If you require linting for addition languages [contact](/about/support) the HDS team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like maybe something got reverted because I still see the first two sentences.
@@ -104,3 +104,24 @@ In **Figma** we provide a handful of example languages intended as visual exampl | |||
|
|||
If you wish to create custom examples using the Code Editor, we publish all of the relevant syntax highlighting variables in the [HDS Components v2.0](https://www.figma.com/design/iweq3r2Pi8xiJfD9e6lOhF/HDS-Components-v2.0?node-id=67166-37020&t=gWdKy44MzTP4cTRo-1) library. However, due to the number of languages supported by the component, the color variables use a generic naming schema (e.g., cyan, red, purple) to remain as agnostic as possible when being applied to different languages. | |||
For more details around syntax, visit the [specifications](/components/code-editor?tab=specifications). | |||
|
|||
## Linting | |||
The Code Editor supports linting for JSON using [CodeMirror6](https://codemirror.net/examples/lint/). This feature highlights all errors with an underline and an icon next to the line number. Each icon has a tooltip explaining the error on the associated line. To view all alerts in the editor, users can open a dialog using Ctrl-Shift-m (Cmd-Shift-m on macOS). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the duplicative sentence.
The Code Editor supports linting for JSON using [CodeMirror6](https://codemirror.net/examples/lint/). This feature highlights all errors with an underline and an icon next to the line number. Each icon has a tooltip explaining the error on the associated line. To view all alerts in the editor, users can open a dialog using Ctrl-Shift-m (Cmd-Shift-m on macOS). | |
The Code Editor supports linting for JSON using [CodeMirror6](https://codemirror.net/examples/lint/). This feature highlights all errors with an underline and an icon next to the line number. Each icon has a tooltip explaining the error on the associated line. |
6aa5247
into
zamoore/HDS-4361/CodeEditor-linting-website
📌 Summary
If merged, this PR will add a section at the end of the Guidelines page for CodeEditor that describes the linting feature available to users only in the JSON language variant of the CodeEditor.
🛠️ Detailed description
Brief description added. Questions for the team:
🔗 External links
Jira ticket: HDS4629
Figma file: Preview of linting