ui: Extracted syntax highlighting rules for java and cpp to files

* pass file language from storage to code view
* load syntax highlighting rules files from install directory "syntax_highlighting_rules"
* files must be named <language_identifier>.rules to make syntax highlighting work
This commit is contained in:
Eberhard Graether
2018-12-16 22:59:07 +01:00
parent a45dcb8a01
commit 1dabbab599
22 changed files with 586 additions and 180 deletions
@@ -832,7 +832,7 @@ void SqliteIndexStorage::setNodeType(int type, Id nodeId)
std::shared_ptr<SourceLocationFile> SqliteIndexStorage::getSourceLocationsForFile(
const FilePath& filePath, const std::string& query) const
{
std::shared_ptr<SourceLocationFile> ret = std::make_shared<SourceLocationFile>(filePath, true, false, false);
std::shared_ptr<SourceLocationFile> ret = std::make_shared<SourceLocationFile>(filePath, L"", true, false, false);
const StorageFile file = getFileByPath(filePath.wstr());
if (file.id == 0) // early out
@@ -840,6 +840,7 @@ std::shared_ptr<SourceLocationFile> SqliteIndexStorage::getSourceLocationsForFil
return ret;
}
ret->setLanguage(file.languageIdentifier);
ret->setIsComplete(file.complete);
ret->setIsIndexed(file.indexed);