Skip to content

Commit

Permalink
More logical split of concerns into files. Initial work on #1, might
Browse files Browse the repository at this point in the history
be removed if I don't  get it working.
  • Loading branch information
themkat committed May 22, 2022
1 parent 42836df commit a7c8a3c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
7 changes: 1 addition & 6 deletions lsp-m68k.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

;; Package-Requires: ((emacs "25.1") (lsp-mode "8.0.0") (tree-sitter "0.12.0"))


;; TODO: maybe separate the different concerns from this file into their own files?

Expand All @@ -8,11 +8,6 @@

(require 'lsp-mode)

;; TODO: should we make a separate mode for it? or something else? m68k-mode?
(define-derived-mode m68k-mode
asm-mode "m68k-mode"
"Mode for programming Motorola 68k processors with automatic lsp activation")

(add-to-list 'm68k-mode-hook #'lsp)
(add-to-list 'lsp-language-id-configuration '(m68k-mode . "m68k"))

Expand Down
31 changes: 31 additions & 0 deletions m68k-mode.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

;; Package-Requires: ((emacs "25.1") (lsp-mode "8.0.0") (tree-sitter "0.12.0"))

(define-derived-mode m68k-mode
asm-mode "m68k-mode"
"Mode for programming Motorola 68k processors with automatic lsp activation")


;; tree sitter for better syntax highlight
;; requires https://github.com/grahambates/tree-sitter-m68k
;; TODO: setup method for tree-sitter-m68k?
;; TODO: any way we can make this optional if grammar not installed?
(add-to-list 'tree-sitter-major-mode-language-alist '(m68k-mode . m68k))

(defcustom m68k-tree-sitter-enabled nil
"Turns on tree-sitter mode for better syntax highlighting. Requires you to set up tree-sitter-m68k and tree-sitter mode.")

;; TODO: other utilities?

(defun m68k-setup-tree-sitter ()
(when m68k-tree-sitter-enabled
(require 'tree-sitter)
(tree-sitter-hl-mode 1)))

(add-to-list 'm68k-mode-hook #'m68k-setup-tree-sitter)


(require 'lsp-m68k)
;;(require 'dap-m68k)

(provide 'm68k-mode)

0 comments on commit a7c8a3c

Please sign in to comment.