PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: clojure-lsp/clojure-lsp (clojure)

Issue:
Renaming keywords adds extra colons
Renaming `:foo` to `:bar` will actually rename it to `::bar` and renaming `::foo` to `::bar` will rename it to `::::bar`

Pull request:
This PR fix #19 by striping the leading colons from input before assembling final `newText`.

Patch:
diff --git a/src/clojure_lsp/handlers.clj b/src/clojure_lsp/handlers.clj
index 80739cb93..e745c54fe 100644
--- a/src/clojure_lsp/handlers.clj
+++ b/src/clojure_lsp/handlers.clj
@@ -309,8 +309,8 @@
     (when-not (contains? tags :norename)
       (let [[_ cursor-ns _] (parser/ident-split cursor-str)
             replacement (if cursor-ns
-                          (string/replace new-name (re-pattern (str "^" cursor-ns "/")) "")
-                          new-name)
+                          (string/replace new-name (re-pattern (str "^:{0,2}" cursor-ns "/")) "")
+                          (string/replace new-name #"^:{0,2}" ""))
             changes (->> (for [[doc-id usages] file-envs
                                :let [version (get-in @db/db [:documents doc-id :v] 0)]
                                {u-sym :sym u-str :str :as usage} usages


Test patch:
diff --git a/test/clojure_lsp/handlers_test.clj b/test/clojure_lsp/handlers_test.clj
index ec198eda9..f7b9dd98b 100644
--- a/test/clojure_lsp/handlers_test.clj
+++ b/test/clojure_lsp/handlers_test.clj
@@ -7,12 +7,16 @@
 
 (deftest test-rename
   (reset! db/db {:file-envs
-                 {"file://a.clj" (parser/find-references "(ns a) (def bar)" :clj)
-                  "file://b.clj" (parser/find-references "(ns b (:require a)) (def x a/bar)" :clj)}})
+                 {"file://a.clj" (parser/find-references "(ns a) (def bar ::bar)" :clj)
+                  "file://b.clj" (parser/find-references "(ns b (:require a)) (def x a/bar) :a/bar" :clj) }})
   (testing "rename on symbol without namespace"
     (is (= "foo" (get-in (handlers/rename "file://a.clj" 1 13 "foo")
                          [:changes "file://a.clj" 0 :new-text])))
     (is (= "a/foo" (get-in (handlers/rename "file://a.clj" 1 13 "foo")
+                           [:changes "file://b.clj" 0 :new-text])))
+    (is (= "::foo" (get-in (handlers/rename "file://a.clj" 1 17 ":foo")
+                         [:changes "file://a.clj" 0 :new-text])))
+    (is (= ":a/foo" (get-in (handlers/rename "file://a.clj" 1 17 ":foo")
                            [:changes "file://b.clj" 0 :new-text]))))
   (testing "rename on symbol with namespace adds existing namespace"
     (is (= "foo" (get-in (handlers/rename "file://b.clj" 1 30 "foo")
Repository: MaskingTechnology/jitar (ts)

Issue:
Add support for dynamic imports to the reflection
Currently we support static imports:

```ts
import x, {y, a as z } from 'module';
```

And need to add support for dynamic imports:

```ts
const { z } = await import('module');
```

Pull request:
feat(reflection): dynamic import support
Fixes #198

Changes proposed in this pull request:
- Added support for dynamic imports

@MaskingTechnology/jitar


Patch:
diff --git a/packages/jitar-reflection/src/parser/Parser.ts b/packages/jitar-reflection/src/parser/Parser.ts
index 448f8dc..4509db0 100644
--- a/packages/jitar-reflection/src/parser/Parser.ts
+++ b/packages/jitar-reflection/src/parser/Parser.ts
@@ -278,6 +278,16 @@ export default class Parser
         {
             return new ReflectionImport(members, token.value);
         }
+        else if (token.hasValue(Group.OPEN))
+        {
+            token = tokenList.step(); // Read away the open group
+
+            const from = token.value;
+
+            tokenList.step(2); // Read away the from value and scope close
+
+            return new ReflectionImport(members, from);
+        }
 
         if (token.hasValue(Scope.OPEN) === false)
         {


Test patch:
diff --git a/packages/jitar-reflection/test/_fixtures/parser/Parser.fixture.ts b/packages/jitar-reflection/test/_fixtures/parser/Parser.fixture.ts
index 89c70d8..d721d87 100644
--- a/packages/jitar-reflection/test/_fixtures/parser/Parser.fixture.ts
+++ b/packages/jitar-reflection/test/_fixtures/parser/Parser.fixture.ts
@@ -19,6 +19,7 @@ const IMPORTS =
     IMPORT_DEFAULT_MEMBER: "import name, { member } from 'module'",
     IMPORT_DEFAULT_MEMBER_AS: "import name, { member as alias } from 'module'",
     IMPORT_MULTIPLE_MEMBERS_AS: "import { name, member as alias } from 'module'",
+    IMPORT_DYNAMIC: "import('module')",
 }
 
 const EXPORTS =
diff --git a/packages/jitar-reflection/test/parser/Parser.spec.ts b/packages/jitar-reflection/test/parser/Parser.spec.ts
index d5e16e9..7967c21 100644
--- a/packages/jitar-reflection/test/parser/Parser.spec.ts
+++ b/packages/jitar-reflection/test/parser/Parser.spec.ts
@@ -156,6 +156,13 @@ describe('parser/Parser', () =>
             expect(second.name).toBe('member');
             expect(second.as).toBe('alias');
         });
+
+        it('should parse importing modules dynamically', () =>
+        {
+            const imported = parser.parseImport(IMPORTS.IMPORT_DYNAMIC);
+            expect(imported.members.length).toBe(0);
+            expect(imported.from).toBe("'module'");
+        });
     });
 
     describe('.parseExport(code)', () =>
Repository: 3Hren/msgpack-rust (rust)

Issue:
Relax assertion on negative extension types
I'm using the `rmpv` crate to serialize some data to MessagePack, some of this data contains dates, so the data needs to be serialized as a Timestamp extension type, with type `-1`. See spec here: https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type.

When trying to serialize that data (using `write_value(&mut buf, &Value::Ext(-1, <data_here>)`) the `rmp` crate panics at the following line:
https://github.com/3Hren/msgpack-rust/blob/e96d118/rmp/src/encode/mod.rs#L260

At the moment I'm using a local copy of the crate with that assertion removed, but it would be helpful if that assertion could be relaxed to at least allow the type `-1`.





Pull request:
Allow timestamp extension
The timestamp extension is using `-1` as identifier, support such negative values.

Closes #174.

Patch:
diff --git a/rmp/src/encode/mod.rs b/rmp/src/encode/mod.rs
index b3676c7..e88ec91 100644
--- a/rmp/src/encode/mod.rs
+++ b/rmp/src/encode/mod.rs
@@ -257,8 +257,6 @@ pub fn write_map_len<W: Write>(wr: &mut W, len: u32) -> Result<Marker, ValueWrit
 /// Panics if `ty` is negative, because it is reserved for future MessagePack extension including
 /// 2-byte type information.
 pub fn write_ext_meta<W: Write>(wr: &mut W, len: u32, ty: i8) -> Result<Marker, ValueWriteError> {
-    assert!(ty >= 0);
-
     let marker = match len {
         1 => {
             write_marker(wr, Marker::FixExt1)?;


Test patch:
diff --git a/rmp/tests/func/encode/ext.rs b/rmp/tests/func/encode/ext.rs
index 363cb47..f625a9f 100644
--- a/rmp/tests/func/encode/ext.rs
+++ b/rmp/tests/func/encode/ext.rs
@@ -28,6 +28,13 @@ fn pass_pack_meta_fix4() {
     assert_eq!([0xd6, 0x10], buf);
 }
 
+#[test]
+fn pass_pack_meta_fix4_timesamp() {
+    let mut buf = [0x00, 0x00];
+    assert_eq!(Marker::FixExt4, write_ext_meta(&mut &mut buf[..], 4, -1).unwrap());
+    assert_eq!([0xd6, 0xff], buf);
+}
+
 #[test]
 fn pass_pack_meta_fix8() {
     let mut buf = [0x00, 0x00];