Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

langtool-server--ensure-running doesn't work for languagetool installed with package manager #71

Open
ST-Saint opened this issue Oct 13, 2023 · 0 comments

Comments

@ST-Saint
Copy link

langtool-java-classpath is also needed for server & client mode

(defun langtool-server--ensure-running ()
  (langtool-server--check-command)
  (unless (let ((proc (langtool-adapter-get 'process)))
            (and  (processp proc)
                  (eq (process-status proc) 'run)))
    ;; Force terminate previous server process if exists.
    (langtool-adapter-ensure-terminate)
    (let* ((bin langtool-java-bin)
           (args '()))
      ;; jar Default setting is "HTTPSServer" .
      ;; This application no need to use SSL since local app.
      ;; http://wiki.languagetool.org/http-server
      (setq args (append args (list
+                              "-cp" langtool-java-classpath ;; ("/usr/share/languagetool:/usr/share/java/languagetool/*")
-                              (langtool--process-file-name
-                               langtool-language-tool-server-jar)
                               )))
      (setq args (append args (list "org.languagetool.server.HTTPServer")))
      (setq args (append args langtool-server-user-arguments))
      (langtool--debug "HTTPServer" "%s: %s" bin args)
      (let* ((buffer (get-buffer-create " *LangtoolHttpServer* "))
             (proc (apply
                    #'start-process
                    "LangtoolHttpServer" buffer
                    bin
                    args)))
        (langtool-server--rendezvous proc buffer)
        (set-process-sentinel proc 'langtool-server--process-sentinel)
        (langtool-adapter-ensure-internal proc)
        proc))))

Also, is PR still welcome?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant