microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.05k stars 29.21k forks source link

Merge editor: TypeScript type errors do not appear #206672

Open OliverJAsh opened 8 months ago

OliverJAsh commented 8 months ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

Install TypeScript and create main.ts with contents:

export const add1 = (n: number) => n + 1;

add1(2)

Copy and apply the following patch e.g. using pbpaste | git apply -3. This will result in a conflict.

diff --git a/main.ts b/main.ts
index 4885bfc..bfd86b9 100644
--- a/main.ts
+++ b/main.ts
@@ -1,3 +1,4 @@
 export const add1 = (n: number) => n + 1;

+// foo
 add1(1)

Open the conflict in VS Code's merge editor.

Resolve the conflict but purposefully create a type error.

Expected: the type error should appear.

Actual: the type error does not appear. The type error only appears if I open the file outside of the merge editor.

https://github.com/microsoft/vscode/assets/921609/2b6763b2-d725-4f1b-82d2-16c4355b9671

vscodenpa commented 8 months ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.87.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

hediet commented 8 months ago

@mjbvz it seems like diagnostics only update when the text document is opened in another editor:

Image