Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support code sections within structured text documents (Markdown, etc) #469

Open
grwlf opened this issue Sep 14, 2023 · 0 comments
Open

Comments

@grwlf
Copy link

grwlf commented Sep 14, 2023

Hi. I would like to use LSC for navigating in code sections of structured text documents like LaTeX, Markdown, etc. Consider a Latex example:

\begin{pythoncode}
import numpy as np
import tensorflow
\end{pythoncode}

Some arbitrary text between code sections

\begin{pythoncode}
print(np.sin(3.14))
\end{pythoncode} 

Following #260 I was able to register Python language server for whole .tex document by calling

call RegisterLanguageServer('tex', {'command': 'pylsp',  'languageId':'python' })

There are a number of drawbacks though: First, this enables only one language per tex-file (here - Python), second and the most important, the LSC probably sends the whole .tex to the language server so one would consider himself lucky if it is able to parse the Python snippets out of it. It would be much better to pass only the related code sections to the server.

If implemented, this feature would be a good match with the "offline" Jupyter-like VIM plugin called Litrepl I am currently working on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant