Friday, October 22, 2021

Completion with python extension modules such as PyQt5 and Pandas

Code Completion in the editor when you are using python extension modules has always been hard, primarily because these are not implemented in python code but rather in a compiled language (typically C) and come as dynamic link libraries.  PyScripter in the past the option to import such modules when code completion was requested and used introspection of the imported modules to provide code completion and general IntelliSense support.

With the implementation of the Language Server Protocol and the inclusion of the Jedi language server there is now a better option. The use of stubs described in PEP 484.

pip install PyQt5-stubs

You would use the pip external Tool for installing the stubs.  Then restart the language server, using the command under the Tools menu and presto,  you have near perfect code completion with PyQt5.

Many packages such as numpy come with their stubs included.  For others you can in internet for stub support.

Another way to improve code completion is to add the package/module name to the list of “Special packages” in the IDE options under code completion.  Jedi will load these modules and this in many cases can improve the speed and quality of code completion.  This works well with the pandas library for example.

 

Wednesday, October 20, 2021

PyScripter v4.1.1 released

PyScripter v4.1.1 is now available at Sourceforge.  This is a hotfix release addressing a couple of critical issues with version 4.1.0 (error on shutdown and errors while editing large files).  See the earlier announcement about version 4.1.0 for information about new features and issues addressed in the v4.1 as compared to v4.0.

Sunday, October 17, 2021

PyScripter 4.1.0 released

PyScripter 4.1 is now available at Sourceforge..  As discussed in an earlier blog post, the major new feature of this release is the implementation of the Language Server Protocol (LSP).  Code IntelliSence is now provided by the widely used Jedi Language Server. Here follows a list of new features and bug fixes in this release:

New features:

  • Implementation of the Language Server Protocol
  • Python language support provided by the Jedi language server
  • Two new styles added Windows11_Light and Windows11_Dark
  • Copy and paste code as html to Powerpoint and other applications
  • Removed support for python 3.3-3.5
  • Read-only indicator on tabs
  • Added traditional Chinese translation

Issues Addressed:

Thursday, September 30, 2021

PyScripter 4.1 is coming

A new release 4.1 is round the corner. Beyond bug fixes, the major new feature of this release is the implementation of the Language Server protocol.

Seeking feedback from early adopters

I would like to get volunteers to try the new version before it is released to the public. You can download a registry-free installation from this link. Just unzip the file and run PyScripter.exe.  It will not interfere with installed versions of PyScripter.  Please report issues at the issue tracker and provide feedback at the support forum.

PyScripter and the Language Server Protocol

Modern programming editors and Integrated Development Environments (IDEs), help programmers to write better code efficiently, by providing features such as:

  • Code completion
  • Signature help (function parameters)
  • Code explorer (hierarchical view of module symbols
  • Code hints
  • Find definition
  • Find references
  • … and more

These features are collectively referred to as “Code IntelliSense”, a term coined by Microsoft. To provide such features editors and IDEs need to parse and analyze source code, while users are typing code.   PyScripter has been doing a fine job in providing Code IntelliSense to its users by using its own python source code parsing and analysis module.  However, keeping up with new python versions and the changes and new features they bring to the python grammar requires significant development resources.

A recent trend has been to move the Code IntelliSense processing out of the editors and IDEs by using external Language Servers.  Microsoft has standardized the communication between IDEs and Language Servers by promoting the adoption of the Language Server Protocol (LSP).  The LSP is now used by Microsoft’s Visual Studio and Visual Studio Code as well as by many commercial and free IDEs.  There are numerous Language Server implementations for many programming languages, including Python.

The forthcoming version of PyScripter, in addition to the usual round of bug fixes, implements the Language Server Protocol and shifts the “Code IntelliSense” processing to external Language Servers.  It also bundles the python Jedi Language Server, based on the Jedi package, that is used by many other IDEs.  Although this brings few visible improvements (everything should work as before) it brings a number of advantages:

  • Improved stability since the source code parsing and analysis is carried out in external processes.
  • Better quality of Code IntelliSense, since the Jedi Language Server is actively developed and supports the latest python feature.
  • The default Language Server (Jedi) can be easily swapped for alternative python Language Servers.
  • New features such as code diagnostics and refactoring can be easily added, since they are supported by the LSP.
  • Development resources are freed and can be diverted to other improvements of PyScripter.

Wednesday, May 5, 2021

PyScripter 4.0.0 released

PyScripter 4.0.0 is now available at Sourceforge.  This is a major new release with an updated User Interface and many significant enhancements under the hood, that will increase the stability and improve the user experience. Here is the list of changes:

New features:
  • Major redesign of the User Interface - Material icons and new logo
  • Re-architecture the interaction with python, code-completion etc. It should result in a more responsive user experience without delays and freezes.
  • Added support for Python 3.10
  • Removed support for Python 2.7, 3.2
  • Installer and executable are now code-signed
  • Persian translation added
  • New IDE option "Restore open project"
  • New File Explorer command "Select Directory..." (#1034)
Issues Addressed:

Thursday, April 15, 2021

PyScripter 4.0.0 is coming

 A new release of PyScripter is close.  Notice the pumped up version number.   This is due to the extensive nature of the changes implemented.   The visible changes are in relation to the User Interface.

New logo:


New material icons with a touch of color:




But the most important changes are the ones which are not visible.  The whole interaction with Python, and code completion infrastructure were re-architectured in order to move as much work as possible to threads and keep the GUI thread free of delays and blockages.  This will hopefully result in a better user experience and will also allow extra functionality to be added, without slowing down the program.

Seeking feedback from early adopters

Given the considerable changes in the code base, I would like to get volunteers to try the new version before it is released to the public.  In particular I am seeking feedback regarding:

  • the overall stability of the program
  • the new user interface
You can download a registry-free installation from this link.  Just unzip the file and run PyScripter.exe.  It will not interfere with installed versions of PyScripter.  Please report issues at the issue tracker and provide feedback at the support forum.

Python 2

I should add that support for Python 2 has been dropped.  This was a hard decision to make and I know some users will be disappointed.   However this has simplified the task of maintaining and further developing PyScripter.  You can still use the older versions of PyScripter for your Python 2 work side-by-side with the new version.

Acknowledgements

I would like to thank Embarcadero for providing support to the project and Adriana Díaz (Aumenta Software) who designed the new user interface.