-
Notifications
You must be signed in to change notification settings - Fork 199
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
Use eglot-lsp-abiding-column #397
Conversation
Indeed this makes a lot of sense, I don't know what I was thinking. But also please double-, nay, triple-, nay quadruple-check that the code is exactly the same. And wouldn't it be great to add some tests, too? :-) |
I will look into tests! I've checked a couple of times already, but yeah, will do again :) |
The thing is you will need a server, probably Also see #361. This will help us make these functions the default. |
Thanks for the tip!
I'll check it out |
233435a
to
11ffcb9
Compare
Hello! First:
I started wondering if the second case here is a bug in eglot, since |
11ffcb9
to
dd3ea56
Compare
It might be the clangd version that travis offers. Maybe you can conditionalize the test further to check on the clagnd version and/or explore Travis's documentation to get an updated clangd installed. I have the |
I might have read your message too diagonally. Let me ask you something:
|
Another question, are you running the check via |
I’ll check, however, the should clause is successful, so clangd returns column 71, as it should.
Yes, the test passes locally, though I run it interactively through Emacs. I’ll check if make returns different stuff. I read Travis output, and some of my earlier tests returned the correct response from server. As a side note, if I hard code in column 74 to the eglot-move then I get the end of buffer error. I guess forward-char is the culprit |
c26564d
to
905820e
Compare
@joaotavora Right now It just skips the test. Any ideas? Should I try to make test pass on clangd-7? I don't know whether there are any breaking changes between them |
No. Make travis skip the test on a version check, if possible. Don't make heroic changes to Eventually travis will be upgraded to use clangd-8 or sth like that. Now you just have to clean up the commits and submit again for review. Maybe make two separate commits, one for the code cleanup another that adds tests. |
And thanks for all this great work! |
* eglot.el (eglot-move-to-lsp-abiding-column): use already existing function to refer to lsp-abiding-column
* eglot-tests.el: (eglot-lsp-abiding-column): add test to check for utf-16 non-ascii characters and character offset.
905820e
to
f41259e
Compare
Done I'm not sure if this answers anything regarding #361, but I can confirm on my end that these functions at least work out of the box for clangd-8.
My pleasure - I'm just having fun :) |
@theothornhill, I know this PR had many iterations, but can you, please, change the test to use |
* eglot-tests.el: (eglot-lsp-abiding-column): add test to check for utf-16 non-ascii characters and character offset.
f41259e
to
374f100
Compare
No worries, done. However, reading docs for
It may not be an important thing, but just found it interesting anyhow. I changed it to |
@nemethf Seems like it is mentioned here: #125 (comment) |
Damn. I always make this mistake to not wait for the test results. I'll investigate. |
Thank you. I'm OK with this PR now. However, it seems you need your copyright paperwork finished before it's possible the merge the PR.
That's a question for a separate issue, I guess. But since the file uses looking-back which doesn't have a -p variant, I'm not so sure about the change. (In the meantime, I reverted the column-function change in the master branch.) |
On it :) |
Hello! I saw that 1.6 was released, and the lsp-abiding-column thing was part of that. Is this test still wanted? I also see the algorithm is changed a bit, as per the #361 discussion. I haven't been able to follow up on this for a while (sorry for that) :( |
Tests are always wanted. Let me check if it passes with clangd-9 and/or travis. Thanks. |
Co-authored-by: João Távora <[email protected]> * eglot-tests.el: (eglot-lsp-abiding-column): add test to check for utf-16 non-ascii characters and character offset.
I rebased your stuff and am about to push it. The test seems a bit brittle (it uses a bleeding edge |
I was wrong. It does have |
Co-authored-by: João Távora <[email protected]> * eglot-tests.el: (eglot-lsp-abiding-column): add test to check for utf-16 non-ascii characters and character offset.
Co-authored-by: João Távora <[email protected]> * eglot.el (eglot-move-to-lsp-abiding-column): use already existing function to refer to lsp-abiding-column
Co-authored-by: João Távora <[email protected]> * eglot.el (eglot-move-to-lsp-abiding-column): use already existing function to refer to lsp-abiding-column
Co-authored-by: João Távora <[email protected]> * eglot.el (eglot-move-to-lsp-abiding-column): use already existing function to refer to lsp-abiding-column #397: joaotavora/eglot#397
Co-authored-by: João Távora <[email protected]> * eglot.el (eglot-move-to-lsp-abiding-column): use already existing function to refer to lsp-abiding-column GitHub-reference: close joaotavora/eglot#397
I noticed you use the same calculation in two spots - maybe it would be better for refactorability later if it only resided in one place?