D19286: Add unit test for definitionsForFileName() and definitionsForMimeType()

2019-02-28 Thread David Schulz
davschul added a comment.


  cool thanks :)

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D19286

To: dhaumann, cullmann, davschul, vkrause
Cc: kwrite-devel, kde-frameworks-devel, domson, michaelh, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D19215: Install DefinitionDownloader header

2019-02-21 Thread David Schulz
davschul created this revision.
davschul added reviewers: cullmann, vkrause.
davschul added a project: Framework: Syntax Highlighting.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
davschul requested review of this revision.

REVISION SUMMARY
  Makes it possible to use the exported definition downloader from an installed
  syntax highlighting engine.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D19215

AFFECTED FILES
  src/lib/CMakeLists.txt

To: davschul, cullmann, vkrause
Cc: kwrite-devel, kde-frameworks-devel, bmortimer, michaelh, genethomas, 
ngraham, bruns, demsking, cullmann, vkrause, sars, dhaumann


D19200: Return sorted definitions for file names and mime types

2019-02-21 Thread David Schulz
davschul updated this revision to Diff 52268.
davschul added a comment.


  Yeah, I just missed to recheck the sorting logic. Before the change we just 
needed the best match so the partial sort was completely sufficient. Now we 
need a complete sorted vector, so stable sort is the way to go ;)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D19200?vs=52207=52268

REVISION DETAIL
  https://phabricator.kde.org/D19200

AFFECTED FILES
  src/lib/repository.cpp
  src/lib/repository.h

To: davschul, cullmann, vkrause
Cc: dhaumann, kwrite-devel, kde-frameworks-devel, bmortimer, michaelh, 
genethomas, ngraham, bruns, demsking, cullmann, vkrause, sars


D19200: Return sorted definitions for file names and mime types

2019-02-21 Thread David Schulz
davschul added a comment.


  Ah sorry completely missed that part. Unfortunately I'm out of office 
already, I'll take a look as soon as I'm back tomorrow.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D19200

To: davschul, cullmann, vkrause
Cc: kwrite-devel, kde-frameworks-devel, bmortimer, michaelh, genethomas, 
ngraham, bruns, demsking, cullmann, vkrause, sars, dhaumann


D18997: Add functions returning all definitions for a mimetype or file name

2019-02-21 Thread David Schulz
davschul added a comment.


  Created https://phabricator.kde.org/D19200
  That should implement all the latest suggestions/comments

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18997

To: davschul, vkrause, cullmann
Cc: dhaumann, cullmann, kwrite-devel, kde-frameworks-devel, bmortimer, 
michaelh, genethomas, ngraham, bruns, demsking, vkrause, sars


D19200: Return sorted definitions for file names and mime types

2019-02-21 Thread David Schulz
davschul created this revision.
davschul added reviewers: cullmann, vkrause.
davschul added a project: Framework: Syntax Highlighting.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
davschul requested review of this revision.

REVISION SUMMARY
  Sort definitions by priority before returning them.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D19200

AFFECTED FILES
  src/lib/repository.cpp
  src/lib/repository.h

To: davschul, cullmann, vkrause
Cc: kwrite-devel, kde-frameworks-devel, bmortimer, michaelh, genethomas, 
ngraham, bruns, demsking, cullmann, vkrause, sars, dhaumann


D18996: Fix building with namespaced Qt

2019-02-21 Thread David Schulz
davschul added a comment.


  Okay I've tested it with 3.12.2 and there were no issues.
  I'm not familiar enough with cmake to tell whether there is a simpler version 
for what I try to achieve here. I just need the -D QT_NAMESPACE compiler 
options. Is there someone in the community who might know how to make it in a 
more elegant way.
  If not I do not need that target_link_libraries part in Qt Creator, because 
we still only support building via qmake or qbs. It was just to be complete 
here. So it could be removed without breaking our use case, but it would break 
namespace builds for any one else.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18996

To: davschul, vkrause
Cc: cullmann, kwrite-devel, kde-frameworks-devel, bmortimer, michaelh, 
genethomas, ngraham, bruns, demsking, vkrause, sars, dhaumann


D18997: Add functions returning all definitions for a mimetype or file name

2019-02-14 Thread David Schulz
davschul added a comment.


  Nice respond times here, and thanks for the reviews :)

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18997

To: davschul, vkrause, cullmann
Cc: cullmann, kwrite-devel, kde-frameworks-devel, gennad, bmortimer, michaelh, 
genethomas, ngraham, bruns, demsking, vkrause, sars, dhaumann


D18997: Add functions returning all definitions for a mimetype or file name

2019-02-14 Thread David Schulz
davschul updated this revision to Diff 51649.

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D18997?vs=51645=51649

REVISION DETAIL
  https://phabricator.kde.org/D18997

AFFECTED FILES
  src/lib/repository.cpp
  src/lib/repository.h

To: davschul, vkrause, cullmann
Cc: cullmann, kwrite-devel, kde-frameworks-devel, gennad, bmortimer, michaelh, 
genethomas, ngraham, bruns, demsking, vkrause, sars, dhaumann


D18998: update literate haskell mimetype

2019-02-14 Thread David Schulz
davschul added a comment.


  see 
https://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in?h=Release-1-12#n6074

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18998

To: davschul, vkrause, cullmann
Cc: kwrite-devel, kde-frameworks-devel, gennad, michaelh, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D18998: update literate haskell mimetype

2019-02-14 Thread David Schulz
davschul created this revision.
davschul added reviewers: vkrause, cullmann.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
davschul requested review of this revision.

