summaryrefslogtreecommitdiff
path: root/vim/.config/nvim/lsp/clangd.lua
blob: 2fd489a0843d6457779c7eb8e2b2e9f7d80eb660 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
return {
  cmd = {
    'clangd',
    -- '--clang-tidy',
    '--background-index',
    '--offset-encoding=utf-8',
    '--query-driver=/Users/scie/.platformio/packages/toolchain-xtensa-esp32/**',
    '--query-driver=/Users/scie/.platformio/packages/framework-arduinoststm32/**',
    -- '--query-driver=/Users/scie/.platformio/packages/**',
    -- '--query-driver=/opt/homebrew/Cellar/avr-gcc@9/9.4.0_1/bin/avr-gcc',
    -- '--query-driver=/opt/homebrew/Cellar/avr-gcc@9/9.4.0_1/bin/avr-g++'
  },
  filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto', 'arduino' },
  root_markers = {
    '.clangd',
    '.clang-tidy',
    '.clang-format',
    'compile_commands.json',
    'compile_flags.txt',
    'configure.ac' -- AutoTools
  },
  single_file_support = true,
  capabilities = {
    textDocument = {
      completion = {
        editsNearCursor = true,
      },
    },
    offsetEncoding = { 'utf-8', 'utf-16' },
  },
}