doc-lsp
doc-lsp is a simple specification and LSP (Language Server) that loads comments from a separate file.
Document variables in a separate markdown file and this LSP will show the docs on your editor.
Standard
Assuming a file named settings.py
SERVER = "localhost"
PORT = 4545
Or a config.conf
max_open_windows true
font_size 18
Then the LSP will lookup information about each variable on a separate file.
settings.py.md
## SERVER
> This variable defines which server the system is connected to,
> when used together with port this will define the connection string.
> example: `hostname:port`
## PORT
> Port used to connect ot server
config.conf.md
## max_open_windows
> This variable is used to set how many multiple tiles can be opened
> at the same time.
## font_size = 18
> Set the default size for the system font.
Usage
With the LSP Server doc-lsp enabled on your editor,
having the variable selected or with cursor focus, trigger the action view_doc
and the editor will show the overlay with the full text from the respective comment file.
| = mouse cursor position
SERV|ER = "foo"
Hovering the mouse over the variable will show the documentation.
SERV|ER = "foo"
_________________________________________________________________________
| SERVER |
| This variable defines which server the system is connected to, |
| when used together with port this will define the connection string. |
| example: `hostname:port` |
_________________________________________________________________________
If the settings.py.md does not exist, then the action will be NOOP and just emit a INFO Doc not found for variable.
Implementation
- The doc-lsp is implemented in Python
- It is designed to run from
uv - It will cache the documentation for each variable, so if the file is not changed, the documentation will be read from the cache, it can use
workspace/didChangeWatchedFilesto invalidate the cache.
Specs
- doc-lsp is filetype agnostic
- doc-lsp lookup will match
filename.ext->filename.ext.md - Lookup is made from the doc-lsp parser
- The last occurence wins in case of duplication
See ./examples
Release files for doc-lsp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| doc_lsp-0.1.0.tar.gz | 54.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| doc_lsp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 75.8 kB
Release files / doc_lsp-0.1.0.tar.gz
| Download URL | doc_lsp-0.1.0.tar.gz |
|---|---|
| Size | 54.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b32c7bc2e50eb5fad2a9fae01bc571dc46156f50e212ab28e0380783f1973bbe
|
|
BLAKE2b-256 checksum How to use checksums |
22b1941837261a57a24a278ece61efa93b3e76af389ba6ac2b8d55264f863843
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Release files / doc_lsp-0.1.0-py3-none-any.whl
| Download URL | doc_lsp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
abd07a1a8ce6a1e0484780eedab01b592b399c2ac6e543bfc7b4905775474e4a
|
|
BLAKE2b-256 checksum How to use checksums |
0f1e7ebccc6e2227df5fc12dca2dc07800671b677761aca1a611cbef48376faf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|