reddit / emacs

make eglot (flymake) not complain about cuda syntax

RepublicWorried · 2022-11-11 11:03
Emacs 29 with built-in eglot + flymake support complains about lines like this one ​ const uint32\_t idx = blockIdx.x \* blockDim.x + threadIdx.x; since it does not know about the default build-in vars of cuda. ​ Is there a way to make either eglot recognize those or make flymake ignore them? My config related to eglot reads like this (with-eval-after-load 'eglot (add-to-list 'eglot-server-programs '((c-mode c++-mode cuda-mode) . ("clangd-15" "-j=8" "--log=error" "--malloc-trim" "--background-index" "--clang-tidy" "--cross-file-rename" "--completion-style=detailed" "--pch-storage=memory" "--header-insertion=never" "--header-insertion-decorators=0"))))
aaronemassey · 2022-11-11 13:34
This has less to do with eglot and more to do with clangd. I recommend looking into how to configure cuda with clangd. Something like: https://stackoverflow.com/questions/68806350/how-to-use-clangd-text-highlighting-with-cuda-on-header-files Eglot and lsp-mode for that matter largely just talk to language servers which do all the heavy lifting for syntactic and semantic IDE checking.