Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
901 stars 98 forks source link

irony-cdb-json/irony-server: Caches last used compilation database #499

Closed itollefsen closed 5 years ago

itollefsen commented 5 years ago

A compilation database can be very large and take a long time to read and parse, which happens quite frequently (when opening a file for instance).

This caches the last read/parsed compilation database based on its filename and last modification time.

This could be extended to cache N number of databases instead of just one, which would be useful when working on multiple projects simultaneously.

itollefsen commented 5 years ago

I read the feedback and then forgot all about it. It's been a busy winter.

Anyway, I've now tried to incorporate the changes you requested. Including splitting the cache class from the Irony class and putting it in its own translation unit(s).

As for other formats - yes, I had completely forgotten about them. Now remedied. Although I think it would be a good (future) improvement to add support for caching more formats (it currently only caches results for JSON compilation databases, as you noted).

Sarcasm commented 5 years ago

Thank you for your patience and for the change itself, which is quite useful!