PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: tweag/nickel (rust)

Issue:
The LSP doesn't show the details of type errors anymore in the diagnostics
**Describe the bug**
When I edit a file with a static type error in it, the diagnostic shown in my editor is not very informative, because it doesn't show the notes of the diagnostic which include the type and whatnot. I thus just get "incompatible types", which is unhelpful. This is a regression wrt to latest stable (1.4.1), which does show the full diagnostic (see below).

**To Reproduce**
Input `5 : String` in your editor:

![image](https://github.com/tweag/nickel/assets/6530104/f724c48e-625a-428a-b0dc-40826657bb6c)

**Expected behavior**

This is the behavior in current stable (1.4.1), and expected one:

![image](https://github.com/tweag/nickel/assets/6530104/3a21727e-67c4-4d89-9bd9-3b3a66c69e3f)

**Environment**
 - Version of the code: 71a84b3ed9226379b24aa55cc6e1149fd8ec212d


Pull request:
Reinstate notes in in-editor diagnostics
Fixes #1850 

Patch:
diff --git a/lsp/nls/src/diagnostic.rs b/lsp/nls/src/diagnostic.rs
index b0e1bb92..ab298bd4 100644
--- a/lsp/nls/src/diagnostic.rs
+++ b/lsp/nls/src/diagnostic.rs
@@ -123,11 +123,16 @@ impl DiagnosticCompat for SerializableDiagnostic {
                 .next()
                 .map(|label| lsp_types::Range::from_codespan(&label.file_id, &label.range, files))
             {
+                let message = if diagnostic.notes.is_empty() {
+                    diagnostic.message.clone()
+                } else {
+                    format!("{}\n{}", diagnostic.message, diagnostic.notes.join("\n"))
+                };
                 diagnostics.push(SerializableDiagnostic {
                     range,
                     severity,
                     code: code.clone(),
-                    message: diagnostic.message,
+                    message,
                     related_information: Some(
                         cross_file_labels
                             .map(|label| DiagnosticRelatedInformation {


Test patch:
diff --git a/lsp/nls/tests/inputs/diagnostics-typecheck.ncl b/lsp/nls/tests/inputs/diagnostics-typecheck.ncl
new file mode 100644
index 00000000..045b40b1
--- /dev/null
+++ b/lsp/nls/tests/inputs/diagnostics-typecheck.ncl
@@ -0,0 +1,3 @@
+### /diagnostics.ncl
+5 : String
+### diagnostic = ["file:///diagnostics.ncl"]
diff --git a/lsp/nls/tests/snapshots/main__lsp__nls__tests__inputs__diagnostics-typecheck.ncl.snap b/lsp/nls/tests/snapshots/main__lsp__nls__tests__inputs__diagnostics-typecheck.ncl.snap
new file mode 100644
index 00000000..d16fe3d4
--- /dev/null
+++ b/lsp/nls/tests/snapshots/main__lsp__nls__tests__inputs__diagnostics-typecheck.ncl.snap
@@ -0,0 +1,9 @@
+---
+source: lsp/nls/tests/main.rs
+expression: output
+---
+(file:///diagnostics.ncl, 0:0-0:1: incompatible types
+Expected an expression of type `String`
+Found an expression of type `Number`
+These types are not compatible)
+(file:///diagnostics.ncl, 0:0-0:1: this expression)
Repository: node-nock/nock (js)

Issue:
Request body specs don't allow regex within array.
For example, the following nock will never match a POSTed payload, because the regex property test is nested within an array:

```javascript
nock('my.api.com')
  .post('/resource', {
    messages: [{
      from: '15555555555',
      destinations: [{
        to: '15555555555'
      }],
      text: 'testing.. 123',
      validityPeriod: /\d*/,
      sendAt: /.+/
    }]
  })
```

Looks like this is because `deepEqualExtended` hands off to the `deep-equal` library as soon as something that is not an object or regex is encountered, so the regex matching logic is lost as soon as an array is hit.

Pull request:
Handle arrays like objects in match_body
Closes #715 and does not appear to cause any regressions.

Patch:
diff --git a/lib/match_body.js b/lib/match_body.js
index bcfd53b..e5346e0 100644
--- a/lib/match_body.js
+++ b/lib/match_body.js
@@ -57,7 +57,7 @@ function deepEqualExtended(spec, body) {
   if (spec && spec.constructor === RegExp) {
     return spec.test(body);
   }
-  if (spec && spec.constructor === Object && body) {
+  if (spec && spec.constructor === Object || spec.constructor === Array && body) {
     var keys = Object.keys(spec);
     for (var i = 0; i < keys.length; i++) {
       if (!deepEqualExtended(spec[keys[i]], body[keys[i]])) {


Test patch:
diff --git a/tests/test_body_match.js b/tests/test_body_match.js
index 5519a35..23f9225 100644
--- a/tests/test_body_match.js
+++ b/tests/test_body_match.js
@@ -26,3 +26,24 @@ test('match body with regex', function (t) {
   });
 
 });
+
+test('match body with regex inside array', function (t) {
+
+  nock('http://encodingsareus.com')
+    .post('/', {items: [{name: /t.+/}]})
+    .reply(200);
+
+  mikealRequest({
+    url: 'http://encodingsareus.com/',
+    method: 'post',
+    json: {
+      items: [{
+        name: 'test'
+      }]
+    },
+  }, function(err, res) {
+    if (err) throw err;
+    assert.equal(res.statusCode, 200);
+    t.end();
+  });
+})
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 223
Good morning! Here's your coding interview problem for today.

This problem was asked by Palantir.

Typically, an implementation of in-order traversal of a binary tree has O(h) space complexity, where h is the height of the tree. Write a program to compute the in-order traversal of a binary tree using O(1) space.

Pull request:
Day223
Resolves #460.

Patch:
diff --git a/README.md b/README.md
index 33dcb98..5a4dc8b 100644
--- a/README.md
+++ b/README.md
@@ -233,3 +233,4 @@ problems from
 * [Day 220](https://github.com/vaskoz/dailycodingproblem-go/issues/453)
 * [Day 221](https://github.com/vaskoz/dailycodingproblem-go/issues/454)
 * [Day 222](https://github.com/vaskoz/dailycodingproblem-go/issues/458)
+* [Day 223](https://github.com/vaskoz/dailycodingproblem-go/issues/460)
diff --git a/day223/problem.go b/day223/problem.go
new file mode 100644
index 0000000..e7e88fa
--- /dev/null
+++ b/day223/problem.go
@@ -0,0 +1,34 @@
+package day223
+
+// BinaryTree is a simple binary tree.
+type BinaryTree struct {
+	Value       interface{}
+	Left, Right *BinaryTree
+}
+
+// InorderMorrisTraversal performs a Morris Inorder traversal.
+// Uses O(1) extra space.
+func InorderMorrisTraversal(root *BinaryTree) []interface{} {
+	var inorder []interface{}
+	curr := root
+	for curr != nil {
+		if curr.Left == nil {
+			inorder = append(inorder, curr.Value)
+			curr = curr.Right
+		} else {
+			pre := curr.Left
+			for pre.Right != nil && pre.Right != curr {
+				pre = pre.Right
+			}
+			if pre.Right == nil {
+				pre.Right = curr
+				curr = curr.Left
+			} else {
+				pre.Right = nil
+				inorder = append(inorder, curr.Value)
+				curr = curr.Right
+			}
+		}
+	}
+	return inorder
+}


Test patch:
diff --git a/day223/problem_test.go b/day223/problem_test.go
new file mode 100644
index 0000000..491d4dc
--- /dev/null
+++ b/day223/problem_test.go
@@ -0,0 +1,39 @@
+package day223
+
+import (
+	"reflect"
+	"testing"
+)
+
+var testcases = []struct {
+	root    *BinaryTree
+	inorder []interface{}
+}{
+	{&BinaryTree{
+		1,
+		&BinaryTree{
+			2,
+			&BinaryTree{4, nil, nil},
+			&BinaryTree{5, nil, nil},
+		},
+		&BinaryTree{3, nil, nil},
+	},
+		[]interface{}{4, 2, 5, 1, 3},
+	},
+}
+
+func TestInorderMorrisTraversal(t *testing.T) {
+	for _, tc := range testcases {
+		if result := InorderMorrisTraversal(tc.root); !reflect.DeepEqual(tc.inorder, result) {
+			t.Errorf("Expected %v, got %v", tc.inorder, result)
+		}
+	}
+}
+
+func BenchmarkInorderMorrisTraversal(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			InorderMorrisTraversal(tc.root)
+		}
+	}
+}