Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
3eb8481e
Commit
3eb8481e
authored
Dec 17, 2021
by
Mark Nauwelaerts
Browse files
doc: extend lspclient documentation
parent
bb2a139b
Pipeline
#111599
passed with stage
in 4 minutes and 7 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
doc/kate/plugins.docbook
View file @
3eb8481e
...
...
@@ -2602,6 +2602,49 @@ are obviously more efficient, and they also have a 'wider' view than
the view of many separate instances.
</para>
<para>
As mentioned above, several entries are subject to variable expansion.
A suitable application of that combined with "wrapper script" approaches
allows for customization to a great many circumstances.
For example, consider a python development scenario that consists of multiple
projects (e.g. git repos), each with its own virtualenv setup. Using the default
configuration, the python language server will not be aware of the virtual env.
However, that can be remedied with the following approach. First, the following
fragment can be entered in LSPClient plugin's "User Server Settings":
</para>
<screen>
{
"servers":
{
"python":
{
"command": ["pylsp_in_env"], ["%{Project:NativePath}"],
"root": "."
}
}
}
</screen>
<para>
The root entry above is relative to the project directory and ensures that a
a separate language server is started for each project, which is necessary in
this case as each has a distinct virtual environment.
</para>
<para>
<filename>pylsp_in_env</filename> is a small "wrapper script" that should be placed
in <literal>PATH</literal> with following (to-be-adjusted) content:
</para>
<screen>
#!/bin/bash
cd $1
# run the server (python-lsp-server) within the virtualenv
# (i.e. with virtualenv variables setup)
# so source the virtualenv
source XYZ
# server mileage or arguments may vary
exec myserver
</screen>
<sect3 id="lspclient-customization">
<title>LSP Server Configuration</title>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment