File: lsp-org.md

package info (click to toggle)
lsp-mode 9.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,472 kB
  • sloc: lisp: 27,961; makefile: 62; java: 34; cpp: 33; javascript: 31; xml: 23; python: 14; sh: 2
file content (53 lines) | stat: -rw-r--r-- 1,717 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
root_file: docs/manual-language-docs/lsp-org.md
---
# Literate programming using LSP and org-mode(alpha)
`lsp-mode` provides **experimental** support for running the language servers
inside of [org-mode](https://orgmode.org/) source blocks. `lsp-mode` is
achieving this by obtaining the information about the source block from the
source block header(language + `:tangle`) then translating the point to the LSP
positions back and forth so the language server thinks that Emacs has opened the
original file. In order that to work the files has to be present on the disk as
well because the server expects to find them.

Here it is a sample source block:

``` org
#+BEGIN_SRC python :tangle "python.py"
print "Hello!"
#+END_SRC
```

## Demo
![Demo](../../examples/org-mode.gif )

## Commands
* `lsp-org` start `lsp-mode` in source buffer. Must be executed with cursor
  being source block.
* `lsp-virtual-buffer-disconnect` turn off `lsp-mode`.

## What works
* `lsp-mode` core features (finding references, going to definitions, completion, lenses, highlighting, etc)
* `company-mode`
* `flycheck`
* `lsp-treemacs-symbols`
* `lsp-treemacs-errors-list`

## Known limitations
* Incremental updates are performed by sending the whole
  buffer each time(they simulate full updates).
* Deleting content that spans across the source block and the content of the org
  document is not handled.
* Opening and editing the actual file from the disk might cause undefined
  behaviour because the server expects file to be open only once.

## What does not work
* `dap-mode`
* `lsp-ui`
* `flymake`(?)

## What's next
- Finishing the virtual buffers `API`.
- `lsp-ui` support
- `dap-mode` support
- `markdown-mode` integration