]> code.delx.au - dotemacs/commitdiff
Switched from tern to tide/tsserver
authorJames Bunton <jbunton@atlassian.com>
Tue, 5 Jun 2018 13:28:31 +0000 (23:28 +1000)
committerJames Bunton <jbunton@atlassian.com>
Tue, 5 Jun 2018 13:28:31 +0000 (23:28 +1000)
.gitmodules
lisp/my-file-modes.el
lisp/my-minor-modes.el
packages/tern [deleted symlink]
packages/tide [new submodule]
packages/typescript-mode [new submodule]

index 7a79de810e3254b8785b12b29fe882432a86bac0..49eca881588693c2bac27274b72518c5a832e847 100644 (file)
 [submodule "ghub"]
        path = packages/ghub
        url = https://github.com/magit/ghub.git
+[submodule "typescript-mode"]
+       path = packages/typescript-mode
+       url = https://github.com/ananthakumaran/typescript.el.git
+[submodule "tide"]
+       path = packages/tide
+       url = https://github.com/ananthakumaran/tide.git
index 3253dc7079796e44d48378ed9aadd184d174fdf7..6387c360d2f61527b64b63032ed4d6b3e4a14f02 100644 (file)
@@ -27,6 +27,8 @@
 (require 'json-mode)
 (require 'js)
 (require 'js2-mode)
+(require 'typescript-mode)
+(require 'tide)
 (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
 (add-to-list 'interpreter-mode-alist '("node" . js2-mode))
 (setq js2-concat-multiline-strings 'eol)
 (setq js2-mode-show-parse-errors nil)
 (setq js2-mode-show-strict-warnings nil)
 (setq js--declaration-keyword-re "x^") ; declarations should have normal indentation
-(require 'js2-refactor)
+
+(add-hook 'js2-mode-hook #'tide-setup)
 (add-hook 'js2-mode-hook #'js2-refactor-mode)
+(add-hook 'typescript-mode-hook #'tide-setup)
+(add-hook 'typescript-mode-hook #'js2-refactor-mode)
+
+(require 'js2-refactor)
 (js2r-add-keybindings-with-prefix "C-c C-m")
 (setq js2r-always-insert-parens-around-arrow-function-params t)
 (setq js2r-prefered-quote-type 2)
-(when (require 'tern nil 'noerror)
-  (add-hook 'js2-mode-hook (lambda () (tern-mode t))))
-(defun tern-project-dir ()
-  (or (and (equal tern-last-file-name (buffer-file-name)) tern-project-dir)
-      (and (not (buffer-file-name)) (setf tern-project-dir ""))
-      (setf tern-project-dir (expand-file-name (locate-dominating-file default-directory ".git"))))
-  ;; Track the file name to detect if it changed, which means the project
-  ;; directory needs to be found again.
-  (setf tern-last-file-name (buffer-file-name))
-  tern-project-dir)
 
 
 (require 'ledger-mode nil 'noerror)
index ac4ffec4fc94cd677ac194b573331e86182effdf..40de35d1086ee1a847a50a9d2ae1d82514a884c3 100644 (file)
 (add-hook 'after-init-hook
           (lambda ()
             (diminish 'editorconfig-mode)
-            (diminish 'elisp-slime-nav-mode)
             (diminish 'git-gutter-mode)
             (diminish 'highlight-symbol-mode)
             (diminish 'indent-guide-mode)
             (diminish 'ivy-mode)
-            (diminish 'js2-refactor-mode)
-            (diminish 'tern-mode)
             (diminish 'yas-minor-mode)))
diff --git a/packages/tern b/packages/tern
deleted file mode 120000 (symlink)
index 870434d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/home/jbunton/.node/lib/node_modules/tern/emacs
\ No newline at end of file
diff --git a/packages/tide b/packages/tide
new file mode 160000 (submodule)
index 0000000..4877de4
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 4877de4287a077e3ea7266272ff8fc19a0d14e97
diff --git a/packages/typescript-mode b/packages/typescript-mode
new file mode 160000 (submodule)
index 0000000..7a5c74d
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 7a5c74d88e3c5513cc4431a837003736f905a75e