Open aavanian opened 7 months ago
Can you confirm that this patch works with older org versions? If yes, are you willing to provide a PR?
I can confirm it works with org 9.6.7.
As for the PR, I researched a bit and there's three possible ways to rewrite it:
(elem (org-element-context))
((&plist :begin :end :post-blank :language)
(--mapcat `(,it ,(org-element-property it elem)) '(:begin :end :post-blank :language)))
dash.el
somewhere in lsp-mode.el
(defun dash-expand:&oelem (key source)
"Generate extracting KEY from SOURCE for &oelem (org-element) destructuring."
`(org-element-property ,key ,source))
in place of the offending line
((&oelem :begin :end :post-blank :language) (org-element-context))
as for the next line, nothing to do as that property doesn't reside in an org-element
anyway.
The third seems cleanest but you may want a different name (as far as I understand dash, it needs to remain in the form dash-expand:&...
). I'll make a PR once I know your pref and testing it again.
Any updates on this? I recently updated to org 9.6.24, and semantic highlighting in imenu is broken. I don't know if it is the same issue, but as far as I was able to figure, this seems the closest related issue.
I don't think yours is the same issue as this one as I'm pretty sure org-element
api changes are 9.7+ only. As far as the above is concerned, I'm waiting for a member to tell me which fix style they prefer to send a PR
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
lsp-org
breaks withorg 9.7-pre
(not released yet).The issue is that in
9.7
org stops exposing some properties from org elements (see this comment in ORG-NEWS).At least one of the issues is https://github.com/emacs-lsp/lsp-mode/blob/2da66b3dabce4925f4c03a1243fe702d8c2f7a93/lsp-mode.el#L9490
I can make it work by replacing the offending line with (apologies for the quick'n'dirty non-idiomatic code):
As far as I tested, this seems enough. The next line still works though changing it to use
org-element-property
might future-proof it as well.Steps to reproduce
test.org
With point in the source block, invoke
lsp-org
leads toprogn: Wrong type argument: integer-or-marker-p, nil
.Expected behavior
Initialization of lsp
Which Language Server did you use?
lsp-pyright
OS
MacOS
Error callstack
No response
Anything else?
No response