<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>LSP guides on Mergeway</title><link>https://mergewayhq.github.io/docs/how-to/lsp/</link><description>Recent content in LSP guides on Mergeway</description><generator>Hugo</generator><language>en</language><atom:link href="https://mergewayhq.github.io/docs/how-to/lsp/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure Neovim</title><link>https://mergewayhq.github.io/docs/how-to/lsp/neovim/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://mergewayhq.github.io/docs/how-to/lsp/neovim/</guid><description>&lt;h1 id="configure-neovim"&gt;Configure Neovim&lt;a class="anchor" href="#configure-neovim"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;This setup uses Neovim&amp;rsquo;s built-in LSP client. It starts one &lt;code&gt;mergeway-lsp&lt;/code&gt; process for files below the nearest directory containing &lt;code&gt;mergeway.yaml&lt;/code&gt; or &lt;code&gt;mergeway.yml&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites&lt;a class="anchor" href="#prerequisites"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;code&gt;mergeway-lsp&lt;/code&gt; and confirm &lt;code&gt;vim.fn.exepath(&amp;quot;mergeway-lsp&amp;quot;)&lt;/code&gt; is non-empty.&lt;/li&gt;
&lt;li&gt;Use a Neovim release that provides &lt;code&gt;vim.lsp.start&lt;/code&gt; and &lt;code&gt;vim.fs.root&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Open the repository directory, not an individual unrelated file.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="add-the-client-configuration"&gt;Add the client configuration&lt;a class="anchor" href="#add-the-client-configuration"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Put this in &lt;code&gt;init.lua&lt;/code&gt; or a sourced Lua module:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-lua" data-lang="lua"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vim.api.nvim_create_autocmd(&lt;span style="color:#e6db74"&gt;&amp;#34;FileType&amp;#34;&lt;/span&gt;, {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; pattern &lt;span style="color:#f92672"&gt;=&lt;/span&gt; { &lt;span style="color:#e6db74"&gt;&amp;#34;yaml&amp;#34;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;json&amp;#34;&lt;/span&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; callback &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt;(args)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;local&lt;/span&gt; root &lt;span style="color:#f92672"&gt;=&lt;/span&gt; vim.fs.root(args.buf, { &lt;span style="color:#e6db74"&gt;&amp;#34;mergeway.yaml&amp;#34;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#34;mergeway.yml&amp;#34;&lt;/span&gt; })
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; &lt;span style="color:#f92672"&gt;not&lt;/span&gt; root &lt;span style="color:#66d9ef"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; vim.lsp.start({
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; name &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;mergeway-lsp&amp;#34;&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; cmd &lt;span style="color:#f92672"&gt;=&lt;/span&gt; { &lt;span style="color:#e6db74"&gt;&amp;#34;mergeway-lsp&amp;#34;&lt;/span&gt; },
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; root_dir &lt;span style="color:#f92672"&gt;=&lt;/span&gt; root,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; })
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;end&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Restart Neovim and open a configured data file such as &lt;code&gt;data/users/alice.yaml&lt;/code&gt;. Run &lt;code&gt;:LspInfo&lt;/code&gt;; the attached client should be named &lt;code&gt;mergeway-lsp&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Configure a generic LSP client</title><link>https://mergewayhq.github.io/docs/how-to/lsp/generic-client/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://mergewayhq.github.io/docs/how-to/lsp/generic-client/</guid><description>&lt;h1 id="configure-a-generic-lsp-client"&gt;Configure a generic LSP client&lt;a class="anchor" href="#configure-a-generic-lsp-client"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Use these settings in any client that can launch a Language Server Protocol process. Setting names differ by client; the values are the portable contract.&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Client setting&lt;/th&gt;
 &lt;th&gt;Value&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Command&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;mergeway-lsp&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Arguments&lt;/td&gt;
 &lt;td&gt;none, or logging flags only&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Transport&lt;/td&gt;
 &lt;td&gt;stdio with standard LSP &lt;code&gt;Content-Length&lt;/code&gt; framing&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;File types&lt;/td&gt;
 &lt;td&gt;YAML and JSON files used by the repository&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Root markers&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;mergeway.yaml&lt;/code&gt;, &lt;code&gt;mergeway.yml&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Initialization root&lt;/td&gt;
 &lt;td&gt;the directory containing the root marker&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Synchronization&lt;/td&gt;
 &lt;td&gt;full document, with open and close notifications&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Configure the client to send a &lt;code&gt;file://&lt;/code&gt; URI in &lt;code&gt;rootUri&lt;/code&gt;, or send one or more file-URI entries in &lt;code&gt;workspaceFolders&lt;/code&gt;. When &lt;code&gt;workspaceFolders&lt;/code&gt; is non-empty it is authoritative and &lt;code&gt;rootUri&lt;/code&gt;/legacy &lt;code&gt;rootPath&lt;/code&gt; are ignored. The server checks each supplied directory directly; the client must find the marker rather than expecting the server to search parent directories.&lt;/p&gt;</description></item><item><title>Capture LSP debug logs</title><link>https://mergewayhq.github.io/docs/how-to/lsp/debug-logs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://mergewayhq.github.io/docs/how-to/lsp/debug-logs/</guid><description>&lt;h1 id="capture-lsp-debug-logs"&gt;Capture LSP debug logs&lt;a class="anchor" href="#capture-lsp-debug-logs"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Prefer a log file because an editor may hide its child process&amp;rsquo;s standard error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mergeway-lsp --log-file /tmp/mergeway-lsp.log --log-level debug&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Configure those two arguments in the client launcher, reproduce the problem, and inspect the file. Existing content is retained because the server opens the file in append mode. The log can contain absolute paths and error details; review it before sharing and remove it when finished.&lt;/p&gt;
&lt;p&gt;For a client that exposes child stderr, use:&lt;/p&gt;</description></item><item><title>Troubleshoot diagnostics and navigation</title><link>https://mergewayhq.github.io/docs/how-to/lsp/troubleshoot/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://mergewayhq.github.io/docs/how-to/lsp/troubleshoot/</guid><description>&lt;h1 id="troubleshoot-diagnostics-and-navigation"&gt;Troubleshoot diagnostics and navigation&lt;a class="anchor" href="#troubleshoot-diagnostics-and-navigation"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id="the-server-does-not-start"&gt;The server does not start&lt;a class="anchor" href="#the-server-does-not-start"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Run &lt;code&gt;mergeway-lsp --help&lt;/code&gt; in the same environment as the editor and confirm the executable is found. Then enable a &lt;a href="../debug-logs/"&gt;debug log&lt;/a&gt;. If the log path cannot be opened or the level is invalid, startup fails before protocol initialization.&lt;/p&gt;
&lt;h2 id="the-client-attaches-but-reports-nothing"&gt;The client attaches but reports nothing&lt;a class="anchor" href="#the-client-attaches-but-reports-nothing"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Inspect the client&amp;rsquo;s initialization data. Each &lt;code&gt;rootUri&lt;/code&gt; or &lt;code&gt;workspaceFolders&lt;/code&gt; entry must be the exact repository directory containing &lt;code&gt;mergeway.yaml&lt;/code&gt; or &lt;code&gt;mergeway.yml&lt;/code&gt;; the server does not walk upward. Dynamic &lt;code&gt;workspace/didChangeWorkspaceFolders&lt;/code&gt; notifications are not supported, so restart the client after adding or removing folders.&lt;/p&gt;</description></item></channel></rss>