Skip to content

Commit

Permalink
emacs: Use biome to support JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
tlater-famedly committed Mar 4, 2024
1 parent f8d7070 commit e57a869
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions home-config/config/applications/tty/emacs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ in {
# different markdown implementation at some point)
pandoc

# Technically only for web dev, but it does lsp stuff for JSON,
# so...
biome

sqlite.dev
];

Expand Down
12 changes: 6 additions & 6 deletions home-config/dotfiles/emacs.d/config/programming-languages.el
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@

(use-package eglot
:commands (eglot eglot-format eglot-managed-p eglot--major-mode eglot-alternatives)
:hook (((kotlin-mode web-mode rust-mode python-mode sh-mode c-mode c++-mode nix-mode) .
:hook (((kotlin-mode web-mode rust-mode python-mode sh-mode c-mode c++-mode nix-mode json-mode) .
eglot-ensure)
(eglot-managed-mode . set-eldoc-compose))
:bind
Expand Down Expand Up @@ -354,6 +354,8 @@
`(web-mode . ,(eglot-alternatives
'(("biome" "lsp-proxy")
("typescript-language-server" "--stdio")))))
(add-to-list 'eglot-server-programs
'(json-mode . ("biome" "lsp-proxy")))
(add-to-list 'eglot-server-programs
'(nix-mode . ("nil"))))

Expand Down Expand Up @@ -389,11 +391,9 @@
:program "alejandra"
:group 'nix-mode
:lighter " AL")
(reformatter-define biome-typescript-format
(reformatter-define biome-format
:program "biome"
:args '("format" "--stdin-file-path=test.ts")
:group 'web-mode
:lighter " BT")
:args (list "format" (concat "--stdin-file-path=" buffer-file-name)))
(reformatter-define clang-format
:program "clang-format"
:group 'glsl-mode
Expand All @@ -420,7 +420,7 @@
(clang-format-buffer))
('latex-mode
(latexindent-buffer))
((or 'mhtml-mode 'web-mode 'scss-mode)
((or 'mhtml-mode 'web-mode 'scss-mode 'json-mode)
(biome-format-buffer))
('haskell-mode (haskell-mode-stylish-buffer))
((or 'bazel-mode
Expand Down

0 comments on commit e57a869

Please sign in to comment.