Skip to content

Commit

Permalink
feat(web): Add angle brackets to tidal language autoclose (#302)
Browse files Browse the repository at this point in the history
This comes with the downside of creating a closing bracket when typing
'|<', but allows for automatic wrapping of selections, which I think
occurs much more commonly.
  • Loading branch information
munshkr authored Dec 24, 2024
2 parents 26bd408 + 6449b2b commit 9630cae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lang-tidal/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StreamLanguage } from "@codemirror/language";
import { haskell } from "@codemirror/legacy-modes/mode/haskell";
import { tidalLanguage } from "./tidal";
import { indentation } from "./indentation";

export function tidal() {
return [indentation(), StreamLanguage.define(haskell)];
return [indentation(), StreamLanguage.define(tidalLanguage)];
}
10 changes: 10 additions & 0 deletions packages/lang-tidal/src/tidal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { haskell } from "@codemirror/legacy-modes/mode/haskell";

export const tidalLanguage = {
...haskell,
name: "tidal",
languageData: {
...haskell.languageData,
closeBrackets: {brackets: ["(", "[", "{", "<", '"'], before: ')]}>"'}
}
}

0 comments on commit 9630cae

Please sign in to comment.