Commit graph

176 commits

Author SHA1 Message Date
Henrik Lissner
d633c15042
perf(cc): lsp-clangd: halve core count for indexing
Ref: cec81ac2cc
2024-09-14 16:08:43 -04:00
Henrik Lissner
005831bfcc
refactor(lsp): let lsp-mode load lsp client packages
Most of these lsp packages are already in `lsp-client-packages`, which
lsp-mode will eagerly load the first time `lsp-mode` is activated, so we
don't need to do it ourselves, except in cases where the package isn't
in `lsp-client-packages` (like lsp-julia).
2024-09-09 17:24:45 -04:00
Henrik Lissner
374c28cedd
refactor(cc): only bind ccls keys if ccls is present
Fix: #5597
2024-09-09 17:24:45 -04:00
Henrik Lissner
cc8cf810f5
tweak(cc): prioritize clangd over ccls
lsp-clangd's default priority is -1.

Fix: #2689
2024-09-09 16:10:34 -04:00
Henrik Lissner
1a33838423
refactor!(cc): remove irony and rtags
BREAKING CHANGE: This removes the irony and rtags packages so we can
lean on LSP servers like clangd and ccls fully, which provide the same
features with much more consistency.

Close: #8049
2024-09-09 16:10:19 -04:00
Henrik Lissner
88666b1913
bump: :lang cc
Andersbakken/rtags@bd1c818a99 -> Andersbakken/rtags@f472b5d0a0
chachi/cuda-mode@7f593518fd -> chachi/cuda-mode@7dd07a20c3
emacs-lsp/emacs-ccls@8648238a92 -> emacs-lsp/emacs-ccls@41399b0eba
salmanebah/opencl-mode@10ae7742d5 -> salmanebah/opencl-mode@204d5d9e0f

