-
-
Notifications
You must be signed in to change notification settings - Fork 217
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 paredit in the signature provider to find correct symbol #450
Conversation
in forwardSexp() and backwardSexp(). Closes #410.
I truly like that you go for the structural way. However, |
This can surely be done with the |
By the way what is the advantage of the |
I like paredit as such. 😄 What I am objecting to is Our own paredit is built with our own I'll see if I have the time to try modify this PR to use our own stuff instead. If not, we'll merge it and fix that later, as you suggest. |
Okay I understand. gg |
OK. So here is a version using docmirror+LispTokenCursor: 77e5a97 Unless I have misunderstood something, it is equivalent to the paredit.js version. I actually think the TokenCursor API is pretty sweet, at least for this task. When doing this I noticed one more advantage with the docmirror approach: It avoids building a new AST every time the symbol is fetched. There is a big risk that I have misunderstood something though, so therefore I am first pushing this in its own branch, so that you can have a look before I update this PR. |
WIll have to figure out cropping it. But later.
For that reason I only builded the AST for the current toplevel form in my approach. But nevertheless your version looks very clean. I will take a look and integrate it. Thanks. |
I'll push my changes and then it is ready to merge, I'd say. |
…/BetterThanTomorrow/calva into wip/sinature-handler-use-paredit
Your code is not doing, what it is supposed to to. Wait - I take a look at this. |
Too late. 😄 At least I haven't merged the PR yet. |
This |
I am handle this over to you now - I do not have the time to rework the whole thing. The idea is to find the correct symbol regardless in which place you are in a form.
|
Add LispTokenCursor method for searching backwards for a specific list type
I take a look at that tomorrow. Thanks. |
Tomorrow is such a long time away, so I added two more things to the signature help:
It looks like so: I also made the |
Now using token-cursor instead of regexps.
Now the bugs reported in calva-dev should be fixed. They were about:
As far as I can tell, this should be good to go. |
Am I missing something? The |
Does the VSIX work for you? |
No the signature help will not pop up. |
How odd. Could it be a Windows thing... |
The VSIX does not work on WSL either. Now trying native linux... |
On native linux the code works. Very strange... |
Works on my Windows in Virtual Box... Is it the same project you use when it works and when it doesn't? |
It's not a Windows problem. It is a data problem. I have test data here where it is not working. |
Cool. Are you on it now? Otherwise I'd like that data. 😄 |
The code does not work for me after a '(comment ...)` and under some circumstances in that comment form. It works for the first form in the comment. |
Here is some code which confuses the code:
|
Works for me with that test data. |
On my systems it is not working. Sadly... |
So this is a Windows problem after all. At least related. Setting the line ending of the file in VS Code to |
We were getting the wrong mapping between offset and rowCol on Windows
Windows/CRLF issue should be fixed now. Now the only case where I know the wrong argument is marked as active is in thread-first macros, such as |
Now this looks good to me. Very nice feature indeed! |
What has Changed?
info
call to use paredit and to retrieve the symbol from the containing( )
list.'junk'
and'punk'
inforwardSexp()
andbackwardSexp()
.Fixes #410
My Calva PR Checklist
I have:
dev
branch. (Or have specific reasons to target some other branch.)master
. (Sorry for the nagging.)ci/circleci: build
test. (For now you'll need to opt in to the CircleCI New Experience UI to see the Artifacts tab, because bug.)[Unreleased]
entry inCHANGELOG.md
, linking the issue(s) that the PR is addressing.The Calva Team PR Checklist:
Before merging we (at least one of us) have:
dev
branch (unless reasons).Ping @PEZ, @kstehn, @bpringe