emacs/var/elfeed/db/data/ad/adf6f3c9fa69249f9e448984bdaa57c8d028b786
2022-01-03 12:49:32 -06:00

1 line
1.6 KiB
Plaintext

<!-- SC_OFF --><div class="md"><p>Hello to everyone. I have a little problem, I have used Neovim Coc while learning Javascript and I want to know is if there is a way for lsp-mode to behave like Coc. For example, when typing the next in Neovim:</p> <pre><code>button.addEventListener(&quot;click&quot;, (e) =&gt; { alert(&quot;THIS IS A BUTTON!!!!&quot;); e.target.style.background = &quot;blue&quot;; }); </code></pre> <p>If I ask for completion for <a href="https://e.target"><code>e.target</code></a><code>....</code> in Coc, I get <code>style</code> option and <code>background</code>, etc. When I want to do this in lsp-mode in Emacs, I don&#39;t get any candidate.</p> <p>Another example is if I select an HTML element by putting their class or id:</p> <p><code>let test = document.querySelector(&quot;.this-is-a-class&quot;);</code></p> <p><code>let test2 = document.querySelector(&quot;#this-is-an-id&quot;);</code></p> <p>when I ask for property completion in Coc for test and test2, I get candidates corresponding to the HTML element. In lsp-mode I don&#39;t get any of these.</p> <p>I don&#39;t know if Coc works like this or if lsp-mode doesn&#39;t have this feature. Sorry but English is not my first language.</p> </div><!-- SC_ON --> &#32; submitted by &#32; <a href="https://www.reddit.com/user/poijulaino"> /u/poijulaino </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/r5xknm/configure_lspmode_to_behave_more_or_less_like/">[link]</a></span> &#32; <span><a href="https://www.reddit.com/r/emacs/comments/r5xknm/configure_lspmode_to_behave_more_or_less_like/">[comments]</a></span>