Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c299ac

Browse files
authored
Merge pull request #40 from sandbox-science/update/config
Refactor Syntax Highlighting Config
2 parents 9a35b28 + 30fb09e commit 4c299ac

File tree

15 files changed

+133
-34
lines changed

15 files changed

+133
-34
lines changed

.github/workflows/cpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Set up C++ environment (macOS)
4040
if: matrix.os == 'macos-latest'
4141
run: |
42-
brew install make cmake yaml-cpp
42+
brew install yaml-cpp
4343
echo 'export PATH="/usr/local/opt/gcc/bin:$PATH"' >> ~/.bash_profile
4444
source ~/.bash_profile
4545
g++ --version

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up C++ environment (macOS)
3737
if: matrix.os == 'macos-latest'
3838
run: |
39-
brew install make cmake yaml-cpp
39+
brew install yaml-cpp
4040
echo 'export PATH="/usr/local/opt/gcc/bin:$PATH"' >> ~/.bash_profile
4141
source ~/.bash_profile
4242
g++ --version

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ find_package(yaml-cpp REQUIRED CONFIG)
3232
# Add subdirectories
3333
add_subdirectory(src)
3434
add_subdirectory(tests)
35-

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
DEBUG ?= OFF
12
PROJECT = CodeAstra
23
BUILD_DIR = $(PWD)/build
34

@@ -10,7 +11,7 @@ all: install
1011
build:
1112
@echo "Building $(PROJECT)..."
1213
@mkdir -p $(BUILD_DIR)
13-
@cd $(BUILD_DIR) && cmake $(CMAKE_OPTIONS)
14+
@cd $(BUILD_DIR) && cmake $(CMAKE_OPTIONS) -DDEBUG=$(DEBUG)
1415

1516
clean:
1617
@echo "Cleaning the build directory..."
@@ -36,4 +37,4 @@ test: build_tests
3637

3738
run:
3839
@echo "Running $(PROJECT)..."
39-
@./build/bin/$(PROJECT)
40+
@./build/bin/$(PROJECT)

include/SyntaxManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class SyntaxManager
2828
* @return A unique pointer to the appropriate syntax highlighter, or nullptr if not available.
2929
*/
3030
static std::unique_ptr<QSyntaxHighlighter> createSyntaxHighlighter(const QString &extension, QTextDocument *doc);
31+
static void initializeUserSyntaxConfig();
3132

3233
private:
3334
static std::unique_ptr<QSyntaxHighlighter> createHighlighter(QTextDocument *doc, const std::vector<YAML::Node> &config, const QString &extension);

resources.qrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22
<qresource prefix="/">
33
<file>resources/app_icon.png</file>
44
<file>resources/themes/dark.qss</file>
5+
<file>resources/syntax/cxx.syntax.yaml</file>
6+
<file>resources/syntax/python.syntax.yaml</file>
7+
<file>resources/syntax/go.syntax.yaml</file>
8+
<file>resources/syntax/tsx.syntax.yaml</file>
9+
<file>resources/syntax/yaml.syntax.yaml</file>
10+
<file>resources/syntax/markdown.syntax.yaml</file>
511
</qresource>
612
</RCC>

config/cxx.syntax.yaml renamed to resources/syntax/cxx.syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ keywords:
2222
color: "#FFDE00" # Yellow
2323

2424
number:
25-
- regex: "\\b\\d+\\b"
25+
- regex: "\\b(0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+|\\d+(\\.\\d+)?)\\b"
2626
color: "#0000FF" # Blue
2727

2828
parenthesis:

config/go.syntax.yaml renamed to resources/syntax/go.syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ keywords:
1010
color: "#E37100" # Orange
1111

1212
number:
13-
- regex: "\\b\\d+\\b"
13+
- regex: "\\b(0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+|\\d+(\\.\\d+)?)\\b"
1414
color: "#0000FF" # Blue
File renamed without changes.

config/python.syntax.yaml renamed to resources/syntax/python.syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ keywords:
2020
color: "#E37100" # Orange
2121

2222
number:
23-
- regex: "\\b\\d+\\b"
23+
- regex: "\\b(0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+|\\d+(\\.\\d+)?)\\b"
2424
color: "#0000FF" # Blue

0 commit comments

Comments
 (0)