Commit Graph

154 Commits

Author SHA1 Message Date
a70e634ebd refactor(:lang): move tree-sitter init
Moved add-hook calls (for tree-sitter initialization) into their
respective modes' config blocks, or nearby, to be consistent with how
other, similar tools (like lsp!) are initialized, and does so at
runtime, rather than at expansion/compile time, which eval-when! caused.
2022-07-25 17:34:44 +02:00
7f814e5d99 refactor(:lang): redo tree-sitter hooks
- bind to major-mode-local-vars-hook instead of major mode hook
- bind the autodef tree-sitter! instead of the functions.
2022-05-22 21:26:08 +01:00
0c2f986708 feat(:lang): enable ts text objs in modes 2022-05-22 21:26:03 +01:00
06ed5ade3f refactor!(tree-sitter): add +tree-sitter flag
BREAKING CHANGE: break the global nature of the tree sitter
module by adding a +tree-sitter flag to every applicable module

In the background this hooks turn-on-tree-sitter-mode
to the major-mode-hook of the language.
This may also solve the eager loading of tree sitter
2022-05-22 21:26:00 +01:00
9d1513af46 bump: :core
bbatsov/projectile@0243ad7dc9 -> bbatsov/projectile@f3468e8d20
domtronn/all-the-icons.el@2c963ebb75 -> domtronn/all-the-icons.el@65c496d3d1
jscheid/dtrt-indent@926fc4260c -> jscheid/dtrt-indent@66fc30af02
raxod502/straight.el@653b04a64f -> raxod502/straight.el@e2de88ea0e
2022-03-30 17:49:35 +02:00
d43f260af6 fix(cc): remove double lenses with lsp
On current pins, ccls and lsp code lenses aren't mutually exclusive,
and there is actually 2 sets of code lenses appearing
2021-12-15 15:15:08 +01:00
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
0026404b34 Use new CPU counter function in cc module
Broken since commit c5e3f4d6.
2021-03-02 10:02:12 +01:00
b91a1b3e7b Extract CPU counting to doom-num-cpus function
And improves macOS support as discussed in hlissner/doom-emacs@db6a27c
2020-11-29 14:49:14 -05:00
4dab595ad3 Minor refactors & comment revision 2020-11-20 14:10:29 -05:00
315ae16240 Add lookup-documentation handler for cmake-mode
Closes #4277

Co-authored-by: Sam Whitlock <samwhitlock@users.noreply.github.com>
2020-11-17 12:46:10 -05:00
5233042f4a Add lsp support to cmake-mode 2020-11-17 12:46:10 -05:00
d85c7b857b lang/cc: fix sem-highlight disabler
We unset ccls-sem-highlight-method buffer-locally, but
lsp-before-initialize-hook only runs once per new LSP server instance,
and each server could preside over any number of buffers, so only the
first buffer is affected.
2020-10-14 21:39:56 -04:00
0b480a6aad lang/cc: refactor ccls config
1. Unset ccls-sem-highlight-method if lsp-enable-semantic-highlighting
   is nil (perhaps this should be reported upstream).
2. Fix load-order. Take `(use-package X :after Y :config Z)` for
   example. Z will be evaluated after Y loads, not after X loads. To
   customize Z you'd need to do `(after! Y ...)`. This is
   counter-intuitive. By removing `:after Y` and explicitly loading X
   when Y loads in :init, you can customize Z with `(after! X ...)` again.
3. Tie ccls-code-lens-mode to lsp-lens-mode, so lsp-lens-enable is
   respected.
2020-10-13 21:51:11 -04:00
bf62aff8c0 lang/cc: fix +cc/ccls-show-* keybinds
Forgot to rename them in df85b4cda.
2020-10-11 21:52:43 -04:00
b76cac9b9a lang/cc: fix ccls/eglot commands for vanilla users
And conform them to Doom's naming conventions.
2020-10-11 21:50:15 -04:00
79d4903817 [:lang cc] Fix list in call for cpu count command
I should find some way to test on Mac OS I guess, or test at least. That would make those small errors easier to catch than trying to review it 1000 times
2020-10-11 11:07:21 +02:00
cec81ac2cc Add ccls-specific configuration
Most of these changes come from MaskRay's private configuration found
here :
c078dfad34/home/.config/doom/modules/private/my-cc/config.el

- Limit ccls threads to be maximum half the available core count on
  Linux and MacOS
- Add wrappers to call ccls LSP extensions
- Enable ccls-code-lens-mode
- Set initial state to emacs when navigating ccls-tree
- Use 'font-lock for semantic highlighting, making the speed choice
  according to variable's docstring

- config tweaks to eglot
  InitializationOptions aren't handled this way. An example of handling
  ccls init options is provided on joaotavora/eglot#545, hoping that a fix
  gets merged upstream instead of having to handle ccls specifics in Doom
  only
