Commit graph

45 commits

Author SHA1 Message Date
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
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
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
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
6e764ade2b
Add LSP/eglot support to +cc/reload-compile-db 2020-08-13 17:02:24 -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
Henrik Lissner
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
Valentin Ignatev
7ffc5d3134 Call renamed hook in the +cc/reload-compile-db autoload 2019-09-01 16:23:04 +03:00
Henrik Lissner
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
Henrik Lissner
60acdcb962
lang/cc: conform to new conventions 2019-07-22 23:52:16 +02:00
Henrik Lissner
8482f26d51
Move cc modes smartparen functions to config/default 2019-07-22 23:51:39 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Andrew Whatson
be4bae4acf Fix cc fontification for constants with numbers 2019-03-07 01:35:22 +10:00
Henrik Lissner
0bd576673c
Refactor lang/cc
+ Fix ffap integration
+ Code reduction for irony, rtags and lsp init hooks
+ Use c-add-style instead of unless+push
+ Log that irony server isn't installed
2019-03-02 01:51:51 -05:00
Shanavas M
1f63358947 Use configured variables for rtags binary names 2019-02-27 12:53:03 +05:30
Henrik Lissner
d83ba452ef
Refactor +cc-c-c++-objc-mode
Improve docstring and a minor correction to C++ detection regexp.
2019-02-26 13:23:42 -05:00
Andrew Whatson
2d3937ac1f Restore C/C++ default-header-file-mode support 2019-02-26 20:25:55 +10:00
Henrik Lissner
60df01714e
lang/cc: more type safety when reading compile options #1168
It was possible that +cc-default-compiler-options and/or
irony--compile-options could contain a nil, causing stringp type errors.
2019-02-14 00:40:19 -05:00
Henrik Lissner
957aa9c63e
lang/cc: make ffap aware of irony include paths 2019-01-14 00:49:58 -05:00
Henrik Lissner
553cee5921
lang/cc: remove naive cdb file check #1028
irony looks for compile_commands.json in several places, but
+cc/reload-compile-db would error out if there it didn't exist at the
project root.
2018-12-05 14:22:14 -05:00
Henrik Lissner
53fe7a1f04 Refactor Project API to reflect changes upstream
projectile-project-root no longer returns `default-directory` if not in
a project (it returns nil). As such, doom-project-* functions (and their
uses) have been refactored.

+ doom-project-p & doom-project-root are aliases for
  projectile-project-p & projectile-project-root.
+ doom-project-{p,root,name,expand} now has a DIR argument (for
  consistency, since projectile-project-name and
  projectile-project-expand do not).
+ The nocache parameter is no longer necessary, as projectile's caching
  behavior is now more sane.
+ Removed some projectile advice/hacks that are no longer necessary.
+ Updated unit tests
2018-09-28 21:13:27 -04:00
Henrik Lissner
c58077810d
General refactor of modules
General code and comment improvements.

Also, removed the :desc's for csv-mode because map! is currently unable
to set which-key descriptions mode-locally, and should be avoided for
anything but global keybinds. This will be fixed when General is
introduced into Doom.
2018-09-09 09:58:20 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
fa4b7502c2
lang/cc: add +cc/imenu command
Plus minor reformatting of autoloads file
2018-08-04 13:44:55 +02:00
Henrik Lissner
31c8c0c033
lang/cc: rewrite C/C++/OBJC header file detection 2018-08-03 03:41:31 +02:00
Henrik Lissner
3c52c36c2f
lang/cc: general refactor
For idempotence and to group dependencies so certain sub-packages (like
irony's) aren't loaded if irony is disabled.
2018-06-05 02:29:44 +02:00
Henrik Lissner
09cb4f6716
Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the
generated doom-package-autoload-file when running make autoloads), many
:commands properties are redundant. In fact, many def-package! blocks
are redundant.

In some cases, we can do without a config.el file entirely, and can move
into the autoloads file or rely entirely on package autoloads.

Also, many settings have been moved in their module's autoloads files,
which makes them available ASAP; their use no longer depends on module
load order.

This gained me a modest ~10% boost in startup speed.
2018-05-25 00:46:16 +02:00
Henrik Lissner
4ee0b5ba6d
New macros file-exists-p! & project-file-exists-p!
The latter replaces the doom-project-has! macro
2018-05-24 21:15:17 +02:00
Henrik Lissner
158c853e63
lang/cc: don't complain about missing rtags executable 2018-05-09 12:17:26 +02:00
Henrik Lissner
fa3f627f44
lang/cc: fontify constants only in c/c++ buffers 2018-04-21 21:04:55 -04:00
Henrik Lissner
28adf5825f
lang/cc: fix rtags in other c*-mode derived modes; fix cleanup hook
Also fixed rtags cleanup in doom-cleanup-hook to only kill the server if
there are no more C/C++ buffers open.
2018-03-01 13:47:27 -05:00
Henrik Lissner
5fc4ed3f81
lang/cc: rewrite & polish style settings
Doom used to have its own cc-mode style, which was difficult to
customize without first undoing all its changes.

A doom entry has been added to c-style-alist, which represents
a marriage of various styles (mostly linux), plus some context-sensitive
indentation functions which I think are reasonable.

More importantly, it can be disabled by changing c-default-style.

Also, removed a few hacks that have been merged into v5.33+ of cc-mode.
25.1 users beware! You may not have these changes.
2018-02-23 04:51:20 -05:00
Henrik Lissner
b43743d565
lang/cc: fix smartparens not autopairing/skipping <>
Also removed +cc/autoclose->-maybe -- let smartparens handle this.
2018-02-14 05:40:37 -05:00
Henrik Lissner
dd7a26352b
lang/cc: remove unused arg in +cc/reload-compile-db
Appeases the byte-compiler (praise be!)
2018-01-05 13:16:56 -05:00
Henrik Lissner
b331acb46b
lang/cc: rename +cc-{include-paths,compiler-options} #305 2017-12-27 17:10:28 -05:00
Henrik Lissner
e833a16e04
lang/cc: +cc/reload-compile-commands => +cc/reload-compile-db #305 2017-12-27 00:11:09 -05:00
Henrik Lissner
869a85a46b
lang/cc: new command +cc/reload-compile-commands #305 2017-12-26 23:44:58 -05:00
Henrik Lissner
ad013e96dd
Fix malformed include path bug for c++-mode
Include paths were incorrectly escaped, causing -I options to be
ignored.
2017-09-20 03:10:00 +02:00
Henrik Lissner
b288f34f4e
lang/cc: rewrite init of irony-mode & compiler options 2017-09-19 05:06:50 +02:00
Henrik Lissner
570b093ac4
lang/cc: general config refactor
+ Auto-add the nearest include/ folder to compiler header search path.
+ Remove unneeded fontification hooks (now covered by
  modern-cpp-font-lock).
+ Enable C++11 support by default
2017-09-17 22:01:08 +02:00
Henrik Lissner
52d0dffba4
Restore missing c++ lineup-arglist advice 2017-08-04 22:48:06 +02:00
Henrik Lissner
c7254e7bdc
Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00
Henrik Lissner
2d44ec4eb6 lang/cc: remove +cc/install (vestigial; using bootstrapper now) 2017-04-05 15:55:11 -04:00
Henrik Lissner
e14e25ecb4 Update modules/lang/* 2017-02-20 00:26:08 -05:00