This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-13
Channels
- # announcements (6)
- # babashka (96)
- # beginners (159)
- # calva (16)
- # cider (17)
- # clj-kondo (4)
- # cljdoc (6)
- # cljfx (3)
- # clojure (202)
- # clojure-europe (21)
- # clojure-italy (2)
- # clojure-nl (36)
- # clojure-spec (6)
- # clojure-uk (16)
- # clojurescript (29)
- # conjure (25)
- # cursive (29)
- # data-science (12)
- # datalog (18)
- # datomic (58)
- # depstar (73)
- # duct (16)
- # emacs (65)
- # events (3)
- # fulcro (8)
- # honeysql (12)
- # jackdaw (6)
- # jobs (7)
- # jobs-discuss (3)
- # kaocha (50)
- # leiningen (8)
- # lsp (14)
- # malli (83)
- # meander (34)
- # off-topic (2)
- # polylith (4)
- # proletarian (7)
- # re-frame (8)
- # releases (9)
- # remote-jobs (3)
- # shadow-cljs (101)
- # sql (1)
- # tools-deps (48)
- # vim (7)
- # xtdb (13)
- # yada (14)
Hmm, the 3 modes are essentially the same (clojure, clojurescript, clojurec), so in general if you setup something for clojure-mode it should work for everything. Of course, this was depends on how exactly paxedit
has been implemented.
Itβs interesting that paxedit
has been mostly dormant for 4 years, and yet it has only 1 open issue.
Nice work on fixing the http debugging issue!
lsp-execute-code-action
is apparently bound to s-l a a
. I don't recognize that keybinding. my best guess is super-l a a, but on a mac that doesn't seem to trigger it, although i believe the cmd key is remapped to meta. does anyone recognize that offhand?
On Ubuntu, s-l locks the screen, instantly, and is never seen by Emacs. I've never successfully used lsp-keymap-prefix. I set it in my config, but it's just ignored, so maybe I'm not doing right: (setq lsp-keymap-prefix "C-c C-l")
-- I've tried that with various keys, in either the :init
or :config
sections of use-package lsp-mode
, etc. All ignored. M-x lsp-... come up with "s-l ..." as the keybindings. What am I doing wrong? (I've also tried changing the mapping for the super key in Gnome with the same level off success...)
What I do instead (and it's a poor workaround) is to create a hydra menu of lsp functions bound to C-c l
, but that is always limited to what I happen to know about...
yeah i made my own hydra as well. i think the s-l
is space l and only makes sense when you have modal editing. not often do you see packages where the default keybindings are geared for evil
I thought it was "Super", as in the Windows key.
I personally think that any Emacs packages that expect any key modifiers other than Shift, Control, and Meta to be something the user figures out how to use is expecting expert level knowledge. Even figuring out Meta on multiple machines (e.g. your host OS and inside a Linux VM) can be a challenge.
@eamonn.sullivan Looking at the lsp-mode source:
(defvar lsp-mode-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-<down-mouse-1>") #'lsp-find-definition-mouse)
(define-key map (kbd "C-<mouse-1>") #'ignore)
(define-key map (kbd "<mouse-3>") #'lsp-mouse-click)
(define-key map (kbd "C-S-SPC") #'lsp-signature-activate)
(when lsp-keymap-prefix
(define-key map (kbd lsp-keymap-prefix) lsp-command-map))
map)
"Keymap for `lsp-mode'.")
So it may be that you set the prefix too late, after this map has already been definedWorkaround is to just bind it manually (define-key lsp-mode-map (kbd "C-c l") lsp-command-map)
@qythium, thank you! That worked, finally. I had to define-key it outside of (and after) the (use-package ...) declaration. That was harder than it probably should be...
i just did this and it worked for me
(use-package lsp-mode
:ensure t
:hook ((clojure-mode . lsp)
(clojurec-mode . lsp)
(clojurescript-mode . lsp))
:init
(setq lsp-keymap-prefix "C-M-l")
:config
(setq lsp-enable-indentation nil)
(setq lsp-enable-file-watchers nil) ;; annoying and i can't specify paths
;; add paths to your local installation of project mgmt tools, like lein
(dolist (m '(clojure-mode
clojurec-mode
clojurescript-mode
clojurex-mode))
(add-to-list 'lsp-language-id-configuration `(,m . "clojure"))))
Might be something to do with straight.el, but setting it init like that definitely doesn't work for me. Odd.
Seems to be a common issue that people run into, though: https://github.com/emacs-lsp/lsp-mode/issues/1672. The define-key thing is recommended here, but I still don't understand why βοΈ works for you, but not me.
Probably straight.el is loading the package before use-package does? I recall there were some strange interactions if you use both managers together
Trying out clojure-lsp and was wondering why it complained about watching too many files (over 1000). Ignoring .clj-kondo
and .shadow-cljs
directories (via lsp-file-watch-ignored-directories
) seemed to help.
the .clj-kondo dir is already ignored by default on lsp-mode, I'll add the shadow-cljs as well
the lsp-mode watches all files under the project root. with cljs projects this can get enormous with vendored projects, npm_bundle directory, cljs compilation output, etc
@U11BV7MTK Do you known common dirs to be excluded for cljs projects? then I can add to default ignore list of lsp-mode
attempt was made here: https://github.com/emacs-lsp/lsp-mode/pull/1829
i didn't know how multi-projects impacted it and i switched jobs and ended up not using lsp for a bit. i've finally readded it and just turned off the watchers
Alright, I'll bring that issue again and try to understand if we can make it happen
i think someone mentioned that lsp servers can be configured to report what they are watching. this might be an alternative
clojure-lsp don't handle that, it should be configured on lsp-mode ATM, meanwhile, what are the common dirs for cljs libs?
node_modules for sure. anywhere there could be cljs output, and that is an arbitrary property to the cljs compiler. anywhere there could be vendored js, anywhere you might have lots of translations files (again arbitrary)
i think your question is how could we create a blacklist of random files that aren't clojure source files and i don't think that there's any good answer to that question
node_modules is already excluded: https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L318
> anywhere there could be vendored js, anywhere you might have lots of translations files (again arbitrary) I agree, but we can reduce that adding those known folders, is not easy to have more than 10000 compiled js/otherfiles
looking at just the top level of our project, i see .babel_cache
, docs
, locales
, resources
, and target
as dirs that have lots of files that shouldn't be watched
nice, target is excluded already, I think we can add .babel_cache along with .shadow-cljs
ah, think I updated lsp-mode, but maybe was on an older version, which didn't have .clj-kondo
for ignore
I wondered where the files came from, then scripted some stats:
for d in `find . -maxdepth 1 -type d | sort`; do echo $d; find $d | wc -l; done
maybe could even include a script like that in the lsp-mode docs to help people uncover hidden black holes of stuff in project directory π
Yeah, you are the second person to ask for the same thing this week, I'll try to improve lsp-mode log to log the folders scanned into lsp-log buffer
I also went to lsp logs to get to that watch info, then checking project directories and adding filters to lsp-mode configuration, until I got below the default 1000 file limit warning. This logging will be helpful in the future I think π
Nice! Better defaults make people trip less π (takes a bit of time to get good defaults, in a case like this)
Thank you! I had tried clojure-lsp in Emacs a couple of times, might have been other reasons earlier that I gave up, but got a hang of that dir watch this time and then it just occurred to me that might even post that observation to Clojurians Slack. I guess it was just good timing that things end up as improvement into lsp-mode, this make me happy π