chromatica.nvim
chromatica.nvim copied to clipboard
Chromatica works poorly with Solarized Color Scheme
Hi! I've tried to setup Chromatica with my vim-colors-solarized colorscheme setup and noticed major issues:
- Default colors are overriden
- Similar syntax constructions are colored differently (see includes for the reference)
- Some code becomes not colored at all (see
struct Line
members)
Here is my nvim config, I only added two lines where appropriate:
Plug 'arakashic/chromatica.nvim'
and
let g:chromatica#libclang_path = '/usr/lib/libclang.so'
I also attached the screenshot. Left pane: colorscheme solarized
enabled, chromatica enabled, middle pane: colorscheme solarized
disabled, chromatica enabled, right pane: colorscheme solarized
enabled, chromatica disabled.
Can you post the output of running ChromaticaShowInfo
and the chromatica.log
generated after running ChromaticaEnableLog
.
From the first look of you screenshot, I think Chromatica may not correctly parsed your code (since using namespace std;
is not correctly highlighted).
Ah, okay, yes there is a syntax error indeed (missing ';' after struct).
:ChromaticaShowInfo
:
[chromatica] libclang file: /usr/lib/libclang.so
[chromatica] Filename: /home/omtcvxyz/dev/contests/D.cpp
[chromatica] Filetype: cpp
[chromatica] .clang file: None
[chromatica] Compilation Database:
[chromatica] Compile Flags: -std=c++14
[chromatica] .clang File Search Path:
Error detected while processing function chromatica#show_info:
line 3:
error caught in request handler 'chromatica_show_info [{'bufnr': 1, 'filename': '/home/omtcvxyz/dev/contests/D.cpp', 'changedtick': 3, 'position': [1, 1], 'highlight_tick': 0, 'range': [1, 70]}]':
Traceback (most recent call last):
File "/home/omtcvxyz/.local/share/nvim/plugged/chromatica.nvim/rplugin/python3/chromatica/__init__.py", line 73, in show_info
self.__chromatica.show_info(context)
File "/home/omtcvxyz/.local/share/nvim/plugged/chromatica.nvim/rplugin/python3/chromatica/chromatica.py", line 284, in show_info
if "error" in self.ctx[filename]:
KeyError: '/home/omtcvxyz/dev/contests/D.cpp'
Log: chromatica.log
Given that it did not compile, I was expecting Chromatica to still work (since Clang is able to parse the code and suggest two modifications making it valid anyway, there are few other tools like include-fixer which operate on broken TU). However, there are other examples which seem strange to me:
So, this one compiles just fine using the compile commands specified somewhere (verified using :ChromaticaShowInfo
). However, there still are some things looking pretty weird:
- Member functions of
const clang::DiagnosticInfo
are highlighted in theif
condition, but not anywhere else -
llvm::raw_svector_stream OS(Location)
->raw_svector_stream OS(LOcation)
get colored, but similar constructs don't -
prepareCompilerInstance
is colored the same way function argument names from previous functions (member functions, though)
I'm not an experienced Chromatica user, but this seems like some inconsistency.
Is it okay for you to upload this D.cpp
? I would like to try to reproduce the problem on my side. The exception in :ChromaticaShowInfo
is unexpected.
@arakashic Yes, sure. That was a bit messy (because that's a code from a Codeforces contest problem solution) so I decided to omit it in the Issue.
I have fixed one compilation error, but I don't remember which one. I tried to find it in my screenshot (which shows the whole source file) but was unable to find it quickly enough.
https://pastebin.com/v857RGr1
Thanks. I can reproduce the problem now. I will figure out what went wrong.