Skip to content

lsp-org breaks with org 9.7-pre #4300

@aavanian

Description

@aavanian

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

lsp-org breaks with org 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

((&plist :begin :end :post-blank :language) (cl-second (org-element-context)))

I can make it work by replacing the offending line with (apologies for the quick'n'dirty non-idiomatic code):

              (elem (org-element-context))
              (begin (org-element-property :begin elem))
              (end (org-element-property :end elem))
              (post-blank (org-element-property :post-blank elem))
              (language (org-element-property :language elem))

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

#+begin_src python :tangle "test.py"
print("hello")
#+end_src

With point in the source block, invoke lsp-org leads to progn: 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

EDIT: Fixed link to relevant emacs doc with permalink since the ORG-NEWS file has changed a lot since issue was opened

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions