Skip to content

feat: use KSyntaxHighlighting and rewrite the code editor with vim mode#516

Closed
coder3101 wants to merge 84 commits intomasterfrom
ksyntax-highlighting
Closed

feat: use KSyntaxHighlighting and rewrite the code editor with vim mode#516
coder3101 wants to merge 84 commits intomasterfrom
ksyntax-highlighting

Conversation

@coder3101
Copy link
Copy Markdown
Member

@coder3101 coder3101 commented Jul 22, 2020

Use Kate's Syntax highlighter engine for Code Highlighting.

Description

QCodeEditor uses very basic RegEx based matching to highlight code. This has many issues and they are listed in related issues section in the side.

ECM and Syntax highlighting builds and links to a shared library.

Related Issue

Fixes #174 and Fixes #210 and Fixes #533 and Fixed #372 and Fixes #393 and Fixes #413

Motivation and Context

To make syntax highlighting more better.

How Has This Been Tested?

Tested on Windows 10

Screenshots (if appropriate)

image

Type of changes

  • Bug fix (changes which fix an issue)
  • New feature (changes which add functionality)
  • Documentation (changes which modify the documentation only)
  • Style change (changes which do not affect the meaning of the code: code formatting, etc.)
  • Refactor (changes which affect the meaning of the code but neither fix a bug nor add a feature)
  • Performance improve (changes which improve performance)
  • Test (changes which add tests)
  • Build (Changes that affect the build system or external dependencies)
  • CI (changes to CI configuration files and scripts)
  • Chore (changes which do not belong to any type above)
  • Revert (revert previous changes)

Checklist

  • I have read the CONTRIBUTING document.
  • I have tested these changes locally, and this fixes the bug/the new feature behaves as the expectation.
  • The settings file in the old version can be used in the new version after this change.
  • These changes only fix a single bug/introduces a single feature. (Otherwise, open multiple Pull Requests instead, unless these bugs/features are closely related.)
  • The commit messages are clear and detailed. (Otherwise, use git reset and commit again, or use git rebase -i and git commit --amend to modify the commit messages.)
  • These changes don't remove an existing feature. (Otherwise, add an option to disable this feature instead, unless it's necessary to remove this feature.)
  • If there are changes of the text displayed in the UI, I have wrapped them in tr() or QCoreApplication::translate().
  • I have documented these changes in CHANGELOG.md, or these changes are not notable.

Extra Checklist

coder3101 and others added 2 commits July 22, 2020 08:46
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@pull-assistant
Copy link
Copy Markdown

pull-assistant bot commented Jul 22, 2020

Score: 1.00

Best reviewed: commit by commit


Optimal code review plan (14 warnings, 4 commits squashed)

Add KSyntaxHighlighter for code highlighting

tools/genSettings.py 50% changes removed in refactor: move Util/...

src/Util/QCodeEditorUtil.cpp 92% changes removed in Merge branch 'ksynta...

src/Settings/settings.json 75% changes removed in refactor: move Util/...

src/mainwindow.cpp 90% changes removed in refactor: use CodeEd...

...ithub/workflows/build_test.yml 53% changes removed in ci: use cache for KD...

.github/workflows/release.yml 75% changes removed in ci(release): remove ...

src/Util/QCodeEditorUtil.hpp 43% changes removed in refactor: use CodeEd...

CMakeLists.txt 50% changes removed in refactor: move Util/...

