Error notification from extension when Git conflict markers exist
The Problem
During any Git merge conflict where pyproject.toml ends up with the markers in it, the extension pops up an error log and an error notification bubble. The error log looks like this:
[Error - 8:34:54 AM] Pyproject file parse attempt 5 Error: Invalid TOML document: only letter, numbers, dashes and underscores are allowed in keys
48: pyarrow = "~=17.0"
49: <<<<<<< HEAD
^
50: pyairtable = "~=2.3.0"
By the letter of the law this probably isn't a bug (after all, an extension shouldn't be expected to still work if the config file isn't broken), but it's pretty annoying to have to manually close this each time.
Other potentially notable information:
- To my knowledge and decent bit of research, VSCode provides no mechanism to turn error-level notifications off for extensions. You can disable info and warning level notifications, but there's simply no lever for error-level notifications like this.
- I do not resolve merge conflicts in VSCode itself. I do it in IntelliJ (I prefer their merge resolution UI) and then tab back into VSCode, at which point I get this error.
- The
ruffextension also sends an error notification in the same case. I made an issue over there too: github.com/astral-sh/ruff-vscode/issues/733. Obviously not under your purview to fix, but still relevant.
For the record, big fan of Basedpyright -- keep up the great work!
Proposed Solution
Not sure an objectively "best" solution exists, but what came to mind first:
- If extension can't parse the config file but finds a conflict marker in the file, print a message at warn level instead of error level. This still surfaces it, but lets people at least opt out.
yeah i agree this is annoying. excuse me while i rant about git, but honestly i don't get why it stores conflict information inside the file itself, it causes so many problems. imagine if a linter outputted its errors by inserting the messages into your source code and messing it up with syntax errors. in case you want to commit them? why would anyone ever want to commit them?????
I do not resolve merge conflicts in VSCode itself. I do it in IntelliJ (I prefer their merge resolution UI) and then tab back into VSCode, at which point I get this error.
i do the exact same thing lol. in fact my hatred of vscode's conflict resolution is part of the reason i think showing this as an error is important. whenever i attempt to use vscode to resolve a conflict, it seems to ignore what i did and just silently leave the file in a broken state with conflict markers still in it. this often goes undetected and even gets committed (again, why does git even let you do that?)
i don't really know what the solution here is. i think it's more of a vscode UX issue (i think error notifications should disappear automatically after a few seconds, and only re-appear if the error gets reported again). i could add an option to configure the log level of these messages, but i'm weary of adding too many settings since the config system is quite a mess (see #64)