I'm a java developer and I'm beginner using spacemacs, I've configured .spacemacs file to java configuration. Many functionalities works well, for example, a class recognition when I'm coding, but in this moment, a syntax-checker doesn't works. When I'm coding, I write a wrong line (e.g., I omitted a semicolon) and my syntax-checker doesn't detect this error.

I've founded a video where The author has a nice syntax checker but he doesn't use spacemacs.

this is my config:

     ;; ----------------------------------------------------------------
     ;; Example of useful layers you may want to use right away.
     ;; Uncomment some layer names and press `SPC f e R' (Vim style) or
     ;; `M-m f e R' (Emacs style) to install them.
     ;; ----------------------------------------------------------------
     (shell :variables
            shell-default-height 30
             shell-default-position 'bottom)
     (syntax-checking :variables
                      syntax-checking-enable-by-default t
                      syntax-checking-enable-tooltips t)
     (java :variables java-backend 'lsp
           java/post-init-flycheck t)

(defun dotspacemacs/user-config ()
  "Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
Put your configuration code here, except for variables that should be set
before packages are loaded."
(setq lombok-jar-path

  (setq lsp-java-vmargs `(
                          ,(concat "-javaagent:" lombok-jar-path)
                          ,(concat "-Xbootclasspath/a:" lombok-jar-path)

and this is the error: error

My problem is how to enable well the syntax-checking (flycheck) in order to check my code when I'm writing.

Maybe I need to add a variable in syntax-checking but I don't know what.

I wish I could has a flycheck like this enter image description here the image was taken from the following video (https://youtu.be/S0mFvaBlYcs?t=112)

  • Welcome to Emacs.SE! We need you to update your post. First, please ask a discrete question (you can ask multiple questions across multiple posts). Two, please post only the relevant configuration code as text, rather than as screenshots. Third, do not expect anyone to watch the video you are referring to, and instead explain in your post what the problem is, what you tried to do to fix it, and where you are stuck.
    – Dan
    Jun 3 at 15:17
  • @dan thanks for your feedback. Jun 3 at 16:04
  • This should be good enough to make it work. Can you check the Messages buffer for warnings? Can you do SPC e v and check if lsp is selected buffer? Can you do ,bd and check if the session root is the correct one? Jun 3 at 18:22
  • @IvanDimitrovYonchovski, yes, the result of SPC e v is Flycheck Mode is enable and of ,bd, the session root is in folder of project, maybe I need to add another config. Jun 3 at 19:23
  • can you provide the content of these buffers? Can you check also lsp-log for errors? Can you test with hello world application, you can find one here: github.com/emacs-lsp/lsp-mode/tree/master/test/fixtures/… ? Jun 4 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.