PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: codemanki/cloudscraper (js)
Issue: (confirmed bug) Support the baseUrl request option
Request will throw an error when the `baseUrl` option is set and `uri` is not a relative uri.
We would need to either remove the `baseUrl` option when setting `options.uri` to be the absolute challenge url or always set both `options.baseUrl` and `options.uri` but ensure that `uri` is a relative path.
Pull request description: Support the baseUrl option
Fixes #105 

Patch:
diff --git a/index.js b/index.js
index 8e228dc..dae35f7 100644
--- a/index.js
+++ b/index.js
@@ -255,9 +255,13 @@ function solveChallenge (options, response, body) {
 
   // Prevent reusing the headers object to simplify unit testing.
   options.headers = Object.assign({}, options.headers);
-  // Use the original uri as the referer and to construct the answer url.
+  // Use the original uri as the referer and to construct the answer uri.
   options.headers['Referer'] = uri.href;
   options.uri = uri.protocol + '//' + uri.hostname + '/cdn-cgi/l/chk_jschl';
+  // baseUrl can't be used in conjunction with an absolute uri
+  if (options.baseUrl !== undefined) {
+    options.baseUrl = undefined;
+  }
   // Set the query string and decrement the number of challenges to solve.
   options.qs = payload;
   options.challengesToSolve = options.challengesToSolve - 1;


Test patch:
diff --git a/test/test-index.js b/test/test-index.js
index 092c278..8b096d2 100644
--- a/test/test-index.js
+++ b/test/test-index.js
@@ -554,4 +554,40 @@ describe('Cloudscraper', function () {
     expect(custom.defaults).to.equal(cloudscraper.defaults);
     done();
   });
+
+  it('should not error when using baseUrl option', function (done) {
+    var cf = cloudscraper.defaults({ baseUrl: 'http://example-site.dev/' });
+
+    var firstParams = helper.extendParams({
+      baseUrl: 'http://example-site.dev/',
+      uri: '/test'
+    });
+
+    var firstResponse = helper.cloudflareResponse({
+      body: helper.getFixture('js_challenge_03_12_2018_2.html')
+    });
+
+    Request.onFirstCall()
+      .callsFake(helper.fakeRequest({ response: firstResponse }));
+
+    var secondResponse = helper.fakeResponse({ body: requestedPage });
+    var expectedBody = secondResponse.body.toString('utf8');
+
+    Request.onSecondCall()
+      .callsFake(helper.fakeRequest({ response: secondResponse }));
+
+    var promise = cf.get('/test', function (error, response, body) {
+      expect(error).to.be.null;
+
+      expect(Request).to.be.calledTwice;
+      expect(Request.firstCall).to.be.calledWithExactly(firstParams);
+      expect(Request.secondCall.args[0]).to.not.have.property('baseUrl');
+
+      expect(response).to.be.equal(secondResponse);
+      expect(body).to.be.equal(expectedBody);
+    });
+
+    expect(promise).to.eventually.equal(expectedBody).and.notify(done);
+    this.clock.tick(7000);
+  });
 });
Repository: elm-tooling/elm-language-server (ts)
Issue: Renaming custom type constructors also renames imported modules when names match
When trying to rename a custom type constructor whose name matches one of the imported module names, the imported module name gets renamed along with the constructor.

Take following minimal example:
```elm
module Test exposing (..)

import Html

type Model = Html

value : Model
value = Html

view : Html.Html msg
view = Html.p [] []
```

When you rename the constructor `Html` in VSCode, you currently end up with the following result:

```elm
module Test exposing (..)

import Foo -- this is incorrect, this has to remain `Html`

type Model = Foo

value : Model
value = Foo

view : Html.Html msg
view = Html.p [] []
```

## Expected Behavior
Renaming a constructor should rename only the constructor along with all the usages of the constructor.

## Current Behavior
Renaming a constructor renames not only the constructor and all the usages of the constructor but also _unrelated but identically named imports_.

## Possible Solution
???

## Steps to Reproduce (for bugs)
1. Paste the minimal example from this description in a new module in VSCode.
2. Use the rename action in VSCode to rename the `Html` constructor, rename it to something different.

=> `import Html` line will be incorrectly renamed

## Context
I was trying to rename a value constructor.

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used: 2.1.0
* Editor used: VSCode 1.55.2
* Environment name and version (e.g. node.js 5.4): node 12.20.1
* Operating System and version: Darwin x64 19.6.0 (OSX 10.15.7)


Pull request description: Union constructor should not reference import with the same name
Fixes #580.

Patch:
diff --git a/src/util/treeUtils.ts b/src/util/treeUtils.ts
index bfb1521..d08fddc 100644
--- a/src/util/treeUtils.ts
+++ b/src/util/treeUtils.ts
@@ -197,7 +197,8 @@ export class TreeUtils {
             (moduleNamePrefix &&
               a.text === `${moduleNamePrefix}.${unionConstructorName}`)) &&
           a.parent &&
-          a.parent.type !== "type_ref",
+          a.parent.type !== "type_ref" &&
+          a.parent.type !== "import_clause",
       );
       return result.length === 0 ? undefined : result;
     }


Test patch:
diff --git a/test/referencesProviderTests/typeReferences.test.ts b/test/referencesProviderTests/typeReferences.test.ts
index 58fd027..dd069a3 100644
--- a/test/referencesProviderTests/typeReferences.test.ts
+++ b/test/referencesProviderTests/typeReferences.test.ts
@@ -127,6 +127,26 @@ func a =
         M.A ->
       --X
           ""
+`;
+    await testBase.testReferences(source);
+  });
+
+  it(`import with same name is not a union constructor reference - issue #580`, async () => {
+    const source = `
+--@ Test.elm
+module Test exposing (..)
+
+import Html
+
+type Model = Html
+            --^
+
+value : Model
+value = Html
+       --X
+
+view : Html.Html msg
+view = Html.p [] []
 `;
     await testBase.testReferences(source);
   });