nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: ajalt/mordant
Pull request #30 (2021-07-24 16:56:23)

[#29]: add rendering for image with reference links
Add rendering for short and full reference links. 
Add small tweak for tests

ajalt: Thank you!

Patch:
diff --git a/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/markdown/MarkdownRenderer.kt b/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/markdown/MarkdownRenderer.kt
index 95a5e30c..00855492 100644
--- a/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/markdown/MarkdownRenderer.kt
+++ b/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/markdown/MarkdownRenderer.kt
@@ -356,13 +356,21 @@ internal class MarkdownRenderer(
     }
 
     private fun renderImageLink(node: ASTNode): Lines {
-        val text = findLinkText(node.firstChildOfType(MarkdownElementTypes.INLINE_LINK))
-            ?.takeUnless { it.isEmpty() }
-            ?: return EMPTY_LINES
-        return listOf(
-            parseText("🖼️ ", DEFAULT_STYLE),
-            text.replaceStyle(theme.style("markdown.img.alt-text"))
-        ).foldLines { it }
+        // Could be inline, full or short reference
+        val link = node.findChildOfType(MarkdownElementTypes.INLINE_LINK)
+            ?: node.findChildOfType(MarkdownElementTypes.FULL_REFERENCE_LINK)
+            ?: node.findChildOfType(MarkdownElementTypes.SHORT_REFERENCE_LINK)
+        if (link != null) {
+            val text = findLinkText(link)
+                ?.takeUnless { it.isEmpty() }
+                ?: return EMPTY_LINES
+            return listOf(
+                parseText("🖼️ ", DEFAULT_STYLE),
+                text.replaceStyle(theme.style("markdown.img.alt-text"))
+            ).foldLines { it }
+        } else {
+            return EMPTY_LINES
+        }
     }
 
     private fun findLinkLabel(node: ASTNode): String? {


Test patch:
diff --git a/mordant/src/commonTest/kotlin/com/github/ajalt/mordant/markdown/MarkdownTest.kt b/mordant/src/commonTest/kotlin/com/github/ajalt/mordant/markdown/MarkdownTest.kt
index da8461ea..28a10d78 100644
--- a/mordant/src/commonTest/kotlin/com/github/ajalt/mordant/markdown/MarkdownTest.kt
+++ b/mordant/src/commonTest/kotlin/com/github/ajalt/mordant/markdown/MarkdownTest.kt
@@ -407,6 +407,10 @@ ${linkText("www.example.com/url")}
 ![an image](example.png)
 
 ![](example.png)
+
+![an image][1]
+
+[1]: example.png
 """, """
 🖼️ ${imgAlt("an image")}
 
@@ -415,6 +419,10 @@ ${linkText("www.example.com/url")}
 🖼️ ${imgAlt("an image")}
 
 
+
+🖼️ ${imgAlt("an image")}
+
+${linkDest("[1]: example.png")}
 """)
 
     @Test
Repository: AlecStrong/sql-psi
Pull request #365 (2022-04-06 23:32:57)

Support from and for in function names
Closes https://github.com/AlecStrong/sql-psi/issues/189


Patch:
diff --git a/.gitignore b/.gitignore
index c3284bf..f6c34d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ out/
 lib/
 build/
 .DS_Store
+local.properties
diff --git a/core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf b/core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf
index f062d25..ab21b4d 100644
--- a/core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf
+++ b/core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf
@@ -219,9 +219,9 @@ expr ::= ( raise_expr
          | binary_pipe_expr
          | unary_expr
          | literal_expr
+         | other_expr
          | column_expr
-         | bind_expr
-         | other_expr )
+         | bind_expr )
 
 other_expr ::= extension_expr
 extension_expr ::= NULL
@@ -255,7 +255,7 @@ binary_and_expr ::= expr AND expr {
 binary_or_expr ::= expr OR expr {
   implements = "com.alecstrong.sql.psi.core.psi.SqlBinaryExpr"
 }
-function_expr ::= function_name '(' [ [ DISTINCT ] expr ( ',' expr ) * | '*' ] ')'
+function_expr ::= function_name '(' [ [ DISTINCT ] expr ( ( ',' | FROM | FOR ) expr ) * | '*' ] ')'
 paren_expr ::= '(' expr ')' {
   pin = 1
 }


Test patch:
diff --git a/test-fixtures/src/main/resources/fixtures/function-from-for/Test.s b/test-fixtures/src/main/resources/fixtures/function-from-for/Test.s
new file mode 100644
index 0000000..a5d42c0
--- /dev/null
+++ b/test-fixtures/src/main/resources/fixtures/function-from-for/Test.s
@@ -0,0 +1,1 @@
+SELECT substring(DISTINCT 'Thomas' , 2);
\ No newline at end of file
diff --git a/test-fixtures/src/main/resources/fixtures/function-name-for/Test.s b/test-fixtures/src/main/resources/fixtures/function-name-for/Test.s
new file mode 100644
index 0000000..8ba7ecb
--- /dev/null
+++ b/test-fixtures/src/main/resources/fixtures/function-name-for/Test.s
@@ -0,0 +1,1 @@
+SELECT substring('Thomas' FROM 2 FOR 3);
\ No newline at end of file
Repository: ovn-org/libovsdb
Pull request #107 (2021-05-13 07:10:39)

Fix rebase error of PR #106 on top of #104
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>


Patch:
diff --git a/client/client.go b/client/client.go
index 67bd9f0..dbb5777 100644
--- a/client/client.go
+++ b/client/client.go
@@ -361,8 +361,8 @@ func (ovs OvsdbClient) Get(model Model) error {
 }
 
 //Create implementes the API interface's Create function
-func (ovs OvsdbClient) Create(model Model) (*ovsdb.Operation, error) {
-	return ovs.api.Create(model)
+func (ovs OvsdbClient) Create(models ...Model) ([]ovsdb.Operation, error) {
+	return ovs.api.Create(models...)
 }
 
 //List implements the API interface's List function


Test patch:
diff --git a/client/ovs_integration_test.go b/client/ovs_integration_test.go
index 692070b..49695eb 100644
--- a/client/ovs_integration_test.go
+++ b/client/ovs_integration_test.go
@@ -202,7 +202,7 @@ func TestInsertTransactIntegration(t *testing.T) {
 		})
 	assert.Nil(t, err)
 
-	operations := append([]ovsdb.Operation{*insertOp}, mutateOp...)
+	operations := append(insertOp, mutateOp...)
 	reply, err := ovs.Transact(operations...)
 	if err != nil {
 		t.Fatal(err)