arakashic / chromatica.nvim

Clang based syntax highlighting for Neovim
MIT License
299 stars 17 forks source link

Chromatica crashes when opening header file with compile_commands.json present #80

Closed ahellqui closed 3 years ago

ahellqui commented 4 years ago

Chromatica crashes with the message:

Chromatica has fallback to neovim default (no semantic highlight) for current buffer. Check :ChromaticaShowInfo for the error message.

When opening any header file in a project with a compile_commands.json file.

When running :ChromaticaShowInfo I get the following text:

[chromatica] libclang file: /usr/lib/libclang.so
[chromatica] Filename: /home/andreas/Programming/C++/Programfiler/Egna_program/TicTacToeV2/src/betterCi
n.h
[chromatica] Filetype: cpp
[chromatica] Using compile args file: /home/andreas/Programming/C++/Programfiler/Egna_program/TicTacToe
V2/compile_commands.json
[chromatica]     : -isystem/usr/lib/clang/9.0.1/include
[chromatica]     : /usr/bin/c++
[chromatica]     : --driver-mode=g++
[chromatica]     : -x
[chromatica] .clang File Search Path:
[chromatica] Error Message: clang.cindex.TranslationUnitLoadError(Error parsing translation unit.)

Opening the header files without the compile_commands.json file in the project works.

Shatur commented 4 years ago

I have the same issue.

Minimal reproducible project: akd Steps to reproduce:

  1. Clone repo.
  2. Open src/keyboarddaemon.h. Syntax hyhlighting works (but the highlighting is not good).
  3. Go to the project dir and execute (to generate compile_commands.json):
    mkdir build && cd build && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. && cp compile_commands.json ..
  4. Open src/keyboarddaemon.h again.
ahellqui commented 3 years ago

I'll close this since chromatica is no longer in development.