REVISION SUMMARY
  According to the freedesktop mimetypes literate haskell uses it's own mimetype
  with the name text/x-literate-haskell

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18998

AFFECTED FILES
  data/syntax/literate-haskell.xml

To: davschul, vkrause, cullmann
Cc: kwrite-devel, kde-frameworks-devel, gennad, michaelh, ngraham, bruns, 
demsking, cullmann, sars, dhaumann


D18997: Add functions returning all definitions for a mimetype or file name

2019-02-13 Thread David Schulz
davschul created this revision.
davschul added a reviewer: vkrause.
davschul added a project: Framework: Syntax Highlighting.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
davschul requested review of this revision.

REVISION SUMMARY
  This can be used to show UI controls to let the user decide which definition 
should be used
  for a specific file.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18997

AFFECTED FILES
  src/lib/repository.cpp
  src/lib/repository.h

To: davschul, vkrause
Cc: kwrite-devel, kde-frameworks-devel, gennad, bmortimer, michaelh, 
genethomas, ngraham, bruns, demsking, cullmann, vkrause, sars, dhaumann


D18982: prevent assertion in regex load

2019-02-13 Thread David Schulz
davschul added a comment.


  David Schulz david.sch...@qt.io

REVISION DETAIL
  https://phabricator.kde.org/D18982

To: davschul, vkrause, cullmann
Cc: cullmann, dhaumann, kwrite-devel, kde-frameworks-devel, gennad, michaelh, 
ngraham, bruns, demsking, sars


D18996: Fix building with namespaced Qt

2019-02-13 Thread David Schulz
davschul added inline comments.

INLINE COMMENTS

> CMakeLists.txt:62
>  set_property(TARGET SyntaxHighlightingData PROPERTY 
> POSITION_INDEPENDENT_CODE 1)
> +target_link_libraries(SyntaxHighlightingData PRIVATE Qt5::Core)

This seems like an overkill, but I'm new to CMAKE and it seems that this was 
the only way to get the -DQT_NAMESPACE= option added to the compiler command 
for the qrc_syntax-data.cpp and qrc_theme-data.cpp. Is there a simpler solution 
to achieve this?

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18996

To: davschul, vkrause
Cc: kwrite-devel, kde-frameworks-devel, gennad, bmortimer, michaelh, 
genethomas, ngraham, bruns, demsking, cullmann, vkrause, sars, dhaumann


D18996: Fix building with namespaced Qt

2019-02-13 Thread David Schulz
davschul created this revision.
davschul added a reviewer: vkrause.
davschul added a project: Framework: Syntax Highlighting.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
davschul requested review of this revision.

REVISION SUMMARY
  Add QT_BEGIN/END_NAMESPACE to forward declaration of Qt classes and 
  add namespace define to compiler commands for qrc_*.cpp files

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18996

AFFECTED FILES
  data/CMakeLists.txt
  src/lib/abstracthighlighter.h
  src/lib/abstracthighlighter_p.h
  src/lib/context_p.h
  src/lib/definition.h
  src/lib/foldingregion.h
  src/lib/format.h
  src/lib/htmlhighlighter.h
  src/lib/keywordlist_p.h
  src/lib/repository.h
  src/lib/repository_p.h
  src/lib/rule_p.h
  src/lib/state.h
  src/lib/theme.h
  src/lib/themedata_p.h
  src/lib/wildcardmatcher.cpp
  src/lib/wildcardmatcher_p.h

To: davschul, vkrause
Cc: kwrite-devel, kde-frameworks-devel, gennad, bmortimer, michaelh, 
genethomas, ngraham, bruns, demsking, cullmann, vkrause, sars, dhaumann


D18982: prevent assertion in regex load

2019-02-13 Thread David Schulz
davschul updated this revision to Diff 51643.
davschul added a comment.


  added additional context to the diff

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D18982?vs=51588=51643

REVISION DETAIL
  https://phabricator.kde.org/D18982

AFFECTED FILES
  src/lib/rule.cpp

To: davschul, vkrause
Cc: dhaumann, kwrite-devel, kde-frameworks-devel, gennad, michaelh, ngraham, 
bruns, demsking, cullmann, sars


D18982: prevent assertion in regex load

2019-02-13 Thread David Schulz
davschul added inline comments.

INLINE COMMENTS

> dhaumann wrote in rule.cpp:579-582
> I even wonder whether this should be always printed, i.e.:
> 
>   const bool isValid = m_regexp.isValid();
>   if (!isValid)
>   qCWarning(...) << "Invalid regexp:" << m_regexp.pattern();
>   }
>   return isValid && !m_regexp.pattern().isEmpty();

Unconditionally running the isValid check is to expensive. At least according 
to the comment above the code, but I'haven't checked this statement.

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18982

To: davschul, vkrause
Cc: dhaumann, kwrite-devel, kde-frameworks-devel, gennad, michaelh, ngraham, 
bruns, demsking, cullmann, sars


D18982: prevent assertion in regex load

2019-02-13 Thread David Schulz
davschul created this revision.
davschul added a reviewer: vkrause.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
davschul requested review of this revision.

REVISION SUMMARY
  Instead of crashing the complete application with an assert on a malformed
  regex use the logging category to inform users when such a regex is found.
  This way the check can also be enabled for release builds, and don't have to
  run unnecessarily for debug builds

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D18982

AFFECTED FILES
  src/lib/rule.cpp

To: davschul, vkrause
Cc: kwrite-devel, kde-frameworks-devel, gennad, michaelh, ngraham, bruns, 
demsking, cullmann, sars, dhaumann