Closed raymond-w-ko closed 1 year ago
LGTM! Great work!
I can't push to your branch, please resolve the conflict and I'll merge it soon.
There is still one bug I'm working on, so let me see if I can fix it:
(defun add () |
)(EOF)
I had to rewrite portions to deal with pairs inside strings, so I'm not 100% as I haven't used it for my work. However, it should be ready to merge.
One thing that has frustrated me greatly is that Copilot cannot balance parentheses et al, even when using VSCode + the official plugin, which is the golden standard. Since I program in Clojure for work, this is maddening as you have to these fix missing or extra char pairs. Almost all lisp editors run into issues once in this unbalanced state.
Thankfully, the brokenness follows a pattern where I think it is only the suffix portion that is mismatched, meaning it can be algorithmically fixed. I attempt to do so here.
There are other two changes:
clojure
as that is the only official language ID.save-excursion
is in the outer loop andsave-restriction
is inside, as recommended by the docs. I also eliminated multiple calls as a micro-optimization.