This project has moved and is read-only. For the latest updates, please go here.

How can I disable Python error messages per-project?

Jul 7, 2014 at 10:26 PM
I have a Visual Studio project that is primarily C++, but also contains some python.

The python is a really small part of the solution, it's not really critical to being able build/run the executable, it's really a C++ thing with the python files just thrown in because it's convenient from time to time to be able to quickly find and edit them through visual studio's editor.

When I press "build", I'm really building my C++ code, and want to see just the C++ errors. Unfortunately, PTVS spams my "Error List" window with thousands of spurious python errors that I don't care about. These are mostly to do with imports that PTVS does not understand, and it's not important to me to use PTVS on this particular solution.

I'm tempted to uninstall PTVS, but I do want to keep it installed for developing other python-only solutions.

So, I would like it if there was a way that I could tell PTVS not to add any Python Error messages to my Error List windows on this particular project. I can't find anything like this in the settings dialogs. Is this possible?
Jul 7, 2014 at 10:32 PM
There's nothing available right now, though I did just file an issue about this earlier today:

We can't add an option to the C++ project, but we should be doing a better job of handling Python files that aren't in a Python project. Suppressing error messages is a big part of this, since as you've discovered, they tend to not be very helpful.

I'll add a link to this discussion from the issue.
Jul 7, 2014 at 10:51 PM
that's unfortunate.
thanks for the reply.

In what way would you improve the handling of python files that aren't in a Python project? Would you suppress all errors from non-python projects?

(that would work fine for me, but other people who have their project set up better for python might actually benefit from the error messages and be sad to see them go.)

Are people using PTVS successfully in projects which are not "Python projects", or do you basically have to set up your solution/project as a "Python project" for PTVS to work correctly?
Jul 7, 2014 at 10:58 PM
You need a Python project for the full benefits, or you really need to be Python 2.7-based (which is what we default to outside of a project).

I'm currently thinking that we'll suppress all errors in the error list, use your default environment for Start with[out] debugging (which I think we already do), and either suppress or be more intelligent about squiggles in the file. We should still be able to show very basic IntelliSense, and syntax highlighting and indentation should be fine. Basically, we'll strip out the annoying bits but leave as much in as we possibly can, as well as providing some way to customize it through global settings (such as the default environment).

We've heard some issues like this, so people are using definitely using PTVS with C++ projects. Nobody has said it's unusable, though we are aware of issues when you try and use separate C++ and Python projects in the same solution. If you're doing more than a little bit of Python, I'd suggest having separate projects if possible (New Project from Existing Code is helpful here, since you can put the project anywhere and it doesn't move files around), but there are a few scenarios that we want to support as best we can.
Jul 8, 2014 at 6:16 PM
I disabled "Show Error List if build finishes with errors" so now I just get the raw C++ compiler output instead of a the fancy gui window. This way I don't see the PTVS errors mixed in. It's an unfortunate but workable solution for continuing to use PTVS without having to uninstall it.