Skip to content
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

feat: new syntax highlighter #211

Merged
merged 19 commits into from
Dec 24, 2024
Merged

feat: new syntax highlighter #211

merged 19 commits into from
Dec 24, 2024

Conversation

Jurredr
Copy link
Contributor

@Jurredr Jurredr commented Dec 20, 2024

Problem

The current syntax highlighter lacks proper tokenization control, thus leading to unattractive syntax highlighting.

Solution

Swap out prism.js by highlight.js. The library shiki.js has also been considered, but has not been used given its strictly asynchronous nature.

Old

Screenshot 2024-12-20 at 18 09 11

New

Screenshot 2024-12-20 at 18 09 11

Important note

A proper color mapping still needs to be added, possibly a dynamic one consuming variables from VSCode.

Tests

  • I have tested this change on VSCode
  • I have tested this change on JetBrains

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Jurredr Jurredr added new feature New feature or request improvement Improvement of an existing feature labels Dec 20, 2024
@Jurredr Jurredr self-assigned this Dec 20, 2024
@Jurredr Jurredr requested a review from a team as a code owner December 20, 2024 17:10
@Jurredr Jurredr changed the title feat: new syntax higlighter feat: new syntax highlighter Dec 20, 2024
@dogusata
Copy link
Collaborator

2 more important things:

  • Please triple check if the reference tracker highlights are still working as expected (which are already part of the e2e tests, however checking manually would also be beneficial here)
  • Please update the third party licenses file, since this is an open source library, it has to have those information on the root. Remove prismjs and add highlightjs (and any additional third part library you put to make highlightjs work as expected)

package.json Outdated Show resolved Hide resolved
src/helper/merge-html-plugin.ts Outdated Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
src/styles/components/syntax/_syntax-theme.scss Outdated Show resolved Hide resolved
dogusata
dogusata previously approved these changes Dec 24, 2024
Copy link
Collaborator

@dogusata dogusata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added just a small nit related with the 3rd party clone usage and comments. Please remove the comments in your next pr, if we're not using it directly from node_modules for some reason, the code should follow our guidelines not anyone elses.

src/helper/merge-html-plugin.ts Outdated Show resolved Hide resolved
@Jurredr Jurredr merged commit 89d888c into main Dec 24, 2024
2 checks passed
@Jurredr Jurredr deleted the jurredr/new-syntax-highlighter branch December 24, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement of an existing feature new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants