Code Monkey home page Code Monkey logo

Comments (13)

yyoncho avatar yyoncho commented on May 28, 2024

What do you for completion - company-lsp or completion-at-point?

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

I have fixed this behavior in tigersoldier/company-lsp#36

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

Verified with latest company-lsp.

from lsp-java.

xianghx avatar xianghx commented on May 28, 2024

No, it still does not work.

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

Can you make sure that you are using latest JDT/lsp-mode/lsp-java? Also, is your project configured in lsp-java--workspace-folders as per java-mode readme?

If the problem still exists, can you set lsp-print-io to t and post the logs(in messages) from starting the server to the reproducing the issue?

from lsp-java.

xianghx avatar xianghx commented on May 28, 2024
(require-package 'lsp-java)
(with-eval-after-load 'cc-mode
  (defun my-lsp-java-setup ()
    "lsp java setup"
    (interactive "P")
    (require 'lsp-java)
    (lsp-java-enable))

  (setq lsp-java-server-install-dir (expand-file-name "/opt/eclipse.jdt.ls/server/"))
  (setq lsp-java-workspace-dir (expand-file-name "~/workspace/"))
  (setq lsp-java-workspace-cache-dir (expand-file-name "~/workspace/.cache/"))

  (setq lsp-print-io t)
  ;; set the projects that are going to be imported into the workspace.
  (setq lsp-java--workspace-folders (list
                                     "/home/xianghx/workspace/hello-world"
                                     ;; "~/workspace/hello-world"
                                          ))
  ;; 必须my-lsp-java-setup前面
  (add-hook 'java-mode-hook 'lsp-mode)
  (add-hook 'java-mode-hook 'my-lsp-java-setup)
  (add-hook 'java-mode-hook 'flycheck-mode)
  (add-hook 'java-mode-hook 'company-mode)
  (add-hook 'java-mode-hook (lambda () (set (make-local-variable 'company-backends)
                                       '(company-lsp
                                         (company-dabbrev-code company-gtags company-etags company-keywords)
                                         company-files company-dabbrev))))
  )

(provide 'init-java)

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

From what I can see everything seems to be fine: Can you use the function described in tigersoldier/company-lsp#39 (comment) and post the messages content? I hope that this will be the final step to resolve the issue.

from lsp-java.

xianghx avatar xianghx commented on May 28, 2024

I try rust and go, that's all ok.

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

From what I can see this line is not present in the logs, that means that company-lsp--post-completion version is not called.

(message "Starting content:%s" (thing-at-point 'line))

RUST and GO work probably because they do not do snippet completion.

from lsp-java.

xianghx avatar xianghx commented on May 28, 2024

I close yasnippet.

when I input slowly:

        h.na
           name
           name2

      Results  >>  h.name()na   or h.name()a   or h.name(): String etc

but when I input fast.

          h.na
              name
              name2
              finalize

        Result  >>   h.name()

from lsp-java.

yyoncho avatar yyoncho commented on May 28, 2024

can you check the value of company-lsp-cache-candidates? It should be nil for lsp-java.

from lsp-java.

xianghx avatar xianghx commented on May 28, 2024

OK:)))

  (setq company-lsp-cache-candidates nil)

from lsp-java.

xianghx avatar xianghx commented on May 28, 2024

Sometime, first init, they have some problem, not always.
Company: An error occurred in auto-begin
Company: backend company-lsp error "Wrong type argument: hash-table-p, nil" with args (prefix)

from lsp-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.