@@ -170,6 +170,14 @@ In linux or macOS, it can be \"mvn\"; In Windows, it can be \"mvn.cmd\". "
170
170
:group 'meghanada
171
171
:type 'boolean )
172
172
173
+ (defcustom meghanada-jvm-option nil
174
+ " Set to all meghanada java process jvm option.
175
+
176
+ Example. (setq meghanada-jvm-option \" -Dhttp.proxyHost=test.proxy.com -Dhttp.proxyPort=8080\" )
177
+ "
178
+ :group 'meghanada
179
+ :type 'string )
180
+
173
181
(defcustom meghanada-server-jvm-option " -Xms128m -XX:ReservedCodeCacheSize=240m -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false"
174
182
" Set to meghanada server process jvm option."
175
183
:group 'meghanada
@@ -374,13 +382,20 @@ function."
374
382
(meghanada--download-setup-jar)
375
383
(meghanada--run-setup))
376
384
385
+ (defun meghanada--setup-options ()
386
+ (let ((options '()))
387
+ (when meghanada-jvm-option
388
+ (push meghanada-jvm-option options))
389
+ (mapconcat 'identity options " " )))
390
+
377
391
(defun meghanada--run-setup ()
378
392
" Setup meghanada server module."
379
393
(let ((jar (meghanada--locate-setup-jar))
380
394
(dest meghanada-server-install-dir))
381
395
(if (file-exists-p jar)
382
- (let ((cmd (format " %s -jar %s --dest %s --server-version %s --simple"
396
+ (let ((cmd (format " %s %s -jar %s --dest %s --server-version %s --simple"
383
397
(shell-quote-argument meghanada-java-path)
398
+ (meghanada--setup-options)
384
399
(shell-quote-argument jar)
385
400
(expand-file-name dest)
386
401
meghanada-version)))
@@ -500,10 +515,10 @@ function."
500
515
(push (format " -Dmeghanada.completion.matcher=%s " meghanada-completion-matcher) options))
501
516
(when meghanada-class-completion-matcher
502
517
(push (format " -Dmeghanada.class.completion.matcher=%s " meghanada-class-completion-matcher) options))
518
+ (when meghanada-jvm-option
519
+ (push meghanada-jvm-option options))
503
520
(push " -Djava.net.preferIPv4Stack=true" options)
504
- (mapconcat 'identity
505
- options
506
- " " )))
521
+ (mapconcat 'identity options " " )))
507
522
508
523
(defun meghanada--start-server-process ()
509
524
" TODO: FIX DOC ."
0 commit comments