Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
f2d3ba9b
Commit
f2d3ba9b
authored
Dec 28, 2021
by
Jan Blackquill
🌈
Committed by
Christoph Cullmann
Dec 28, 2021
Browse files
LSP: don't hardcode diagnostics colours
parent
44627769
Pipeline
#115405
passed with stage
in 3 minutes and 5 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientpluginview.cpp
View file @
f2d3ba9b
...
...
@@ -1084,6 +1084,8 @@ public:
KTextEditor
::
MarkInterfaceV2
*
iface
=
qobject_cast
<
KTextEditor
::
MarkInterfaceV2
*>
(
doc
);
Q_ASSERT
(
iface
);
KTextEditor
::
View
*
activeView
=
m_mainWindow
->
activeView
();
using
Style
=
KSyntaxHighlighting
::
Theme
::
TextStyle
;
const
auto
theme
=
activeView
->
theme
();
KTextEditor
::
ConfigInterface
*
ciface
=
qobject_cast
<
KTextEditor
::
ConfigInterface
*>
(
activeView
);
// only consider enabled items
...
...
@@ -1130,24 +1132,30 @@ public:
enabled
=
true
;
break
;
// use underlining for diagnostics to avoid lots of fancy flickering
case
RangeData
::
KindEnum
::
Error
:
case
RangeData
::
KindEnum
::
Error
:
{
markType
=
RangeData
::
markTypeDiagError
;
const
auto
color
=
theme
.
textColor
(
Style
::
Error
);
attr
->
setUnderlineStyle
(
QTextCharFormat
::
SpellCheckUnderline
);
attr
->
setUnderlineColor
(
Qt
::
red
);
attr
->
setUnderlineColor
(
color
);
break
;
case
RangeData
::
KindEnum
::
Warning
:
}
case
RangeData
::
KindEnum
::
Warning
:
{
markType
=
RangeData
::
markTypeDiagWarning
;
const
auto
color
=
theme
.
textColor
(
Style
::
Warning
);
attr
->
setUnderlineStyle
(
QTextCharFormat
::
SpellCheckUnderline
);
attr
->
setUnderlineColor
(
QC
olor
(
255
,
128
,
0
)
);
attr
->
setUnderlineColor
(
c
olor
);
break
;
}
case
RangeData
::
KindEnum
::
Information
:
case
RangeData
::
KindEnum
::
Hint
:
case
RangeData
::
KindEnum
::
Related
:
case
RangeData
::
KindEnum
::
Related
:
{
markType
=
RangeData
::
markTypeDiagOther
;
const
auto
color
=
theme
.
textColor
(
Style
::
Information
);
attr
->
setUnderlineStyle
(
QTextCharFormat
::
DashUnderline
);
attr
->
setUnderlineColor
(
Qt
::
blue
);
attr
->
setUnderlineColor
(
color
);
break
;
}
}
if
(
activeView
)
{
attr
->
setForeground
(
activeView
->
defaultStyleAttribute
(
KTextEditor
::
dsNormal
)
->
foreground
());
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment