
Python in Visual Studio Code - rbanffy
https://blogs.msdn.microsoft.com/pythonengineering/2018/09/05/python-in-visual-studio-code-august-2018-release/
======
cik
I've been using VI since the 90's and VIM since... well the 90's. VSCode is
the first IDE I've been able to live, and happily. It blows my mind.

I have a tonne of tooling around automated python environments, vim plugins
(now vscode plugins), tasks - and it's made the whole thing significantly more
'unixy' than it was before. And to think - MSFT!

I have git hooks for my homedir's dotfiles that automatically look to see if
the plugin cache needs an update one way or the other - and runs my aliases
(see below).

I have global tasks that now link into workspaces, pretty decent python,
golang, and c++ support. I've mapped keys to the 'wierd' collection of things
I do between terminator terminals, vim tabs, and whatnot... honestly, it's
pretty good. It's not great, the things in 'vim' support are really
'vi'-light. I'd be much happier if vim support meant understanding my .vim
hierarchy - but I'm happy.

# vscode bash bits alias vspluginsave="code --list-extensions | xargs -L 1
echo code --install-extension > .vscode.plugins" alias vspluginload="sh
~/.vscode.plugins" alias vspluginclean="rm -rf ~/.vscode/extensions"

~~~
lliamander
Interesting how many people have switched from vi/vim to vscode. Does anyone
have stories of making a similar switch from emacs?

I currently use intellij for java work (because my employer pays for the
license) but for most any other type of editing I use emacs. I'd be interested
to see what other emacs users think of vscode.

~~~
Loic
I am currently switching from emacs to VS Code. I am using an emacs keymap and
I must say, it is wonderful. For Python, I can per project easily select the
right virtual environment, the "intellisense" like system is working very
well, it is pretty fast and you can customize a lot of it.

I am expecting to slowly move out of emacs for my coding in the next few
months.

Emacs will be kept because I have a lot of org-mode files to manage my company
at a higher level (lot of tables with formulas to calculate several key
indicators). On the longer term, they could be moved as Python notebooks with
the rendering in VS Code.

So yes, I do think this is the editor which is going to move a lot of old
coders out of emacs/vi/vim.

PS: The added bonus is that I easily get support of Go, Typescript, etc.
without the need to "debug my editor". Just install the right extension, done.

~~~
lliamander
> So yes, I do think this is the editor which is going to move a lot of old
> coders out of emacs/vi/vim.

That certainly seems a possibility, though I expect it may be somewhat
dependent upon the language used, and whether the community around that
language invests enough effort to develop vscode plugins for that language.

------
ggregoire
What's mind blowing is the community support behind VSCode. If you report a
bug, you get a reply in less than 24h, your bug gets tagged, assigned to
someone and fixed ASAP. Then you get a new release every month with ton of bug
fixes, improvements and new features.

Compare that to any other IDE or even any other open source projects.

