Skip to content

Commit

Permalink
Added support for Ruby syntax + image
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed Dec 7, 2021
1 parent e80ac6b commit ded2d34
Show file tree
Hide file tree
Showing 21 changed files with 48,860 additions and 42,787 deletions.
7 changes: 6 additions & 1 deletion CodeLite/fileextmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

#include "fileextmanager.h"
#include "JSON.h"
#include "fileextmanager.h"
#include "fileutils.h"
#include <wx/filename.h>
#include <wx/regex.h>
Expand Down Expand Up @@ -171,13 +171,17 @@ void FileExtManager::Init()
m_map["patch"] = TypePatch;
m_map["diff"] = TypeDiff;

m_map["rb"] = TypeRuby;

// Initialize regexes:
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/bin/bash", TypeShellScript));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/bin/bash", TypeShellScript));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/usr/bin/sh", TypeShellScript));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/usr/bin/bash", TypeShellScript));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/bin/python", TypePython));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/usr/bin/python", TypePython));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/bin/ruby", TypeRuby));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/usr/bin/ruby", TypeRuby));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/bin/node", TypeJS));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/usr/bin/node", TypeJS));
m_matchers.push_back(Matcher("#[ \t]*![ \t]*/bin/nodejs", TypeJS));
Expand All @@ -186,6 +190,7 @@ void FileExtManager::Init()
m_matchers.push_back(Matcher("<?php", TypePhp, false));
m_matchers.push_back(Matcher("#!/usr/bin/env node", TypeJS, false));
m_matchers.push_back(Matcher("#!/usr/bin/env nodejs", TypeJS, false));
m_matchers.push_back(Matcher("#!/usr/bin/env ruby", TypeRuby, false));
m_matchers.push_back(Matcher("#!/usr/bin/env python", TypePython, false));
m_matchers.push_back(Matcher("#!/usr/bin/env python3", TypePython, false));
m_matchers.push_back(Matcher("SQLite format 3", TypeDatabase, false));
Expand Down
1 change: 1 addition & 0 deletions CodeLite/fileextmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class WXDLLIMPEXP_CL FileExtManager
TypeFolderSymlinkExpanded, // For UI purposes only
TypeLua,
TypeRust,
TypeRuby,
TypeDiff,
TypePatch,
TypeJSON,
Expand Down
13 changes: 9 additions & 4 deletions Plugin/EclipseThemeImporterBase.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "EclipseThemeImporterBase.h"
#include "ColoursAndFontsManager.h"
#include "EclipseThemeImporterBase.h"
#include "cl_standard_paths.h"
#include "drawingutils.h"
#include "globals.h"
Expand Down Expand Up @@ -75,6 +75,8 @@ LexerConf::Ptr_t EclipseThemeImporterBase::InitializeImport(const wxFileName& ec
return NULL;
if(!GetProperty("keyword", m_keyword))
return NULL;

// Optional
if(!GetProperty("class", m_klass)) {
m_klass = m_foreground;
}
Expand All @@ -84,15 +86,18 @@ LexerConf::Ptr_t EclipseThemeImporterBase::InitializeImport(const wxFileName& ec
if(!GetProperty("javadoc", m_javadoc)) {
m_javadoc = m_multiLineComment;
}

if(!GetProperty("javadocKeyword", m_javadocKeyword)) {
m_javadocKeyword = m_multiLineComment;
}
if(!GetProperty("method", m_function)) {
m_function = m_foreground;
}

m_oper = m_foreground;
if(!GetProperty("field", m_field)) {
m_field = m_foreground;
}
if(!GetProperty("enum", m_enum)) {
m_enum = m_foreground;
}
return lexer;
}

Expand Down
2 changes: 2 additions & 0 deletions Plugin/EclipseThemeImporterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class WXDLLIMPEXP_SDK EclipseThemeImporterBase
Property m_javadoc;
Property m_javadocKeyword;
Property m_function;
Property m_field;
Property m_enum;
wxString m_langName;

protected:
Expand Down
2 changes: 2 additions & 0 deletions Plugin/EclipseThemeImporterManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "EclipseJsonThemeImporter.hpp"
#include "EclipseRustThemeImporter.h"
#endif
#include "EclipseRubyThemeImporter.hpp"
#include "EclipseSCSSThemeImporter.h"
#include "EclipseSQLThemeImporter.h"
#include "EclipseScriptThemeImporter.h"
Expand Down Expand Up @@ -57,6 +58,7 @@ EclipseThemeImporterManager::EclipseThemeImporterManager()
m_importers.push_back(new EclipseSCSSThemeImporter());
m_importers.push_back(new EclipseDockerfileThemeImporter());
m_importers.push_back(new EclipseYAMLThemeImporter());
m_importers.push_back(new EclipseRubyThemeImporter());
#if wxCHECK_VERSION(3, 1, 0)
m_importers.push_back(new EclipseRustThemeImporter());
m_importers.push_back(new EclipseJsonThemeImporter());
Expand Down
Binary file modified Runtime/codelite-bitmaps-dark.zip
Binary file not shown.
Binary file modified Runtime/codelite-bitmaps-light.zip
Binary file not shown.
Loading

0 comments on commit ded2d34

Please sign in to comment.