Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add lsp signature help #1755
Add lsp signature help #1755
Changes from 17 commits
cd27422
0ff483a
f23eb9d
bfdde32
f4e9bd3
576c3d1
f62bf95
a13b762
f1de34c
0a4b5b2
9a1e5d5
70a8525
b0b13be
d84e18a
2df1b74
9bee76f
61098ba
3b26143
b675243
d80dce7
91e58aa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't look closely on this. Does this also work with double width characters like CJK? This seemed to be characters length after looking at the code (wasn't mentioned in the comment whether it is character length or terminal width length) and we don't seemed to be checking the width of
required_size
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sudormrfbin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should if the intent is to use byte length, or do we need to use
string.width()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This actually turned out to be a bug, see #3154.)
Syntax highlighting uses
charbyte offsets so that is what we need as the final(start, end)
value. Now, LSP sends the label offsets in utf-16according to the configured, so we would have to convert this toOffsetEncoding
(but we have it hardcoded to utf8) and the same is used by the LSP forParameterLabel::LabelOffsets
charbyte offsets:str.find()
reports the byte index of the start of the pattern, so that would have to be changed too.But strangely, with a naive test on a bit of CJK and non ASCII text, the parameter highlighting seems to work okay:
Details