style: Format codes (#514)

src/Util/QCodeEditorUtil.cpp 60% changes removed in refactor: use CodeEd...

     Add ECM and KSH as submodules

     Update build_test.yml

Update release.yml

...ithub/workflows/build_test.yml 73% changes removed in ci: remove cache for...

.github/workflows/release.yml 75% changes removed in ci(release): update ...

     Merge branch 'master' into ksyntax-highlighting

     Update release.yml

Update Translatation

translations/zh_CN.ts 88% changes removed in Reset Translation fi...

     Update translation from Arch

     Unset executable flag filemode for scripts

Merge branch 'ksynta... ... Reset Translation fi...

Squashed 2 commits:

feat: update translations

translations/zh_CN.ts 50% changes removed in feat: add codes from...

     refactor: give execute permission to scripts in git instead of CI

fix: use %NUMBER_OF_PROCESSORS% on Windows

.ci/win/install_ecm.bat 50% changes removed in ci: fix Windows rele...

.ci/win/install_ksh.bat 50% changes removed in ci: fix Windows rele...

refactor: move ksyntaxhighlight scripts to tools

.github/workflows/release.yml 50% changes removed in ci(release): update ...

     refactor: make Singleton::repository private

ci: -D KF5SyntaxHighlighting_DIR on Windows

...ithub/workflows/build_test.yml 42% changes removed in ci: use cache for KD...

     Fix CMake Argument Syntax

     Try CMake Warning fix

     ci: use environment variable for KF5SyntaxHighlighting_DIR

     ci: use cache for KDE syntax highlighting

refactor: move Util/Singleton to Core/KSyntaxHighlightingRepository

src/Util/QCodeEditorUtil.cpp 80% changes removed in Merge branch 'ksynta...

CMakeLists.txt 50% changes removed in refactor: CodeEditor...

...ntaxHighlightingRepository.cpp 67% changes removed in refactor: CodeEditor...

...ntaxHighlightingRepository.hpp 50% changes removed in refactor: CodeEditor...

     ci: remove cache for KDE syntax-highlighting on Unix

     ci: no show progress when downloading

     ci(release): update ksyntaxhighlight

     ci: no verbose when extracting files

     ci: add ECM in cache key

     ci: fix Windows release

     ci(release): remove useless separated build

refactor: use CodeEditor to replace QCodeEditorUtil and bundle the hig...

.../Extensions/ClangFormatter.cpp 50% changes removed in refactor: move Widge...

src/Widgets/CodeEditor.cpp 72% changes removed in Merge branch 'ksynta...

feat: auto detect default syntax highlight theme

src/Widgets/CodeEditor.cpp 95% changes removed in Merge branch 'ksynta...

src/Settings/settings.json 50% changes removed in refactor: CodeEditor...

fix(Settings): fix the tooltip of Editor Theme

translations/zh_CN.ts 50% changes removed in feat: add codes from...

     refactor: move Widgets/CodeEditor to CodeEditor/CodeEditor

     Remove QCodeEditor dependency

     Merge branch 'ksyntax-highlighting' of https://github.com/cpeditor/cpe...

     refactor: remove QCodeEditor and make everything able to be built

     refactor(CodeEditor): use SettingsHelper

     refactor(CodeEditor): use EventLogger instead of QDebug

feat(CodeEditor): use KSH theme

src/CodeEditor/CodeEditor.cpp 50% changes removed in refactor: CodeEditor...

     Merge branch 'ksyntax-highlighting' of https://github.com/cpeditor/cpe...

     refactor: CodeEditor, Settings and File names

fix: Themes for Lint... ... style: Format codes ...

Squashed 2 commits:

     feat: add codes from the KSH example

     fix: highlight occurrences and parentheses when the theme changes

Merge branch 'master' into ksyntax-highlighting

doc/CHANGELOG.md 44% changes removed in merge master

     Merge branch 'master' into ksyntax-highlighting

     merge master

Powered by Pull Assistant. Last update 2a83da7 ... 3335236. Read the comment docs.

coder3101 and others added 3 commits July 22, 2020 09:29
Update EditorTheme.cpp

Update appwindow.hpp

Properly set dependency

Add Install Scripts for dependency

Set +x for scripts before running

Fix YAML Error

Make windows release type

Use ninja build system

Add to Windows System

Test with Ninja

Use default system for ECM and KSH
@coder3101 coder3101 force-pushed the ksyntax-highlighting branch from 752aef0 to 1c6f7bb Compare July 22, 2020 06:02
@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 22, 2020

I ran updateTranslation.sh and still CI says translations not upto date

You should compile before running that script, otherwise auto-generated files are not up-to-date.

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 22, 2020

Are you sure getSyntaxHighlightingRepository/all singletons should be in Util?

@coder3101
Copy link
Copy Markdown
Member Author

Are you sure getSyntaxHighlightingRepository/all singletons should be in Util?

Core could be better place for Singletons.

@ouuan ouuan force-pushed the ksyntax-highlighting branch from 4cb73ee to 8614590 Compare July 22, 2020 08:31
@ouuan ouuan force-pushed the ksyntax-highlighting branch from d9e21f0 to 88dc799 Compare July 22, 2020 08:58
@coder3101 coder3101 linked an issue Jul 14, 2021 that may be closed by this pull request
@coder3101 coder3101 mentioned this pull request Jul 31, 2021
11 tasks
@coder3101 coder3101 changed the title feat: use KSyntaxHighlighting and rewrite the code editor feat: use KSyntaxHighlighting and rewrite the code editor with vim mode Jul 31, 2021
@coder3101
Copy link
Copy Markdown
Member Author

I'm wondering how's the progress of the vim-mode pr thinking

#581, the original PR for vim mode is closed and it has been ported to this PR, This PR now has fakevim along with ksyntax highlighting.

coder3101 and others added 9 commits July 31, 2021 13:54
@coder3101 coder3101 marked this pull request as ready for review July 24, 2022 09:56
@coder3101 coder3101 marked this pull request as draft July 24, 2022 10:30
@coder3101
Copy link
Copy Markdown
Member Author

#1101 is using Kate syntax highlighting. Closing this and new PR for fakevim will be opened.

@coder3101 coder3101 closed this Jul 23, 2023
@coder3101 coder3101 mentioned this pull request Oct 31, 2023
@coder3101 coder3101 removed a link to an issue Dec 16, 2023
@coder3101 coder3101 mentioned this pull request Dec 16, 2023
5 tasks
@ouuan ouuan mentioned this pull request Feb 13, 2024
@ouuan ouuan deleted the ksyntax-highlighting branch February 17, 2024 10:53
@ouuan ouuan mentioned this pull request Feb 18, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment