Skip to content
GitLab
Menu
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
969afc2b
Commit
969afc2b
authored
May 06, 2021
by
Mark Nauwelaerts
Browse files
lspclient: consider language semantics in function parentheses auto-completion
parent
dd06221f
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientcompletion.cpp
View file @
969afc2b
...
...
@@ -339,13 +339,15 @@ public:
// This is a function
const
auto
&
m
=
m_matches
.
at
(
index
.
row
());
if
(
isFunctionKind
(
m
.
kind
))
{
// add parentheses if function and guestimated meaningful for language in question
bool
addParens
=
isFunctionKind
(
m
.
kind
)
&&
m_triggersSignature
.
contains
(
QLatin1Char
(
'('
));
if
(
addParens
)
{
matching
+=
QStringLiteral
(
"()"
);
}
view
->
document
()
->
replaceText
(
word
,
matching
);
if
(
isFunctionKind
(
m
.
kind
)
)
{
if
(
addParens
)
{
// place the cursor in between (|)
view
->
setCursorPosition
({
view
->
cursorPosition
().
line
(),
view
->
cursorPosition
().
column
()
-
1
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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