~~~
kiaulen
That... hasn't been my experience:
[https://github.com/Microsoft/vscode/issues/18549](https://github.com/Microsoft/vscode/issues/18549)
[https://github.com/Microsoft/vscode/issues/16858](https://github.com/Microsoft/vscode/issues/16858)

Maybe I just care a little too much about code folding, but after origami.el
in emacs and atom and vim's great selection of folding commands, it seems like
an oversight.

VS Code has also painted itself into a corner making proper vim emulation
impossible:
[https://github.com/Microsoft/vscode/issues/22276#issuecommen...](https://github.com/Microsoft/vscode/issues/22276#issuecomment-302061827)

The editor is awesome, and I'm really thankful for Microsoft's work in this
space, especially on the LSP. But it's not everything for everyone.

~~~
WalterGR
_That... hasn 't been my experience_

Your links are to feature requests, not bugs.

Since ggregoire‘s comment is about bugs, your experience is orthogonal.

------
atomic77
I love using VSCode and find that I have less need for any other IDE with each
new release. This one might finally eliminate one of my remaining needs for
pycharm.

I can't help but feel sorry for Jetbrains though, who seem to be in a similar
position to Opera back in the late 2000s, a small software company up against
a behemoth that can afford to subsidize the development of an open-source
alternative to their bread and butter.

~~~
DrBazza
TeamCity in particular is loved by many enterprise shops, as well as IntelliJ
and Resharper. None of those (even IntelliJ) are particularly threatened by
VSCode.

~~~
bunderbunder
Iunno. I'm finding that VSCode is rapidly approaching parity with IntelliJ in
terms of features that I actually use, while at the same time being quite
noticeably faster and less buggy.

------
vvpan
I am somewhat embarrassed, but also relieved to admit that I switched from vim
(nvim to be precise) to VSCode (OMG M$FT!) and am very happy about it. I still
use vim bindings as much as I can, but I guess giving up a bit of ideology can
benefit one a lot. Although, that is until I start running out of memory on my
personal laptop, then it's back to the terminal!

~~~
scrollaway
The vscode vim bindings are atrocious. I use them because there's nothing
better, but they're _bad_. Slow, super buggy, and did I mention slow? I hit
tab and sometimes instead of inserting a \t, it inserts the letters "<tab>".
And it re-runs mypy/flake8/etc whenever I enter or exit insert mode, which I
do a ton... so my CPU is constantly pegged. And commands like "2d}" don't
delete the correct amount of paragraphs. And one more I forgot: The undo
stacks aren't synced between vscode and vscode-vim, so vscode's undo can undo
an undo. <sighs>

I've reported all these bugs with not much in terms of answers. I've even
tried contributing but it's a pretty messy codebase to get into. Ergh.

~~~
chillee
What's the bug that you have with `2d}`? It seems to work fine for me.

There shouldn't be any reason that it reruns save upon entering/exiting insert
mode; are you sure you don't have some kind of keybinding/other setting that's
autosaving for you?

The `<tab>` issue is kind of a pesky race condition that's most likely
exacerbated by VSCodeVim running slowly on your computer.

Speaking of it running slowly, I would argue against characterizing them as
"slow". Some small subset of users seems to have consistently run into this
issue, and a decently large subset of those users have realized that the issue
is caused by some conflicting plugin, so I'd suggest trying that too.

As for the undo issue, I have mixed feelings about it. Perhaps it could be
synced with VSCode, but it's definitely true that when it was first
implemented, VSCode did not provide the flexibility to do so.

Overall, I do agree that there's stuff that can improved, but it kinda hurts
to see people call them "atrocious". I suspect your main issue with VSCodeVim
is really the "slowness" issue. I would try disabling other plugins and see
whether it helps.

EDIT: Forgot to mention. Disclaimer: I'm one of the primary maintainers for
VSCodeVim.

~~~
scrollaway
> _Overall, I do agree that there 's stuff that can improved, but it kinda
> hurts to see people call them "atrocious"_

Sorry :( I hate to be harsh and I don't want this to get you down, because I
have a lot of admiration for the work you do (and this goes to any open source
work I've ever criticized, really). So, thank you for your work.

But... the usability is _really_ bad. They would be completely fine in a
vacuum if vim didn't exist, but the point of comparison exists and it's vim
and vim is just crazy fast compared to vscode-vim, it's like comparing a
racer... to a fighter jet.

> _What 's the bug that you have with `2d}`?_

That only deletes one paragraph (like 1d}) instead of two. 3d} only deletes
two, and so on. It's not consistent with vim.

> _There shouldn 't be any reason that it reruns save upon entering/exiting
> insert mode_

shrug, I filed an issue about this a couple weeks ago after a decent bit of
debugging.

> _I suspect your main issue with VSCodeVim is really the "slowness" issue_

ish, it's definitely the primary pain point but there's also lots of small
bugs and inconsistencies with vim. And I understand that competing with vim
itself is hard, but the other comparison point is for example pycharm's vim
plugin and vscode's is far behind.

Edit: And just to echo tdfx's point, without your bindings I wouldn't even be
on vscode, so there's that :)

------
jesseryoung
I have been following this extension ever since Don Jayamanne joined
Microsoft. This has grown by leaps and bounds since then and is a fantastic
extension.

I was a little leary when I learned they were tossing out jedi in favor of the
VS Python language server. However, after playing with it for a month or so
now I can tell that it's a drastic improvement over what's currently in place.

If anybody from the MS team is watching this thread, care to share why you
chose to invest in the VS Language Server instead of investing in Jedi
further?

~~~
brettcannon
The key thing to know is that the Microsoft Python Language Server -- long,
official name I know, hence why we just call it MPLS internally ;) -- comes
from our Python workload for Visual Studio. It was an extremely tough call to
make because David Halter has done a great job with Jedi and running that
project. But in the end we decided that if we were going to need to keep the
IntelliSense engine in Visual Studio going then we should get more out of that
investment by turning it into a language server and making it available in VS
Code.

But I will say (and continue to say) that we are extremely grateful to David
Halter and everyone who has worked on Jedi. It gave the extension the initial
IntelliSense support it needed in order to be successful. And we currently
have no plans on removing Jedi support for those that prefer it (from the
extension's perspective we're actually trying to treat the language server as
yet another project we have integrated support for, but where we have a direct
line to when a bug or feature crops up that we would like to see addressed ;)
.

------
sandGorgon
Vscode has been the first editor that I switched to from vim in 20 years (and
yes I went through sublime, atom,etc). A Microsoft editor on Linux... imagine
that.

Lots of people in my workplace have switched to using vscode from pycharm.
They still use pycharm once a month to do a global lint analysis or some
tricky refactor...but for daily use, it's much more pleasant to use vscode .

In fact, we use vscode with our Dev setup which is all docker+python. Works
beautifully (debugger and all)

~~~
joewrong
Any tips to share on debugging python in a docker container using vscode?

I've tried their instructions for ptvsd before and after this update but still
haven't been able to use the debugger with docker.

~~~
sandGorgon
you're in luck. I posted this just 2 days back

[https://github.com/Microsoft/vscode-
python/issues/79#issueco...](https://github.com/Microsoft/vscode-
python/issues/79#issuecomment-418154499)

------
ausjke
Tried to use python within vscode last month, it works fine, but I still have
to hack around for my own workflow.

I eventually switched to pycharm for its autocompletion, class help, even
pipenv support natively built-in.

for html/css/js I keep using vscode though.

there is no such thing called universal editor, I still have to use
various(vim,geany,vscode,pycharm...) for different scenarios, which is fine
but just very time consuming

~~~
Alir3z4
I've been trying to get into VSCode for Python development, especially Django
since the first official release of VSCode, every time I returned to PyCharm.

I just decided to accept PyCharm the only IDE that can make me productive and
go fast!

~~~
esistgut
I had a similar experience. What are you missing?

~~~
Alir3z4
* Auto complete * Integration with Python and Django, Flask. * Test runner (running the failed tests etc). * Amazing type hinting support. * Python console. * Support for pipenv, pip, virtualenv, etc. * Remote Python interpreter (working on Windows, but Python is inside a VM.) * Crazy Git support in one place (going through all the file history or selected lines history.) * Fast indexing. * ...

Some of the above or maybe all of them can be achieved in VSCode, but they
never feel native and well integrated in there.

To me PyCharm seems to be built for these, they create, design and develop an
IDE exactly for a specific audience. That's why PyCharm for Python, WebStorm
for web and PHPStorm for php development.

~~~
qubitron
We are working to improve on pretty much all of these areas, so I'd be
interested to learn from you what we can do to make them feel more native and
well integrated for you.

Reach out to me at dantaylo [at] microsoft [dot] com if you'd be willing to
hop on a call to chat more!

------
nirv
Never thought that code editor from the MSFT would become my daily driver IDE.

The only feature I need most from the VSCode (which is not implemented yet) is
Python Remote interpreter[1]. While `ptvsd` is more or less convenient for
remote debugging, it doesn't help when you need IntelliSense/linting while
developing code being interpreted in container/virtual machine/remote host.
IntelliJ PyCharm is clearly ahead here for now.

[1] Issue #79: [https://github.com/Microsoft/vscode-
python/issues/79](https://github.com/Microsoft/vscode-python/issues/79)

------
chomp
Need WSL support for the Python extension! Right now it's impossible to use
the Python extensions from within the WSL environment.

~~~
rcarmo
I'm on the same boat, since I only use pyenv inside WSL. It's something that
is being discussed (and worked on for other languages). The relevant issue is
at:

\- [https://github.com/Microsoft/vscode-
python/issues/67](https://github.com/Microsoft/vscode-python/issues/67)

And the VS Code team was asking for folk to interview regarding WSL
integration:

[https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGG...](https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR_1KurdrNndKiWKdwiEbexVURVIyUVQwUVdIWUlaUFg3N0Q4S0o5NFVORyQlQCN0PWcu)

(Full disclosure: I work at Microsoft, but in other teams, and am eagerly
waiting for the day I can use WSL pyenvs)

~~~
chomp
Cool thanks, I filled out the form!

My uses are a bit mundane but I'm willing to talk about them!

------
bsaul
I wonder how intellij will survive if vscode becomes a standard for pretty
much every language.

Which makes me wonder if kotlin will also survive if intellij goes bankrupt.

~~~
oweiler
At least with regards to Java, IntelliJ is still miles ahead.

~~~
brandonwamboldt
Something to consider, VS Code being free means it will eat into IntelliJ's
marketshare, even without all the features of IntelliJ. They'll be the people
who need the advanced features who will continue buying it, but many people
may not need the full suite, and will use VS Code to save money.

~~~
tincholio
The IntelliJ community edition is free as well, and has features galore. (I'm
an Emacs guy through and through, but some Java stuff makes me break out
IntelliJ)

------
msluyter
I've been pretty happy with PyCharm, having come from a java+Intellij
background, but I'm open to other options.

So I'd be curious if someone can comment how VSCode compares to PyCharm wrt
language aware features, such as: contextual selection, refactoring, finding
usages, method/function extraction, auto-fixing, etc...?

~~~
pvg
VSCode is a programmable editor with IDE-ish features (lots of them, and
getting more). Intellij IDEA is an IDE behemoth. They'll overlap quite a bit,
I doubt VSCode is going to be the IDE IDEA is anytime soon, if ever just as
IDEA is probably never going to be something you fire up to edit a small
python script or lets you hack in support for some obscure build system or
error format parsing in 20 minutes.

That's mostly it. PyCharm is easily going to squish VSCode at the features you
listed.

------
Keyframe
I was born and raised in Emacs, but over the years switched to Vim (on Amiga)
and used it ever since. Occasional stints came and went (UE32, Sublime...),
but vim remained. It still does, but used to too. VS Code, on the other hand,
is excellent for Javascript. Whenever I need to do JS, VS Code is the tool to
do it. Along with Brackets for quick proto/live preview (something VS Code
doesn't do as well).

Vim is still my goto (heh, heh!) 'IDE' for C. I still haven't explored, in-
depth, going towards Spacemacs for C... but my vim setup is now so well-honed
for everything C that I'm not sure what would be the benefit of jumping on top
of anything else. Doesn't seem worth it, except for debugging, which I do per-
platform anyways.

In any case, VSCode for JS is THE tool, along with Brackets for live preview
when making a proto.

------
anentropic
Is there any way to import or convert a Sublime Text 3 colour scheme?

It's stupid, but I'm so used to my customised colour scheme it really makes it
hard to use anything else... and I'm comfortable enough with ST3 I can't be
bothered spending time recreating the scheme from scratch

~~~
WouterSpaak
Can Sublime export a textmate theme? If so, yes, you can import a .tmTheme
file into VS Code. [https://code.visualstudio.com/docs/extensions/themes-
snippet...](https://code.visualstudio.com/docs/extensions/themes-snippets-
colorizers)

~~~
anentropic
Great!

in fact my theme is already in tmTheme format because it came from ST2, which
could always load Textmate themes

------
cryptozeus
MS totally dominates tooling. I am so happy with vs code, use it for my
angular development as well.

~~~
wastedhours
Use it for Rails and Flutter too here, and really happy with it!

------
a_humean
What I'm hoping for, for all langauges and runtimes, is some global opt-in to
WSL. If I have node or python installed on WSL, I would love it if the Windows
version of VSCode could act as if it were the Linux version.

~~~
fulafel
Not a Windows users but curious about WSL - could you run Linux VSCode under
WSL?

~~~
int_19h
Yes, you can!

Setting up UI under WSL is a bit of a pain, because there's nothing out of the
box - so you need to set up X on Windows, or use VNC or RDP. RDP is the
easiest by far right now - just install xrdp in WSL, edit the config so that
it uses a different port, and connect to localhost from Windows. The result
looks like this:

[https://i.imgur.com/DSmLjUM.png](https://i.imgur.com/DSmLjUM.png)

------
hit8run
Wish MS would also offer an own Ruby extension. Solargraph and the vscode-ruby
extensions are pretty good though

~~~
bunderbunder
The Python VSCode extension started out as an independent open source project.
It independently reached a pretty high level of maturity - and helped VSCode
get popular among Python developers - before, a bit under a year ago,
Microsoft hired the maintainer.

Since then it's acquired a few new goodies, but most of what makes the
extension great happened before Microsoft adopted it, so I shouldn't think
there's anything stopping Ruby from doing the same.

~~~
bunderbunder
Following up on that -

Shooting from the hip, though, if the desire is for funding, I'm guessing
Microsoft wouldn't see much strategic value in putting money into a Ruby
extension. The Ruby ecosystem has largely congealed around an ASP.NET
competitor, some devops tools that don't really work on Windows, and not much
else. Python, on the other hand, is widely used in Microsoft shops. Windows
shops need data scientists, too, and it's typically the primary language for
cross-platform devops infrastructure.

~~~
Scarbutt
Maybe that might change now that they bought github (heavy users of ruby) but
I doubt it ;)

~~~
bunderbunder
Maybe the GitHub people would do it independently?

There's also just a question of which way the winds are blowing. I know the
TIOBE index needs to be taken with a dose of salt, but it is interesting to
see that Python is entering the top 3 at the same time that Ruby is falling
behind Object Pascal.

------
arsa
Yay, finally proper remote debugging support - had heck of a time figuring it
out with previous version ([http://artem.savelev.com/2017/08/comfortable-
vscode-rpi-debu...](http://artem.savelev.com/2017/08/comfortable-vscode-rpi-
debugging/) )

Hopefully this one just works as v4 actually has an idea of standard protocol
that doesn't break.

------
nickjj
I wish they would add support for running Python or any runtime inside of
Docker.

There's been a Python specific ticket open since November to add in remote
interpreter support at [https://github.com/Microsoft/vscode-
python/issues/79](https://github.com/Microsoft/vscode-python/issues/79).
Current status is "no ETA".

~~~
qubitron
This is very high priority feature on our backlog, and we are currently
looking into it. It's a complicated feature to implement so any ETA we give
right now would be making things up, sorry!

------
sumanthvepa
Updated to the August release of VSCode this morning and discovered that
debugging python in the editor is broken. The editor refuses to recognize
PYTHONPATH specified in the environment or a .env file. (This refers to VSCode
on Windows 10). The hack to work around this is to specify it in the
launch.json file. Otherwise I absolutely love VSCode and particularly the
Python extension.

~~~
brettcannon
Please file a bug at [https://github.com/microsoft/vscode-
python/issues](https://github.com/microsoft/vscode-python/issues)

------
ngrilly
Crazy question: Since Microsoft bought GitHub, would it make sense to merge
VSCode and Atom at some point, keeping the best of each one?

~~~
ggregoire
What's the best of Atom?

~~~
kiaulen
As the other comment mentioned, extensibility. Their API is much easier to
navigate. Their commands line up exactly with the name that shows up in the
fuzzy finder, so dispatching a command or adding a key binding is a breeze.
The settings menu supports things like drop down lists and color pickers. The
UI is both beautiful and consistent. And Vim Mode Plus feels far ahead of
Vscodevim.

You do lose the dedicated python developer, first class LSP support, and
integrated debugger though.

------
Alex3917
Is there a Python IDE that will show all the stuff that's actually in a class?
E.g. if I have a class that inherits from several parent classes, some of
which have identically named methods, is there a good way to see how the
methods are defined in the class I'm looking at?

~~~
meowface
VS Code has an Outline view that does this:
[https://code.visualstudio.com/updates/v1_25#_outline-
view](https://code.visualstudio.com/updates/v1_25#_outline-view)

------
myth_buster
I'm using VSCode for my FE work and love the tooling, integrations and
marketplace. Happy with the vim plugin, formatting support and terminal
support within the IDE. Not a surprise here coming from Visual Studio. In the
past I've considered splurging on JetBrains' Webstorm IDE. Glad I didn't.

Will give it a whirl for the BigData/ML related scripts. Nice to see one IDE
being the GoTo for different lines of work.

Having said that, with the latest update (1.26.1), I'm seeing a significant
lag in keystrokes. Not sure whether a plugin is the culprit.

------
billforsternz
Since the 80s and BRIEF (anyone remember that?) I have relied on record/play
keyboard macro with every programmer's editor I've used. This fundamental
feature is missing in VSCode, sadly it's a complete showstopper for me. I get
the impression that VSCode's architecture makes this difficult or impossible
to implement as an extension.

~~~
dmoo
What a joy Brief was back in the day. Could open huge files, lightening quick,
macros, column select and replace, programmable and all on a single floppy.

------
zdware
I'm pretty close to switching to this as my daily driver, but there's some
small things, like Django Template formatting
([https://github.com/Microsoft/vscode/issues/46468](https://github.com/Microsoft/vscode/issues/46468))
that have yet to be fixed/working.

------
haolez
I prefer Atom, but I’ve started having a weird memory leak issue in version
1.29 that prevented me from using it further (note: I’ve disabled all
extensions and the problem persists). I use Ubuntu.

I’m using VSCode now and it’s good, but I do intend to return to Atom when I
get some time to properly create an issue for this problem in GitHub and help
the team to fix it.

~~~
baldfat
Since Atom is now owned by Microsoft I am wondering what is going to happen
with Atom. Does it get better or does it get cut lose into a "community"
project?

~~~
josteink
Atom and VSCode share lots of common infrastructure and Microsoft is investing
heavily in that.

With that, even with no specific efforts toward Atom, it should still see
improvements over time.

------
ayr-ton
Is great to see this kind of debugging, with a easy setup, in a open source
IDE. Awesome job with the open source community.

------
tracker1
I tried it first very early on, but was hesitant after trying Brackets and
Atom. I was happily surprised and once they added the integrated terminal, I
was hooked. I don't use the tasks feature (usually just a terminal or two
open). In general it's been incredibly nice though.

------
dep_b
I'm using VSCode for developing in Elixir and (because I had the license
anyway I guess) my Python code in PyCharm. But perhaps I should re-evaluate
VSCode for Python as well as it works fantastic (including quite advanced code
warnings and errors) for Elixir.

~~~
pythonaut_16
Which Elixir extension are you using for VS Code? Are you on Windows, Linux or
Mac?

I've had the best luck with the ElixirLS extension on Linux but there are
still a few weird things here or there.

------
Havoc
Awesome.

It's by far my favorite dev environment. Tried Eclipse first & was constantly
fighting against the IDE. Might make sense for a full time dev but I just want
a light editor with some basics like autocomplete & context etc

------
Memosyne
I would really like to see MSFT implement a builtin way to visually profile
applications. They have a great ecosystem for editing and debugging, but
profiling extensions are non-existent because of the strict API.

~~~
brettcannon
If you specifically want Python support for e.g. coverage.py, then please open
an issue at [https://github.com/microsoft/vscode-
python/issues](https://github.com/microsoft/vscode-python/issues) .

------
chrisgd
As a relatively new programmer, no matter the IDE, I still run my code from
the command line in a venv is there another way that something like this makes
an option?

------
Alir3z4
Not only for VSCode but I'm very happy that Microsoft is pushing for Python.

Great work by Microsoft and all the contributors.

------
_pmf_
It was already one of the best out-of-the-box experiences of any Python IDE
I've used.

------
Dowwie
As if python weren't already incredibly easy to debug?

A tool demo would help..

------
CodeSheikh
Tangent thread:

Any alt recommendation for Flask+Connexion?

------
another-cuppa
I've been using emacs for more than ten years and I've loved how I've been
able to invest heavily in one text editor to cover all my needs. Back then
everyone else seemed to be using special purpose IDEs so it's interesting to
see that only now lots of people are seeing the advantages of more general
purpose editors.

VSCode is not emacs, but it's not bad at all.

------
vgy7ujm
We want Perl support!

~~~
tootie
As much as I love Perl, it has a reputation of being exceedingly difficult to
parse accurately, hence IDE support will never be great. There's also probably
more demand to support hipster languages than last generation's work horses.

~~~
pjmlp
I don't use it since 2000's, but ActiveState's Komodo used to be ok.

