This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-28
Channels
- # announcements (9)
- # aws (2)
- # beginners (45)
- # biff (2)
- # calva (20)
- # cider (4)
- # cljdoc (15)
- # cljs-dev (9)
- # clojure (102)
- # clojure-austin (14)
- # clojure-europe (39)
- # clojure-france (3)
- # clojure-germany (1)
- # clojure-norway (39)
- # clojure-spec (1)
- # clojure-uk (3)
- # conjure (8)
- # cursive (6)
- # datahike (3)
- # datomic (8)
- # emacs (28)
- # events (1)
- # holy-lambda (6)
- # hyperfiddle (13)
- # jobs (11)
- # keechma (2)
- # lsp (4)
- # malli (33)
- # nbb (36)
- # off-topic (52)
- # pathom (5)
- # pedestal (2)
- # portal (1)
- # reagent (2)
- # reitit (3)
- # remote-jobs (1)
- # scittle (1)
- # spacemacs (2)
- # xtdb (5)
I am using LSP in emacs to code Clojure and it works perfect, but when I open a ClojureScript project it does not work and I get the following error:
File mode specification error: (json-object-format , 34)
Any ideas on why is this happening? Thanks!
this is a error on emacs side, try toggle-debug-on-error
and repro the error again to get a stacktrace
I did it, but I can’t really interpret what’s happening:
Debugger entered--Lisp error: (json-object-format "," 34)
signal(json-object-format ("," 34))
json-read-object()
json-read()
json-read-file("/Users/tozzi/Projects/recipe-webapp-poc/package.json")
lsp-volar--vue-project-p("/Users/tozzi/Projects/recipe-webapp-poc")
lsp-volar--activate-p("/Users/tozzi/Projects/recipe-webapp-poc/src/recipe..." clojurescript-mode)
lsp--supports-buffer\?(#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode -0x10f8e60a0a5f712c>) :test\? #f(compiled-function () #<bytecode 0x1eaab965c7e2a0f>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x4a5986d5> :request-handlers #<hash-table equal 0/65 0x4a5f4ec7> :response-handlers #<hash-table eql 0/65 0x43a302bd> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x539acdbf> :action-handlers #<hash-table equal 0/65 0x539acddf> :major-modes nil :activation-fn lsp-volar--activate-p :priority 0 :server-id volar-api :multi-root nil :initialization-options #f(compiled-function () #<bytecode -0x10bc6736bf26aaab>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x89004ca9ed8999a>) :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x4a5f4691> :download-server-fn #f(compiled-function (client callback error-callback update\?) #<bytecode 0x1730d1a6c7284d23>) :download-in-progress? nil :buffers nil :synchronize-sections nil))
apply(lsp--supports-buffer\? #s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode -0x10f8e60a0a5f712c>) :test\? #f(compiled-function () #<bytecode 0x1eaab965c7e2a0f>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x4a5986d5> :request-handlers #<hash-table equal 0/65 0x4a5f4ec7> :response-handlers #<hash-table eql 0/65 0x43a302bd> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x539acdbf> :action-handlers #<hash-table equal 0/65 0x539acddf> :major-modes nil :activation-fn lsp-volar--activate-p :priority 0 :server-id volar-api :multi-root nil :initialization-options #f(compiled-function () #<bytecode -0x10bc6736bf26aaab>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x89004ca9ed8999a>) :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x4a5f4691> :download-server-fn #f(compiled-function (client callback error-callback update\?) #<bytecode 0x1730d1a6c7284d23>) :download-in-progress? nil :buffers nil :synchronize-sections nil))
#f(compiled-function (&rest args) #<bytecode 0x1a4af9ff4e837cef>)(#s(lsp--client :language-id nil :add-on? nil :new-connection (:connect #f(compiled-function (filter sentinel name environment-fn) #<bytecode -0x10f8e60a0a5f712c>) :test\? #f(compiled-function () #<bytecode 0x1eaab965c7e2a0f>)) :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 0/65 0x4a5986d5> :request-handlers #<hash-table equal 0/65 0x4a5f4ec7> :response-handlers #<hash-table eql 0/65 0x43a302bd> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x539acdbf> :action-handlers #<hash-table equal 0/65 0x539acddf> :major-modes nil :activation-fn lsp-volar--activate-p :priority 0 :server-id volar-api :multi-root nil :initialization-options #f(compiled-function () #<bytecode -0x10bc6736bf26aaab>) :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn #f(compiled-function (workspace) #<bytecode 0x89004ca9ed8999a>) :remote? nil :completion-in-comments? nil :path->uri-fn nil :uri->path-fn nil :environment-fn nil :after-open-fn nil :async-request-handlers #<hash-table equal 0/65 0x4a5f4691> :download-server-fn #f(compiled-function (client callback error-callback update\?) #<bytecode 0x1730d1a6c7284d23>) :download-in-progress? nil :buffers nil :synchronize-sections nil))
-filter(#f(compiled-function (&rest args) #<bytecode 0x1a4af9ff4e837cef>) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ...))
lsp--filter-clients(#f(compiled-function (&rest args) #<bytecode 0x1a4af9ff4e837cef>))
lsp(nil)
funcall-interactively(lsp nil)
call-interactively(lsp record nil)
command-execute(lsp record)
execute-extended-command(nil "lsp" "lsp")
funcall-interactively(execute-extended-command nil "lsp" "lsp")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
hmm I don’t even know what’s this 😅 but if it helps, this is my config:
(use-package lsp-mode
:init
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
(setq lsp-keymap-prefix "C-c l")
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
(clojure-mode . lsp)
(clojurescript-mode . lsp)
(clojurec-mode . lsp)
(rust-mode . lsp)
(c-mode . lsp)
(go-mode . lsp)
;; if you want which-key integration
(lsp-mode . lsp-enable-which-key-integration))
:commands lsp)
(use-package lsp-ui :commands lsp-ui-mode)
;;Syntax checking
(use-package flycheck
:ensure t
:init (global-flycheck-mode))
;;For debugging
(use-package dap-mode)
ah I see, volar is for Vue.js, interesting that I can’t find any function trough M-x lsp-volar…
I also tried creating a new shadow-cljs project and that seems to work fine, the LSP connects and it works just fine so I guess it is really something with my project
dumb question, but how do I recompile lsp-mode? or do you mean really recompile emacs?
if vanilla, are you using straight.el or something like that or just installing packages with package-install
?
I am using straight.el
in vanilla emacs
so just to be sure I deleted the correct files, I just deleted the whole .emacs.d
folder and cloned from my repository again and after rebuilding everything it works just fine
perfect, thank you for the help!
i forget the exact args and syntax but i do something to this effect: find -name *.elc | xargs rm
. You can just remove the compiled files (elc) and then restart emacs
ah ok, I thought there was some specific command, but this is good to know, thanks
I have org-babel working with inf-clojure. Is there a way to get paredit/clojure-mode working inside the the clojure code blocks? Is that supposed to work by default?
I think you can use C-c '
for opening the code block in another buffer with the proper major mode
I just started messing with it today and jumbled this together from google results until it worked, not totally sure it will work if repeated
(require 'ob-clojure)
(setq org-babel-clojure-backend 'inf-clojure)
;;; might be a bad default?
(setq org-confirm-babel-evaluate nil)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(shell . t)
(clojure . t)))
Then, in an org file:
#+begin_src clojure
(println "hi")
(+ 1 2 3)
#+end_src
And c-c to eval the result (in the current inf-clojure repl)