<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?]]></title><description><![CDATA[<p dir="auto">Microsoft Language Server Protocol (LSP) defines the protocol used between an editor or IDE and a language server that provides language features like autocomplete, go to definition, find all references etc.:</p>
<p dir="auto"><a href="https://microsoft.github.io/language-server-protocol/" rel="nofollow ugc">https://microsoft.github.io/language-server-protocol/</a></p>
<p dir="auto">Some cool editors are already making use of it, completely transforming the original editor being used for the communication with LSP:</p>
<p dir="auto"><a href="https://microsoft.github.io/language-server-protocol/implementors/tools/" rel="nofollow ugc">https://microsoft.github.io/language-server-protocol/implementors/tools/</a></p>
<p dir="auto">I think that compatibility with LSP would give Notepad++ a huge boost towards acting as an IDE. Given any programming language, it could be possible for example to check for syntax errors in real-time, look for definitions, get some info through mouse hovering on a variable, etc. All of this into Notepad++. Here are some of the LSP-based existent projects, with the supported programming languages:</p>
<p dir="auto"><a href="https://microsoft.github.io/language-server-protocol/implementors/servers/" rel="nofollow ugc">https://microsoft.github.io/language-server-protocol/implementors/servers/</a></p>
<p dir="auto">It seems that someone is already trying to implement LSP into Notepad++ by writing a specific plugin for it:</p>
<p dir="auto"><a href="https://github.com/dail8859/NppLSP" rel="nofollow ugc">https://github.com/dail8859/NppLSP</a></p>
<p dir="auto">Someone else instead suggested to write a script in some language, for example, Python, by making use of the already existent “Python Script” plugin:</p>
<p dir="auto"><a href="https://notepad-plus-plus.org/community/topic/14736/does-npp-have-any-plans-to-support-microsoft-s-language-service-protocol/6" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/14736/does-npp-have-any-plans-to-support-microsoft-s-language-service-protocol/6</a></p>
<p dir="auto">I think think this would lend to results similar to the ones achieved by this great plugin for Python programming in Notepad++:</p>
<p dir="auto"><a href="https://github.com/bitagoras/PyPadPlusPlus" rel="nofollow ugc">https://github.com/bitagoras/PyPadPlusPlus</a></p>
<p dir="auto">So, I decided to open this thread to discuss the possible integration of Notepad++ with LSP. What do you think about it?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16859/microsoft-language-server-protocol-lsp-a-possible-revolution-for-notepad</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 03:57:32 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16859.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Jan 2019 16:29:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Mon, 20 Dec 2021 11:37:24 GMT]]></title><description><![CDATA[<p dir="auto">… but bear in mind that this is in an early alpha stage and that  there is another <a href="https://sourceforge.net/projects/kered13-notepad-plugins/files/NPP%20LSP.dll/download" rel="nofollow ugc">plugin</a> that already covers some <a href="https://community.notepad-plus-plus.org/topic/22004/seeking-for-help/32">pitfalls</a> when it comes to implementing LSP for Npp and Scintilla.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72241</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72241</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 20 Dec 2021 11:37:24 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Mon, 20 Dec 2021 10:17:32 GMT]]></title><description><![CDATA[<p dir="auto">A plugin implementing an LSP client in Notepad++ has finally been released.</p>
<p dir="auto"><a href="https://github.com/Ekopalypse/NppLspClient" rel="nofollow ugc">https://github.com/Ekopalypse/NppLspClient</a></p>
<p dir="auto">Credits to <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> for that.</p>
<p dir="auto">I encourage everyone to give it a try and report back for any found issue.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72240</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72240</guid><dc:creator><![CDATA[pidgeon777]]></dc:creator><pubDate>Mon, 20 Dec 2021 10:17:32 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 03 Dec 2020 00:18:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said in <a href="/post/60433">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">I’ll keep working on it an updates will be made available via the github repo.</p>
</blockquote>
<p dir="auto">I’ll keep checking back then - thanks!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60435</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60435</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 03 Dec 2020 00:18:42 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 03 Dec 2020 00:06:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a> - I tried to make it work but after three<br />
Npp crashes I decided to make my <a href="https://github.com/Ekopalypse/NppPythonScripts/blob/master/lspclient" rel="nofollow ugc">implementation</a> work with python3.<br />
I’ll keep working on it an updates will be made available via the github repo.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60433</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60433</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 03 Dec 2020 00:06:01 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Wed, 02 Dec 2020 15:23:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said in <a href="/post/60422">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">lspclient is written for Python2</p>
</blockquote>
<p dir="auto">Weird - it seems to “run” OK - not throwing any errors, but just not initializing with the language server:</p>
<pre><code>PS VinsWorldcom ~\source\personal\pylspclient\examples &gt; python3 .\python-language-server.py
2020-12-02 10:19:26,251 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'autopep8': No module named 'pycodestyle'

2020-12-02 10:19:26,297 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'pycodestyle': No module named 'pycodestyle'

2020-12-02 10:19:26,301 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'pydocstyle': No module named 'pydocstyle'

2020-12-02 10:19:26,492 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'rope_completion': No module named 'rope'

2020-12-02 10:19:26,496 UTC - WARNING - pyls.config.config - Failed to load pyls entry point 'rope_rename': No module named 'rope'

{'capabilities': {'codeActionProvider': True, 'codeLensProvider': {'resolveProvider': False}, 'completionProvider': {'resolveProvider': False, 'triggerCharacters': ['.']}, 'documentFormattingProvider': True, 'documentHighlightProvider': True, 'documentRangeFormattingProvider': True, 'documentSymbolProvider': True, 'definitionProvider': True, 'executeCommandProvider': {'commands': []}, 'hoverProvider': True, 'referencesProvider': True, 'renameProvider': True, 'foldingRangeProvider': True, 'signatureHelpProvider': {'triggerCharacters': ['(', ',', '=']}, 'textDocumentSync': {'change': 2, 'save': {'includeText': True}, 'openClose': True}, 'workspace': {'workspaceFolders': {'supported': True, 'changeNotifications': True}}, 'experimental': {}}}
init =  None
</code></pre>
<p dir="auto"><strong>NOTE:</strong> I made 2 small changes to the the <code>examples/python-language-server.py</code> script:</p>
<pre><code>diff --git a/examples/python-language-server.py b/examples/python-language-server.py
index 72026e5..0e67858 100644
--- a/examples/python-language-server.py
+++ b/examples/python-language-server.py
@@ -19,7 +19,7 @@ class ReadPipe(threading.Thread):
             line = self.pipe.readline().decode('utf-8')

 if __name__ == "__main__":
-    pyls_cmd = ["python", "-m", "pyls"]
+    pyls_cmd = ["python3", "-m", "pyls"]
     p = subprocess.Popen(pyls_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     read_pipe = ReadPipe(p.stderr)
     read_pipe.start()
@@ -143,7 +143,7 @@ if __name__ == "__main__":
     root_uri = 'file:///path/to/python/project'
     workspace_folders = [{'name': 'python-lsp', 'uri': root_uri}]
     print(lsp_client.initialize(p.pid, None, root_uri, None, capabilities, "off", workspace_folders))
-    print(lsp_client.initialized())
+    print("init = ", lsp_client.initialized())

     lsp_client.shutdown()
     lsp_client.exit()
</code></pre>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60424</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60424</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Wed, 02 Dec 2020 15:23:22 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Wed, 02 Dec 2020 14:14:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a></p>
<p dir="auto">It looks like the main problem might be that this lspclient is written for Python2.<br />
Let me see if I can make a working version. Probably in 6-7 hours.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60422</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60422</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Wed, 02 Dec 2020 14:14:13 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Wed, 02 Dec 2020 13:53:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a></p>
<p dir="auto">let me have a look and play with it a bit.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60418</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60418</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Wed, 02 Dec 2020 13:53:51 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Wed, 02 Dec 2020 02:39:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said in <a href="/post/59481">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">ok, this is my “lsp” script (called python_ide.py)</p>
</blockquote>
<p dir="auto">I wonder if this <a href="https://github.com/yeger00/pylspclient" rel="nofollow ugc">pylspclient</a> can be used?  It’s supposedly an LSP client written in Python so theoretically PythonScript could run it.</p>
<p dir="auto">I’ve been playing with it from the command line with my system Python3 and not having much luck with the <code>examples/python-language-server.py</code> script included and having the <a href="https://github.com/palantir/python-language-server" rel="nofollow ugc">python-language-server</a> installed.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60413</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60413</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Wed, 02 Dec 2020 02:39:53 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Fri, 06 Nov 2020 00:03:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14076">@pidgeon777</a> said in <a href="/post/37926">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">Microsoft Language Server Protocol (LSP) defines the protocol used between an editor or IDE and a language server that provides <strong>language features like autocomplete, go to definition, find all references etc.</strong>:</p>
</blockquote>
<p dir="auto"><img src="/assets/uploads/files/1604620723899-screenshot_270.png" alt="Screenshot_270.png" class=" img-fluid img-markdown" /><br />
У меня есть немного для php, js, vbs, 1C, MySql.<br />
<a href="https://github.com/trdm/jn-npp-scripts" rel="nofollow ugc">https://github.com/trdm/jn-npp-scripts</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/59492</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59492</guid><dc:creator><![CDATA[TroshinDV]]></dc:creator><pubDate>Fri, 06 Nov 2020 00:03:55 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 20:23:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a></p>
<p dir="auto">:-D - the same would happen to me if I try to write perl :-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59490</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59490</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Nov 2020 20:23:26 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 20:22:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said in <a href="/post/59488">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">preload them jedi.preload_module([‘os’,‘sys’, …])</p>
</blockquote>
<p dir="auto">Thanks for the tip!  Python is obviously not my strength; hence, the want for some “IDE-lite” help from Notepad++.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59489</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59489</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 05 Nov 2020 20:22:07 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 20:19:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a></p>
<p dir="auto">it should be slow only for the first time it discovers an object. If you use certain objects more often<br />
then others, you could try to preload them <code>jedi.preload_module(['os','sys', ...]) </code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/59488</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59488</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Nov 2020 20:19:36 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 20:17:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a></p>
<p dir="auto">Thanks - I actually got it working by copying PyFlakes, Jedi (and Parso which seemed to be a Jedi dependency) install directories from my system Python3 to the PythonScript/lib folder.</p>
<p dir="auto">Autocompletion now works for “objects”:</p>
<pre><code>import socket

addrs = socket.getaddrinfo("localhost", 12345, socket.AF_UNSPEC, socket.SOCK_DGRAM)
sock = None

for addr in addrs:
    af, socktype, proto, cname, sa = addr

    try:
        sock = socket.socket(af, socktype, proto)
[...]
</code></pre>
<p dir="auto">and then typing:</p>
<p dir="auto"><code>sock.</code> brings up a list of all methods I can call on the socket object - but it’s slow - noticeably slow in populating that autocomplete list.</p>
<p dir="auto">Pretty cool though!  I’ll do some more playing with this and thanks for the script and help setting it up.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59487</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59487</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 05 Nov 2020 20:17:27 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 20:07:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a></p>
<p dir="auto">Yes, and copy the pythonXX.dll from the installation to <code>C:\usr\bin\npp64\plugins\PythonScript</code><br />
then PS sees all your pip installed modules.<br />
In addition, check the <code>prefer installed python libraries</code> from PS configuration dialog.</p>
<p dir="auto"><img src="/assets/uploads/files/1604606789902-b83b6798-9b58-47cf-9c5c-ab5bc64325ed-image.png" alt="b83b6798-9b58-47cf-9c5c-ab5bc64325ed-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/59486</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59486</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Nov 2020 20:07:05 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 20:02:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said in <a href="/post/59483">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">which PS3 plugin did you install? Depending on it you have to use the correct python version and copy<br />
the pythonXX.dll to the PS plugin directory.</p>
</blockquote>
<p dir="auto">I installed <a href="https://github.com/bruderstein/PythonScript/releases/tag/v3.0.4" rel="nofollow ugc">v3.0.4</a> and have the DLL for python 3.8 (that was bundled with the above ZIP) already in place:</p>
<pre><code>PS VinsWorldcom C:\usr\bin\npp64\plugins\PythonScript &gt; ls -al
total 5680
drwxr-x---  1 VinsWorldcom                0 Nov  5 15:00 .\
drwxr-x---  1 VinsWorldcom                0 Nov  5 15:00 ..\
drwxr-x---  1 VinsWorldcom                0 Sep  7 07:33 doc\
drwxr-x---  1 VinsWorldcom                0 Nov  5 14:27 lib\
-rw-r----a  1 VinsWorldcom          4209224 Jul 20 16:06 python38.dll
-rw-r----a  1 VinsWorldcom          1606144 Sep  7 07:31 PythonScript.dll
drwxr-x---  1 VinsWorldcom                0 Nov  5 14:34 scripts\
</code></pre>
<p dir="auto">Am I to understand that I need to upgrade my OS Python3.6 version to match the 3.8 for PythonScript?</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59485</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59485</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 05 Nov 2020 20:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 19:56:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a></p>
<p dir="auto">Now I’m thinking that, if I remember correctly, you have to use python 3.8. PS3 started with this version.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59484</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59484</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Nov 2020 19:56:17 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 19:49:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a></p>
<p dir="auto">which PS3 plugin did you install? Depending on it you have to use the correct python version and copy<br />
the pythonXX.dll to the PS plugin directory.<br />
Like I have the latest PS, hence I use python 3.8</p>
<p dir="auto"><img src="/assets/uploads/files/1604605786283-0d58770e-7268-4d24-a723-d0f18267a42f-image.png" alt="0d58770e-7268-4d24-a723-d0f18267a42f-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/59483</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59483</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Nov 2020 19:49:50 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 19:46:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said in <a href="/post/59481">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">You need to pip-install pyflakes and jedi and use the PS3 alpha version.</p>
</blockquote>
<p dir="auto">Sorry for the following probably basic Python questions, but I’m getting this error when running my <code>startup.py</code>:</p>
<pre><code>Traceback (most recent call last):
  File "C:\usr\bin\npp64\plugins\PythonScript\scripts\startup.py", line 31, in &lt;module&gt;
    from python_ide import IDE
  File "C:\usr\bin\npp64\plugins\PythonScript\scripts\python_ide.py", line 8, in &lt;module&gt;
    from pyflakes import api
ModuleNotFoundError: No module named 'pyflakes'
</code></pre>
<p dir="auto">I’m assuming this is because PyFlakes is not installed in my PythonScript3 distro.  I did a:</p>
<p dir="auto"><code>python3 -mpip install pyflakes jedi</code></p>
<p dir="auto">and it worked to install to my OS python:</p>
<pre><code>PS VinsWorldcom C:\usr\bin\npp64\plugins\PythonScript &gt; python3 -V
Python 3.6.3
PS VinsWorldcom C:\usr\bin\npp64\plugins\PythonScript &gt; python3
Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import jedi
&gt;&gt;&gt; import pyflakes
</code></pre>
<p dir="auto">So I’m guessing I need to have PythonScript3 find my local Python3 libraries or install PyFlakes and Jedi in the PythonScript3 lib/ directory.</p>
<p dir="auto">Any tips?</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59482</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59482</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 05 Nov 2020 19:46:26 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 19:20:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a><br />
ok, this is my “lsp” script (called python_ide.py)</p>
<pre><code class="language-py">''' Basic functionality which one would expect from a full-fledged IDE '''
import sys
from Npp import (
    editor, editor1, editor2, notepad,
    SCINTILLANOTIFICATION, NOTIFICATION, LANGTYPE
    )

from pyflakes import api
from pyflakes import reporter as rep
import jedi
jedi.preload_module(['os',])


class IDE(rep.Reporter):

    def __init__(self):
        rep.Reporter.__init__(self, sys.stdout, sys.stderr)
        self.auto_indent = True
        self.check_types = False
        self.linting = True
        self.reporter = None
        self.is_python = False
        self.STYLE_WARNING = 55
        self.excluded_styles = [1, 3, 4, 6, 7, 12, 16, 17, 18, 19]
        self.prev_completion_list = []


    def initialize(self):
        editor1.styleSetFont(self.STYLE_WARNING, 'Consolas')
        editor1.styleSetItalic(self.STYLE_WARNING,True)
        editor1.styleSetFore(self.STYLE_WARNING, (200,160,12))
        editor1.styleSetBack(self.STYLE_WARNING, notepad.getEditorDefaultBackgroundColor())
        editor2.styleSetFont(self.STYLE_WARNING, 'Consolas')
        editor2.styleSetItalic(self.STYLE_WARNING,True)
        editor2.styleSetFore(self.STYLE_WARNING, (200,160,12))
        editor2.styleSetBack(self.STYLE_WARNING, notepad.getEditorDefaultBackgroundColor())
        editor.callbackSync(self.on_charadded, [SCINTILLANOTIFICATION.CHARADDED])
        editor.callbackSync(self.on_modified, [SCINTILLANOTIFICATION.MODIFIED])
        notepad.callback(self.on_buffer_activated, [NOTIFICATION.BUFFERACTIVATED])
        notepad.callback(self.on_file_saved, [NOTIFICATION.FILESAVED])
        self.is_python = notepad.getCurrentLang() == LANGTYPE.PYTHON


    def on_modified(self, args):
        if args['modificationType'] &amp; 0x100000 == 0x100000 and args['text'] in ['\r','\n', '\r\n']:
            self._indent(args['position'], args['text'])


    def on_buffer_activated(self, args):
        self.is_python = notepad.getCurrentLang() == LANGTYPE.PYTHON
        self.path = notepad.getCurrentFilename()


    def on_file_saved(self, args):
        if self.is_python:
            editor.annotationClearAll()
            self.lint()


    def on_charadded(self, args):
        if self.is_python:
            c = chr(args['ch'])
            if c in '\r\n:-+*/#=)':
                return

            pos = editor.getCurrentPos()
            if editor.getStyleAt(pos) in self.excluded_styles:
                return

            source = editor.getText() + c
            line = editor.lineFromPosition(pos) + 1
            column = editor.getColumn(pos)

            if c == '(':
                script = jedi.Script(code=source).get_signatures(line, column)
                self.show_calltip(script, pos)
            else:
                if c == '.' and editor.callTipActive():
                    editor.callTipCancel()
                script = jedi.Script(code=source).complete(line, column)
                self.autocomplete(script, pos)


    def unexpectedError(self, filename, msg):
        # HACK: to avoid encoding declaration in Unicode string error
        if msg != 'problem decoding source':
            print(f'File "{filename}", line {0}, unexpected error:{msg}')


    def syntaxError(self, filename, msg, lineno, offset, text):
        line = text.splitlines()[-1]
        if offset is not None:
            offset -= (len(text) - len(line)) + 1
        else:
            offset=''

        print(f'File "{filename}", line {lineno},{offset} Error:{msg}')
        print(f'    =&gt; {line}')
        self.show_error(filename,lineno, msg)


    def flake(self, message):
        msg = message.message % message.message_args
        for line_ignore_msg in ['# ignore_undefined_name', '# ignore_unused_import',]:
            if line_ignore_msg in editor.getLine(message.lineno-1 if message.lineno&gt;0 else message.lineno):
                return
        self.show_error(message.filename, message.lineno, msg)


    def show_error(self, filename, line_no, msg):
        line_no = line_no-1 if line_no&gt;0 else line_no
        editor.annotationSetText(line_no, f'{msg}')
        editor.annotationSetVisible(2)
        editor.annotationSetStyle(line_no, self.STYLE_WARNING)
        editor.ensureVisible(line_no)
        editor.gotoLine(line_no)
        editor.verticalCentreCaret()


    def lint(self):
        if self.linting:
            filename = notepad.getCurrentFilename()
            if filename.endswith('.py'):
                api.check(editor.getText(), filename, self)


    def autocomplete(self, completions, pos):
        if completions:
            completion_list = sorted([x.name for x in completions if not x.name.startswith('_')])
            if completion_list:
                if self.prev_completion_list != completion_list:
                    self.prev_completion_list = completion_list
                    word_start = editor.wordStartPosition(pos, True)
                    already_typed = pos - word_start
                    already_typed = 0 if already_typed &lt; 0 else already_typed
                    editor.autoCShow(already_typed, ' '.join(completion_list))


    def show_calltip(self, call_tips, pos):
        if call_tips:
            tips = ', '.join([x.name for x in call_tips[0].params])
            tips += '\n'
            if tips.strip():
                editor.callTipShow(pos, f' {tips[:-1]} ')


    def _indent(self, position, text):
        if self.is_python and self.auto_indent:
            indent = editor.getLineIndentation(editor.lineFromPosition(position))
            if (editor.getCharAt(position-1) == 58 and  # 58 == :
                editor.getStyleAt(position-1) not in self.excluded_styles):
                tabwidth = editor.getTabWidth()
                text += ' '*(indent//tabwidth+1)*tabwidth
            else:
                text += ' '*indent
            editor.changeInsertion(text)  
</code></pre>
<p dir="auto">and this is what I have in user <a href="http://startup.py" rel="nofollow ugc">startup.py</a></p>
<pre><code>from python_ide import IDE
__ide = IDE()
__ide.initialize()
</code></pre>
<p dir="auto">You need to pip-install pyflakes and jedi and use the PS3 alpha version.<br />
A word of warning, although I don’t think it will affect you.<br />
I had crashes when using this together with Npp objects.<br />
As long as you only use standard Python scripts/modules, as you mentioned,<br />
you should not have this problem.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59481</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59481</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Nov 2020 19:20:53 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 19:03:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> said in <a href="/post/59477">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">If you want to get auto completion and such stuff to work with python3 scripts in notepad++,<br />
you normally have to use PS3 plugin.</p>
</blockquote>
<p dir="auto">Yes, that’s my desire.  I’m not interested in writing Notepad++ PythonScript automation, I’m interested in using Notepad++ to write scripts in version 3 of the Python language to be used for my work projects and while writing those scripts, I’d like to have some “Language Server” features (i.e., autocomplete, etc) above and beyond the standard Notepad++ “function name completion” through the use of a Language Server “plugin” (or in this case, PS3 adapted script capability you speak of).</p>
<p dir="auto">I hope that makes sense now in exhaustive detail.  I realize the confusion around “PythonScript” and “python scripts” :-)</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59479</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59479</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 05 Nov 2020 19:03:27 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 18:33:41 GMT]]></title><description><![CDATA[<p dir="auto">I guess the most critical part of changing from 2 to 3 is how python handles strings and this is the<br />
reason that PS3 is still in alpha because, as far as I understand, this isn’t currently handled in boost::python.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a><br />
not sure I understand correctly what you are trying to achieve.<br />
If you want to get auto completion and such stuff to work with python3 scripts in notepad++,<br />
you normally have to use PS3 plugin.<br />
Using PS2 plugin would mean you have to start a python3 process, run this in combination with a<br />
a <a href="http://jedi.py" rel="nofollow ugc">jedi.py</a> script which then parses your notepad++ .py file and outputs it findings to stdout which then is<br />
parsed back to PS2. Doesn’t sound desirable.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59477</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59477</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 05 Nov 2020 18:33:41 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 17:58:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a></p>
<p dir="auto">Thank you for the feedback!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59474</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59474</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 05 Nov 2020 17:58:48 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 15:49:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@Michael-Vincent</a> said in <a href="/post/59437">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a><br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a></p>
<p dir="auto">This old discussion almost going on 2 years - any progress?  What were the challenges with <a href="https://github.com/dail8859/NppLSP" rel="nofollow ugc">NppLSP</a> - technical or just time?  Is the “python script based LSP client” still in existence - any improvements / testing?</p>
<p dir="auto">Cheers.</p>
</blockquote>
<p dir="auto">I obviously haven’t touched the code in quite a while and don’t have any immediate plans to pick it back up any time soon.</p>
<p dir="auto">The struggles I had at the time were severe lack of documentation. Yes there was documentation, but they covered the basics and individual pieces. Also it came down to just having enough time as well to fight through the documentation.</p>
<p dir="auto">Specifically what was lacking was the higher level usage-case. What gets sent before other messages, what parameter effects later behavior, when to send these commands, recommended best practices, etc.</p>
<p dir="auto">On top of this was the problem of transitioning to a newer specification…so some LSP servers supported one, and not the other. Other LSP servers partially supported one of them with certain features not supported, or had broken implementations.</p>
<p dir="auto">My hope is that over the past 2 years the environment has improved.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59463</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59463</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Thu, 05 Nov 2020 15:49:04 GMT</pubDate></item><item><title><![CDATA[Reply to Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++? on Thu, 05 Nov 2020 13:29:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said in <a href="/post/59450">Microsoft Language Server Protocol (LSP): A possible revolution for Notepad++?</a>:</p>
<blockquote>
<p dir="auto">Lastly, for “pythonscripting” I don’t see a big difference between Python2 and Python3, syntactically</p>
</blockquote>
<p dir="auto">Agree, it’s not that hard to port our Py2 to Py3 stuff.  What I wasn’t sure about was using PythonScript2 to do language parsing and analysis on Python3 scripts I’ll be writing for work stuff - not to be run as Notepad++ Python scripts.  That may not make a difference, but wanted to clarify.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59451</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59451</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Thu, 05 Nov 2020 13:29:46 GMT</pubDate></item></channel></rss>