Skip to content

Commit

Permalink
Setup GDScript highlighting (exercism#6868)
Browse files Browse the repository at this point in the history
* Setup GDScript highlighting

* Use our forked package, add langfn TS declarations

* Add TS declaration for highlightjs-chapel
  • Loading branch information
dem4ron authored Apr 9, 2024
1 parent 88523ce commit 8079cff
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/javascript/declarations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,24 @@ declare module '@ballerina/highlightjs-ballerina' {

export default setup
}

declare module 'highlightjs-redbol' {
import { LanguageFn } from 'highlight.js'
const setup: LanguageFn

export default setup
}

declare module 'highlightjs-chapel' {
import { LanguageFn } from 'highlight.js'
const setup: LanguageFn

export default setup
}

declare module '@exercism/highlightjs-gdscript' {
import { LanguageFn } from 'highlight.js'
const setup: LanguageFn

export default setup
}
2 changes: 2 additions & 0 deletions app/javascript/utils/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import setupGleam from '@gleam-lang/highlight.js-gleam'
import setupBallerina from '@ballerina/highlightjs-ballerina'
import setupRed from 'highlightjs-redbol'
import setupChapel from 'highlightjs-chapel'
import setupGDScript from '@exercism/highlightjs-gdscript'

if (areAllRegExpFeaturesSupported()) {
highlighter.default.registerLanguage('abap', setupABAP)
Expand All @@ -19,6 +20,7 @@ if (areAllRegExpFeaturesSupported()) {
highlighter.default.registerLanguage('ballerina', setupBallerina)
highlighter.default.registerLanguage('red', setupRed)
highlighter.default.registerLanguage('chapel', setupChapel)
highlighter.default.registerLanguage('gdscript', setupGDScript)
}

highlighter.default.configure({
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@exercism/active-background": "^0.6.2",
"@exercism/codemirror-lang-gleam": "^1.0.1",
"@exercism/codemirror-lang-wren": "https://github.com/exercism/codemirror-lang-wren",
"@exercism/highlightjs-gdscript": "^0.0.1",
"@exercism/twine2-story-format": "https://github.com/exercism/twine2-story-format.git",
"@gleam-lang/highlight.js-gleam": "^1.0.0",
"@hotwired/turbo-rails": "^7.3.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,11 @@
"@codemirror/highlight" "^0.19.6"
"@codemirror/language" "^0.19.3"

"@exercism/highlightjs-gdscript@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@exercism/highlightjs-gdscript/-/highlightjs-gdscript-0.0.1.tgz#1b10f0b394d406f6f9309ad66eec801ee399e671"
integrity sha512-LiCFDhXCr3iIEGESHEsSCpCI7qNa2suHcrBWeOYSEtEwCXc+IQpEh5i4K8qPcOMJB9ckVOgLgbSNML8TyvPCVg==

"@exercism/twine2-story-format@https://github.com/exercism/twine2-story-format.git":
version "1.0.0"
resolved "https://github.com/exercism/twine2-story-format.git#94ac1ce6a2560f06db4172dd28707b98220b4fb9"
Expand Down

0 comments on commit 8079cff

Please sign in to comment.