-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
;; Author: Yutaka Matsubara ([email protected]) | ||
;; Homepage: https://github.com/mopemope/meghanada-emacs | ||
;; Keywords: languages java | ||
;; Package-Version: 1.1.2 | ||
;; Package-Version: 1.2.0 | ||
;; Package-Requires: ((emacs "24.3") (yasnippet "0.6.1") (company "0.9.0") (flycheck "0.23")) | ||
|
||
;; This program is free software; you can redistribute it and/or modify | ||
|
@@ -48,7 +48,7 @@ | |
;; Const | ||
;; | ||
|
||
(defconst meghanada-version "1.1.2") | ||
(defconst meghanada-version "1.2.0") | ||
(defconst meghanada-setup-version "0.0.2") | ||
(defconst meghanada--eot "\n;;EOT\n") | ||
(defconst meghanada--junit-buf-name "*meghanada-junit*") | ||
|
@@ -244,7 +244,7 @@ Example. (setq meghanada-jvm-option \"-Dhttp.proxyHost=test.proxy.com -Dhttp.pro | |
:type 'string) | ||
|
||
(defcustom meghanada-full-text-search-enable nil | ||
"If true, enable full text search and meghanada-search-everywhere." | ||
"If true, Enable full text search and meghanada-search-everywhere." | ||
:group 'meghanada | ||
:type 'boolean) | ||
|
||
|
@@ -254,20 +254,33 @@ Example. (setq meghanada-jvm-option \"-Dhttp.proxyHost=test.proxy.com -Dhttp.pro | |
:type 'string) | ||
|
||
(defcustom meghanada-class-completion-matcher "prefix" | ||
"Select class completion matcher. You can choose from prefix, contains, fuzzy, came-case. default is prefix." | ||
"Select class completion matcher. You can choose from prefix, contains, fuzzy, came-case. default is prefix." | ||
:group 'meghanada | ||
:type 'string) | ||
|
||
(defcustom meghanada-mode-after-test-hook '() | ||
"Hook that is called after a JUnit test execution is done." | ||
:group 'meghanada) | ||
|
||
(defcustom meghanada-telemetry-enable nil | ||
"If true, Enables telemetry and allows you to collect and submit performance data." | ||
:group 'meghanada | ||
:type 'boolean) | ||
|
||
;; | ||
;; utility | ||
;; | ||
|
||
(defun meghanada--what-line () | ||
"TODO: FIX DOC ." | ||
(format-mode-line "%l")) | ||
"Return the current buffer line number and narrowed line number of point." | ||
(let ((start (point-min)) | ||
(n (line-number-at-pos))) | ||
(if (= start 1) | ||
n | ||
(save-excursion | ||
(save-restriction | ||
(widen) | ||
(+ n (line-number-at-pos start) -1) n))))) | ||
|
||
(defun meghanada--real-current-column () | ||
"like `current-column', but skip invisible characters in pretty-symbol-mode." | ||
|
@@ -517,6 +530,8 @@ function." | |
(push (format "-Dmeghanada.class.completion.matcher=%s" meghanada-class-completion-matcher) options)) | ||
(when meghanada-jvm-option | ||
(push meghanada-jvm-option options)) | ||
(when meghanada-telemetry-enable | ||
(push "-Dmeghanada.telemetry.enable=true" options)) | ||
(push "-Djava.net.preferIPv4Stack=true" options) | ||
(mapconcat 'identity options " "))) | ||
|
||
|
@@ -1059,21 +1074,21 @@ e.g. java.lang.annotation)." | |
(defun meghanada-add-import-async (imp callback buf) | ||
"TODO: FIX DOC IMP CALLBACK BUF." | ||
(if (and meghanada--client-process (process-live-p meghanada--client-process)) | ||
(meghanada--send-request "ai" (list callback buf) (buffer-file-name) imp) | ||
(meghanada--send-request "ai" (list callback buf) (format "\"%s\"" (buffer-file-name)) imp) | ||
(message "client connection not established"))) | ||
|
||
(defun meghanada-import-all-async (callback buf optimize) | ||
"TODO: FIX DOC CALLBACK BUF OPTIMIZE." | ||
(if (and meghanada--client-process (process-live-p meghanada--client-process)) | ||
(meghanada--send-request "ia" (list callback buf optimize) (buffer-file-name)) | ||
(meghanada--send-request "ia" (list callback buf optimize) (format "\"%s\"" (buffer-file-name))) | ||
(message "client connection not established"))) | ||
|
||
(defun meghanada-import-at-point-async (callback buf optimize) | ||
"TODO: FIX DOC CALLBACK BUF OPTIMIZE." | ||
(if (and meghanada--client-process (process-live-p meghanada--client-process)) | ||
(meghanada--send-request "ip" | ||
(list callback buf optimize) | ||
(buffer-file-name) | ||
(format "\"%s\"" (buffer-file-name)) | ||
(meghanada--what-line) | ||
(meghanada--what-column) | ||
(format "\"%s\"" (meghanada--what-symbol))) | ||
|
@@ -1085,7 +1100,7 @@ e.g. java.lang.annotation)." | |
(if (and meghanada--server-process (process-live-p meghanada--server-process)) | ||
(let ((output (meghanada--send-request-sync | ||
"oi" | ||
(buffer-file-name) | ||
(format "\"%s\"" (buffer-file-name)) | ||
(meghanada--write-tmpfile)))) | ||
(when output | ||
(let ((patchbuf (get-buffer-create "*meghanada-fmt patch*")) | ||
|
@@ -1123,18 +1138,18 @@ e.g. java.lang.annotation)." | |
(if (and meghanada--client-process (process-live-p meghanada--client-process)) | ||
(meghanada--send-request "ap" | ||
callback | ||
(buffer-file-name) | ||
(format "\"%s\"" (buffer-file-name)) | ||
(meghanada--what-line) | ||
(meghanada--what-column) | ||
prefix) | ||
(format "\"%s\"" prefix)) | ||
(message "client connection not established"))) | ||
|
||
(defun meghanada-autocomplete-resolve-async (type item desc callback) | ||
"TODO: FIX DOC TYPE ITEM DESC CALLBACK." | ||
(if (and meghanada--client-process (process-live-p meghanada--client-process)) | ||
(meghanada--send-request "cr" | ||
callback | ||
(buffer-file-name) | ||
(format "\"%s\"" (buffer-file-name)) | ||
(meghanada--what-line) | ||
(meghanada--what-column) | ||
(format "\"%s\"" type) | ||
|
@@ -1164,7 +1179,7 @@ e.g. java.lang.annotation)." | |
(if (and meghanada--server-process (process-live-p meghanada--server-process)) | ||
(meghanada--send-request "lv" | ||
#'meghanada--local-val-callback | ||
(buffer-file-name) | ||
(format "\"%s\"" (buffer-file-name)) | ||
(meghanada--what-line)) | ||
(message "client connection not established"))) | ||
|
||
|
@@ -1177,7 +1192,7 @@ e.g. java.lang.annotation)." | |
(if (and meghanada--client-process (process-live-p meghanada--client-process)) | ||
(meghanada--send-request "di" | ||
callback | ||
(buffer-file-name)) | ||
(format "\"%s\"" (buffer-file-name))) | ||
(message "client connection not established"))) | ||
|
||
(defun meghanada-diagnostic-string-async (callback) | ||
|
@@ -1236,7 +1251,7 @@ e.g. java.lang.annotation)." | |
(interactive) | ||
(when (meghanada-alive-p) | ||
(if (and meghanada--server-process (process-live-p meghanada--server-process)) | ||
(let ((buf (buffer-file-name))) | ||
(let ((buf (format "\"%s\"" (buffer-file-name)))) | ||
(message "compiling ... ") | ||
(meghanada--kill-buf "*compilation*") | ||
(pop-to-buffer "*compilation*") | ||
|
@@ -1248,7 +1263,7 @@ e.g. java.lang.annotation)." | |
(interactive) | ||
(when (meghanada-alive-p) | ||
(if (and meghanada--server-process (process-live-p meghanada--server-process)) | ||
(let ((buf (buffer-file-name))) | ||
(let ((buf (format "\"%s\"" (buffer-file-name)))) | ||
(message "compiling ... ") | ||
(meghanada--kill-buf "*compilation*") | ||
(pop-to-buffer "*compilation*") | ||
|
@@ -1278,7 +1293,7 @@ e.g. java.lang.annotation)." | |
"TODO: FIX DOC CALLBACK." | ||
(interactive) | ||
(if (and meghanada--server-process (process-live-p meghanada--server-process)) | ||
(meghanada--send-request "st" #'meghanada--switch-testcase-callback (buffer-file-name)) | ||
(meghanada--send-request "st" #'meghanada--switch-testcase-callback (format "\"%s\"" (buffer-file-name))) | ||
(message "client connection not established"))) | ||
|
||
|
||
|
@@ -1310,8 +1325,8 @@ e.g. java.lang.annotation)." | |
(setq meghanada--task-buffer meghanada--junit-buf-name) | ||
(pop-to-buffer meghanada--junit-buf-name) | ||
(if debug | ||
(meghanada--send-request-process "dj" meghanada--task-client-process #'meghanada--junit-callback file test) | ||
(meghanada--send-request-process "rj" meghanada--task-client-process #'meghanada--junit-callback file test))) | ||
(meghanada--send-request-process "dj" meghanada--task-client-process #'meghanada--junit-callback (format "\"%s\"" file) test) | ||
(meghanada--send-request-process "rj" meghanada--task-client-process #'meghanada--junit-callback (format "\"%s\"" file) test))) | ||
(message "client connection not established"))) | ||
|
||
(defun meghanada-run-junit-class () | ||
|
@@ -1389,7 +1404,7 @@ e.g. java.lang.annotation)." | |
(setq meghanada--task-client-process (meghanada--start-task-client-process))) | ||
|
||
(if (and meghanada--task-client-process (process-live-p meghanada--task-client-process)) | ||
(let ((file (buffer-file-name))) | ||
(let ((file (format "\"%s\"" (buffer-file-name)))) | ||
(meghanada--kill-buf meghanada--task-buf-name) | ||
(meghanada--kill-buf meghanada--junit-buf-name) | ||
(setq meghanada--task-buffer meghanada--task-buf-name) | ||
|
@@ -1404,7 +1419,7 @@ e.g. java.lang.annotation)." | |
(setq meghanada--task-client-process (meghanada--start-task-client-process))) | ||
|
||
(if (and meghanada--task-client-process (process-live-p meghanada--task-client-process)) | ||
(let ((file (buffer-file-name))) | ||
(let ((file (format "\"%s\"" (buffer-file-name)))) | ||
(meghanada--kill-buf meghanada--task-buf-name) | ||
(meghanada--kill-buf meghanada--junit-buf-name) | ||
(setq meghanada--task-buffer meghanada--task-buf-name) | ||
|
@@ -1440,7 +1455,7 @@ e.g. java.lang.annotation)." | |
(let ((sym (meghanada--what-symbol))) | ||
(when sym | ||
(meghanada--send-request "jd" #'meghanada--jump-callback | ||
(buffer-file-name) | ||
(format "\"%s\"" (buffer-file-name)) | ||
(meghanada--what-line) | ||
(meghanada--what-column) | ||
(format "\"%s\"" sym)))) | ||
|
@@ -1460,7 +1475,7 @@ e.g. java.lang.annotation)." | |
(let ((sym (completing-read "Symbol: " (meghanada--list-symbols) nil nil))) | ||
(when sym | ||
(meghanada--send-request "js" #'meghanada--jump-callback | ||
(buffer-file-name) | ||
(format "\"%s\"" (buffer-file-name)) | ||
(meghanada--what-line) | ||
(meghanada--what-column) | ||
(format "\"%s\"" sym)))) | ||
|
@@ -1588,7 +1603,7 @@ e.g. java.lang.annotation)." | |
(progn | ||
(funcall meghanada-reference-prepare) | ||
(meghanada--send-request "re" meghanada-reference-callback | ||
buf | ||
(format "\"%s\"" buf) | ||
line | ||
col | ||
(format "\"%s\"" sym))))) | ||
|
@@ -1651,7 +1666,7 @@ e.g. java.lang.annotation)." | |
(progn | ||
(funcall meghanada-typeinfo-prepare) | ||
(meghanada--send-request "ti" meghanada-typeinfo-callback | ||
buf | ||
(format "\"%s\"" buf) | ||
line | ||
col | ||
(format "\"%s\"" sym)))) | ||
|
@@ -1859,7 +1874,7 @@ e.g. java.lang.annotation)." | |
"Change project root." | ||
(when (meghanada-alive-p) | ||
(if (and meghanada--client-process (process-live-p meghanada--client-process)) | ||
(meghanada--send-request "pc" #'identity (buffer-file-name)) | ||
(meghanada--send-request "pc" #'identity (format "\"%s\"" (buffer-file-name))) | ||
(message "client connection not established")))) | ||
|
||
;;;###autoload | ||
|