aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@users.noreply.github.com>2020-04-10 12:26:03 +0200
committerGitHub <noreply@github.com>2020-04-10 12:26:03 +0200
commit960df0dbfcb540a9f610cc978b5aff70d3f7aeeb (patch)
tree36c2407b99393094eb858755d625eec65d0aa71b
parentb401cc994b75d1305db46bebb7b7795184aaf328 (diff)
downloadi3-960df0dbfcb540a9f610cc978b5aff70d3f7aeeb.tar.gz
i3-960df0dbfcb540a9f610cc978b5aff70d3f7aeeb.zip
Makefile: add bear target for using clangd/ccls language servers (#3953)
After installing clangd and/or ccls (Emacs eglot defaults to ccls), run e.g. make bear -j32 and restart your editor (or just its language server).
-rw-r--r--Makefile.am13
1 files changed, 13 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 872fdff7..089c4a22 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -629,3 +629,16 @@ CLEANFILES = \
i3-command-parser.stamp \
i3-config-parser.stamp \
anyevent-i3.stamp
+
+################################################################################
+# Language Server support
+################################################################################
+
+# Recursively run make through https://github.com/rizsotto/Bear,
+# which generates a compile_commands.json file in the source directory.
+# This is useful for running e.g. the clangd or ccls language servers:
+# https://clang.llvm.org/extra/clangd/
+# https://github.com/MaskRay/ccls/wiki
+.PHONY: bear
+bear: clean
+ bear -o $(top_srcdir)/compile_commands.json $(MAKE) $(MAKEFLAGS)