- An update to cuda-mode now derives it from prog-mode, so that it
  behaves as a proper major mode (mentioned in #7993).

Fix: #7993
2024-08-13 23:14:52 -04:00
Henrik Lissner
84f7eb2aff
feat(cc): set eglot client for cuda-mode to clangd
Fix: #7993
2024-08-13 21:42:36 -04:00
Henrik Lissner
939fc0d322
feat: add project-vc config
I intend to keep `project-vc-extra-root-markers` much lighter than what
`projectile-project-root-files` ended up being, so I won't be
transferring all the root markers.

Ref: doomemacs/core#1
2024-08-09 20:50:51 -04:00
Henrik Lissner
d3124c4971
nit: add deprecation comments for projectile config
Ref: doomemacs/core#1
2024-08-09 20:42:33 -04:00
Henrik Lissner
b0e1e68e78
fix(cc): disable modern-cpp-font-lock if +tree-sitter
Fix: #7941
2024-07-11 23:32:05 -04:00
Henrik Lissner
19e27764ea
fix(cc): make *.c(c|pp) siblings of *.h(h|pp) files
I backported `find-sibling-file` in 198fe82 and included with it some
rudimentary `find-sibling-rules` rules for C++ and others. The C++ rule
made *.h(h|pp) files the siblings of *.c(c|pp) files, but not vice
versa, so users couldn't jump back to the source file with
`find-sibling-file`; a second rule is necessary.

These may be combinable, considering `find-sibling-file` deletes the
current buffer's filename from the list of candidates...

Fix: #7795
Ref: 198fe82b6d
2024-04-04 17:59:33 -04:00
Henrik Lissner
198fe82b6d
feat(lib): backport find-sibling-file
I will slowly phase out projectile in favor of project.el, starting with
projectile-find-other-file, which -- as of Emacs 29 -- has a native
alternative: `find-sibling-file`.

Ref: doomemacs/community#1
2024-03-11 00:53:44 -04:00
Henrik Lissner
659f7bfc71
refactor!: deprecate IS-* OS constants
BREAKING CHANGE: This deprecates the IS-(MAC|WINDOWS|LINUX|BSD) family
of global constants in favor of a native `featurep` check:

  IS-MAC      ->  (featurep :system 'macos)
  IS-WINDOWS  ->  (featurep :system 'windows)
  IS-LINUX    ->  (featurep :system 'linux)
  IS-BSD      ->  (featurep :system 'bsd)

The constants will stick around until the v3 release so folks can still
use it -- and there are still some modules that use it, but I'll phase
those uses out gradually.

Fix: #7479
2024-02-04 17:54:29 -05:00
Henrik Lissner
36d18d6da5
fix(cc): enable lsp in cuda-mode
Fix: #7576
2023-12-02 11:34:10 -05:00
Ellis Kenyő
cc9bda36c2
fix(cc): remove executable-find formatter check 2023-09-13 20:21:03 +01:00
Ellis Kenyő
bfb963f2f3
feat(format): add :lang cc formatter 2023-09-13 20:20:58 +01:00
Henrik Lissner
f427c8a30e
tweak: scroll-conservatively = 10
Forces the window to recenter if the cursor moves >=10 lines off-screen.
This makes some of our manual recentering elsewhere unnecessary.
2023-09-11 23:53:36 +02:00
Jeetaditya Chatterjee
4696f0d4ce
tweak(syntax): feat gate flycheck in all modules 2023-07-25 00:11:09 +01:00
Henrik Lissner
4c9df9bfc6
fix: partially revert OS detection changes
These changes snuck into ad6a3d0, but have not been implemented yet, so
some OS-specific functionality was orphaned.

Amend: ad6a3d0f33
2022-08-18 17:08:16 +02:00
Henrik Lissner
aa54383b5d
refactor: deprecate doom-etc-dir for doom-data-dir
doom-etc-dir will be renamed to doom-data-dir, to better reflect its
purpose, and align it with XDG_DATA_HOME (where it will be moved to in
v3, where Doom will begin to obey XDG directory conventions more
closely).
2022-08-14 20:43:35 +02:00
Henrik Lissner
ad6a3d0f33
refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
Henrik Lissner
9cb4c8b637
fix(:lang): ensure lsp! is always appended to hooks 2022-07-25 18:12:03 +02:00
Henrik Lissner
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
Jeetaditya Chatterjee
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
Jeetaditya Chatterjee
0c2f986708
feat(:lang): enable ts text objs in modes 2022-05-22 21:26:03 +01:00
Jeetaditya Chatterjee
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
Henrik Lissner
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
Gerry Agbobada
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
Henrik Lissner
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
Thomas Sanchez
0026404b34 Use new CPU counter function in cc module
Broken since commit c5e3f4d6.
2021-03-02 10:02:12 +01:00
Henrik Lissner
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
Henrik Lissner
4dab595ad3
Minor refactors & comment revision 2020-11-20 14:10:29 -05:00
Henrik Lissner
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
Henrik Lissner
5233042f4a
Add lsp support to cmake-mode 2020-11-17 12:46:10 -05:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
bf62aff8c0
lang/cc: fix +cc/ccls-show-* keybinds
Forgot to rename them in df85b4cda.
2020-10-11 21:52:43 -04:00
Henrik Lissner
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
Gerry Agbobada
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
Gerry Agbobada
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
7081d833f6
Move :ui pretty-code to :ui ligatures
Includes a major refactor of the module.
2020-08-20 02:14:32 -04:00
Henrik Lissner
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
Henrik Lissner
da1030985d
Minor refactors & reformatting 2020-07-23 01:26:03 -04:00
Henrik Lissner
200fd52b61
Fix invalid-function error due to missing backquote
Mentioned in #3020
2020-05-28 22:01:23 -04:00
Gerry Agbobada
dc3c2f9e78
[review] no extension in load! / rename interactive function 2020-05-28 13:13:00 +02:00
Gerry Agbobada
0f5c5bb288
Move and map interactive eglot/c++ function 2020-05-28 12:01:35 +02:00
Gerry Agbobada
718d9a2690
[review] Changes 2020-05-28 11:17:55 +02:00