2020-10-10 20:44:52 +02:00
91c1e705e6 checkers/spell: add add/remove word & next/prev error commands
So both spell-fu and flyspell users have a more consistent interface.
2020-09-02 13:58:27 -04:00
5f47169c0e Load ccls.el after lsp-mode
lsp-mode is the package's entry point now, not lsp.
2020-08-31 22:54:44 -04:00
f6f90c9791 Fix lsp packages failing to load
As of emacs-lsp/lsp-mode@b9b0f34 there is no more lsp-clients, so load
these lsp packages after lsp-mode instead.
2020-08-20 03:54:44 -04:00
7081d833f6 Move :ui pretty-code to :ui ligatures
Includes a major refactor of the module.
2020-08-20 02:14:32 -04:00
0f39d7bda4 lang/cc: remove unnecessary settings
lsp-mode no longer uses company-lsp and with the remove of
company-prescient company-transformers is already nil.
2020-07-26 14:52:27 -04:00
da1030985d Minor refactors & reformatting 2020-07-23 01:26:03 -04:00
200fd52b61 Fix invalid-function error due to missing backquote
Mentioned in #3020
2020-05-28 22:01:23 -04:00
dc3c2f9e78 [review] no extension in load! / rename interactive function 2020-05-28 13:13:00 +02:00
0f5c5bb288 Move and map interactive eglot/c++ function 2020-05-28 12:01:35 +02:00
718d9a2690 [review] Changes 2020-05-28 11:17:55 +02:00
3e5b7cce3f [eglot] Add support for eglot lsp client in emacs
- Update README
- Add eglot-specifics to cc, rs, py, hs
  removing unused lsp-mode packages when eglot is active
- Add eglot-specific bindings
- Add doctor warnings for debugger +lsp and +peek
- Add eglot-backed lookup-handlers
- Add flycheck checker using eglot for :checkers
  syntax users (using flycheck/flycheck#1676 and
  flycheck/flycheck#1592 discussion).
  This implementation is based on @marsam code, and uses recent
  Flycheck development in order to make the code smaller and
  easier to maintain.
2020-05-28 09:34:10 +02:00
428cb15c7a Suppress args out of range error in C++ buffers
When you use iedit or multiple cursors.
2020-04-14 00:12:40 -04:00
5033215150 Fix #2789: wrong init hooks for irony & rtags 2020-03-29 01:29:27 -04:00
169f9a6121 General, minor refactor & reformatting 2020-03-27 01:25:30 -04:00
2322bff412 Fix typo: ffap-list -> ffap-alist 2020-02-07 01:35:46 +01:00
22bf716e43 Fix gf/find-file-at-point in c-mode 2020-02-06 16:55:28 -05:00
12094788d7 Fix references to :tools fly{spell,check} 2020-01-14 03:04:26 -05:00
6523f6a12e Move cpp-mode{,-map} aliases to autoloads
They don't need to be in config.el
2020-01-03 05:49:43 -05:00
967390fe6c lang/cc: add system libs to default ccls init options on mac 2019-12-13 14:24:17 -05:00
da07b63f40 lang/cc: fix #2097 wrong-type-arg listp on c-default-style 2019-11-21 14:21:56 -05:00
caed1f2d1a Use CMake docset for cmake-mode 2019-11-19 09:58:52 +10:00
6b327dfcca lang/cc: fix default style in C/C++ modes
c-default-style wasn't being used correctly.
2019-10-24 17:03:08 -04:00
d297dc6934 Minor refactor & comment revision across the board 2019-10-03 23:33:59 -04:00
af26a14230 lang/cc: decouple lsp init from ccls package 2019-08-27 00:05:13 -04:00
a3e262c7ac 💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
f25ec72253 lang/cc: fix stringp errors when loading rtags
Binary checks for rtags expect rtags-rc-binary-name and
rtags-rdm-binary-name to always be non-nil.
2019-07-24 15:25:42 +02:00
76cacb5bfe 💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
60acdcb962 lang/cc: conform to new conventions 2019-07-22 23:52:16 +02:00
2ff762b397 Fix fd/rtags on debian/ubuntu
On debian/ubuntu, these executables have a different name:

- fd -> fdfind
- rc -> rtags-rc
- rdm -> rtags-rdm
2019-07-14 22:04:50 +02:00
7c9e9a3446 Move lsp! to local-vars hooks
- Set lsp-java-server-install-dir
- Use lsp! instead of lsp in lang/cc
2019-07-07 01:58:08 +02:00
3474e6bf09 lang/cc: move smartparens config to config/default 2019-05-22 03:50:53 -04:00
a4c5396558 Add better-jumper
Replaces evil's jumplist; makes its functionality available for non evil
users.
2019-04-24 18:16:04 -04:00