<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ruslan&#39;s Tech Blog</title>
    <link>https://blog.bekenev.net/tags/emacs-php.html</link>
    <description>Software development related stuff</description>
    <language>en-us</language>
    <lastBuildDate>Mon, 24 Oct 2022 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.bekenev.net/tags/emacs-php/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Eglot &amp; PHP &amp; Phpactor</title>
      <link>https://blog.bekenev.net/2022/10/24/eglot_php.html</link>
      <pubDate>Mon, 24 Oct 2022 00:00:00 +0000</pubDate>
      <guid>https://blog.bekenev.net/2022/10/24/eglot_php.html</guid>
      <description>&lt;p&gt;Trying out &lt;strong&gt;eglot&lt;/strong&gt; at the moment on a php project I have and unfortunately it doesn&amp;rsquo;t work out of the box.&lt;/p&gt;&#xA;&lt;p&gt;The issue is that my PHP project is based on PHP8 and &lt;a href=&#34;https://github.com/zobo/php-language-server&#34;&gt;php-language-server&lt;/a&gt; is pretty old server&#xA;that doesn&amp;rsquo;t support new php versions.&lt;/p&gt;&#xA;&lt;p&gt;There are bunch of other LSPs for PHP and I would like to play with Phpactor which I never used before.&lt;/p&gt;&#xA;&lt;p&gt;Fortunately &lt;strong&gt;eglot&lt;/strong&gt; supports any LSP server and Phpactor has one too.&lt;/p&gt;&#xA;&lt;p&gt;To make it work just add this to your init.el:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-emacs-lisp&#34; data-lang=&#34;emacs-lisp&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;(add-to-list &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;eglot-server-programs&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#39;&lt;/span&gt;((php-mode phps-mode) &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;phpactor&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;language-server&amp;#34;&lt;/span&gt;))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make sure phpactor is in your $PATH, otherwise just specify the full path.&lt;/p&gt;&#xA;&lt;p&gt;Now you can just &lt;code&gt;M-x eglot&lt;/code&gt; in any php file and it should magically start working.&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
