Software

Microsoft Visual Studio Code replumbed for better Python taming

Python Language Server an option for those that code

36 Got Tips?

Microsoft's Visual Studio Code, the company's Electron-based source code editor for Linux, macOS and Windows, has been bestowed with the company's Python Language Server, making it more fluent in the popular programming language.

The language server, Microsoft explains, powers the company's IntelliSense autocomplete system, which not long ago was separated from the company's Visual Studio IDE so it could be used in other coding tools. It implements Microsoft's Language Server Protocol which governs how servers and development tools interact for specific programming languages.

IntelliSense is what the Microsoft Office Assistant Clippy (aka Clippit) would have been if natural language parsing were easy and the urge to animate could have been resisted. Because it interacts with a defined domain – programming code – and because Microsoft has put a lot of work into it, IntelliSense manages to provide automated assistance that's far more relevant than assistive systems focused on social interaction.

Programming languages have to be treated separately by the language server because each has its own quirks. Python for example is a dynamically typed language, which means the data type of variables may change. So inferences that might be used to make suggestions about statically typed code won't work with Python.

GitHub to Pythonistas: Let us save you from vulnerable code

READ MORE

Users of Visual Studio Code have had access to IntelliSense and the Python Extension for a while. The arrival of the Python Language Server should make the code completion experience better and more comprehensive.

"Our Python Language Server uses iterative full-program analysis to track the types of all the variables in your project while simulating execution of all the code in your project," explains Brett Cannon, Microsoft principal software engineer, in a blog post.

"Normally this kind of approach can take hours for complex programs and require unlimited amounts of RAM, but we have used many tricks to make it complete quickly enough for IntelliSense use."

With the Python Language Server, developers writing Python code can enjoy seeing syntax errors flagged as they type. They can receive warnings when referenced modules can't be found. And they can use Typeshed files, which help with type inferencing, to fill in missing completions for modules.

Startup time and import time should be improved too.

The Python Language Server works with .NET Core on Windows, macOS and Linux. It supports Python 2.5 through 3.7, including recent language features like async/await. It is available as an opt-in preview feature in the latest Python Extension for Visual Studio Code, which can be downloaded through the Visual Studio Marketplace or Visual Studio Code's extension gallery.

To enable it, go to File > Preferences > Settings in Visual Studio Code and add the setting:

"python.jediEnabled": false

®

Sign up to our NewsletterGet IT in your inbox daily

36 Comments

Keep Reading

Canary-build Microsoft browser blocks Microsoft extension from inflicting Microsoft search engine

Virtue is its own reward

Microsoft 365 Business to gain more Azure Active Directory toys... oh, and it's called Microsoft 365 Business Premium (from 21 April)

Because this Office branding shake-up isn't confusing at all

Wow, Microsoft's Windows 10 always runs Edge on startup? What could cause that? So strange, tut-tuts Microsoft

Punters asked to hand over their logs if browser keeps coming to life against their wishes

Microsoft: 14 January patch was the last for Windows 7. Also Microsoft: Actually...

Wallpaper-stripping bug will be fixed

Russia-linked Gamaredon hacker crew using Microsoft's Visual Basic for Applications to pwn Microsoft's Outlook

From targeting Ukraine to random mailboxes: how the mighty have fallen

Here's a headline we never thought we'd write 20 years ago: Microsoft readies antivirus for Linux, Android

Redmond knows a thing or two about tackling malware – amirite, Windows fans?!

Non-human Microsoft Office users get their own special licences

Automated operators can pay up like anyone – or anything – else

Microsoft disbands three-ring Windows Insider circus and replaces it with 'channels'

Redmond decides volunteer crash-test dummies care about quality, not speed

Microsoft loosens Teams' necktie as platform courts your forensic accountant relatives

Just look at the time. Looks like I can't attend the family meeting about our calendar!

No more installing Microsoft's Chromium-centered Edge by hand: Windows 10 will do it for you automatically

Something something pushing us over the Edge

Tech Resources

Islamic Republic of Iran Cybersecurity Profile from Anomali Threat Research

Iran’s regional influence has been operationalized through the use of proxy military activity, information operations as well as offensive cyber activity.

Unlocking the Cloud-Native Data Layer

Being able to exceed customer expectations is essential to a successful business.

The Evolution of Ransomware

There’s no question that ransomware is a growing threat.

Dark Reading Report: The State of IT Operations & Cybersecurity Operations

Your enterprise’s cyber risk may depend upon the relationship between the IT team and the security team.