sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: extract function including traling comment that is not selected
Labels: Suggestion,Help Wanted,Domain: Refactorings,Experience Enhancement

# Bug Report
extract function including traling comment that is not selected
<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->
- This is a bug in 4.3.2-latest version 
When I use 'extract to method in class C' in following code， the selected region does not contain comment '/*end*/', but when I excecute 'extract to method in class C', the extractd method contains comment '/*end*/'. Is this a bug？I think it would better comment not selected appear in newMethod.

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
class C{
  a() {
    let z =1;
    /*start*/let a1= {x:1};
    let y =10;
    z=42
    return a1.x+ 10 /*end*/
  }
}
```

### 🙁 Actual behavior

<!-- What happened, and why it was wrong -->
```ts
class C{
  a() {
    let z = 1;
    /*start*/
    let __return;
    ({ __return, z } = this.newMethod(z));
    return __return; /*end*
  }
  private newMethod(z: number) {
    let a1 = { x: 1 };
    let y = 10;
    z = 42;
    return { __return: a1.x + 10 /*end*/
    , z };
  }
}
```

### 🙂 Expected behavior

<!-- What you expected to happen instead, and why -->
```ts
class C{
  a() {
    let z = 1;
    /*start*/
    let __return;
    ({ __return, z } = this.newMethod(z));
    return __return; /*end*/
  }

  private newMethod(z: number) {
    let a1 = { x: 1 };
    let y = 10;
    z = 42;
    return { __return: a1.x + 10 , z };
  }
}
```
Repository: PowerToys
Issue: Can the sorting function for Win10 virtual desktops be developed? 请问能否win10开发虚拟桌面的排序功能
Labels: Needs-Triage

### Description of the new feature / enhancement

Can the sorting function for Win10 virtual desktops be developed?

请问能否win10开发虚拟桌面的排序功能

### Scenario when this would be used?

Sorting feature for virtual desktops in Win10 Win+Tab.






### Supporting information

_No response_
Repository: kubernetes
Issue: Implement watch limit in APF
Labels: sig/api-machinery,kind/feature,triage/accepted

### What would you like to be added?

Implement a limit mechanism in APF to limit how many ongoing watches can be accepted. 

### Why is this needed?

Current APF only limits the rate of accepting watch requests. As a result, the total number of watches can creep up with long watch duration regardless how low the rate is limited, which puts a risk on kube-apiserver's memory usage. A crude estimate of memory overhead for a watch is around 50KiB-100KiB.

This feature can be incorporated in most APF concepts and limit watch number per priority. But it might need to have a new tunable similar to `--max-requests-inflight` as in `--max-watches-inflights` and then each priority has a share of this total number.
Repository: rust
Issue: fn-ptr docs were not updated for the change to trait impls
Labels: E-easy,A-docs,T-libs

### Location

https://doc.rust-lang.org/nightly/std/primitive.fn.html#trait-implementations-1

### Summary

we now implement all of these traits for all function pointers. We should change the documentation to mention that.

we may also want to add a dummy impl for rustdoc for https://doc.rust-lang.org/nightly/std/marker/trait.FnPtr.html, similar to https://github.com/rust-lang/rust/blob/6f8c0557e0b73c73a8a7163a15f4a5a3feca7d5c/library/core/src/primitive_docs.rs#L1574-L1583

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"mj10021"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: rust
Issue: sanitizer=cfi does not work with Clto=thin ?
Labels: A-sanitizers,C-bug,PG-exploit-mitigations

`rustc src/main.rs -Zsanitizer=cfi  -Zsanitizer-cfi-normalize-integers`
```
error: `-Zsanitizer=cfi` requires `-Clto`, `-Clto=thin`, or `-Clinker-plugin-lto`
```
so I tried thin:
`rustc src/main.rs -Zsanitizer=cfi  -Zsanitizer-cfi-normalize-integers -Clto=thin`
but this does not work?

````
error: failed to prepare thin LTO context: Expected a single module

````

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"rcvalle"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: opencv
Issue: VideoCapture Parameter Inconsistencies
Labels: bug,category: videoio,category: documentation

### System Information

OpenCV version: 4.6.0
Operating System: Windows & MacOS tested (but I think it applies to all platforms)
Compiler: MSVC v143 and Apple Clang 14 
Backends: DSHOW and AvFoundation

### Detailed description

If you use the capture open method with this signature [open](https://docs.opencv.org/4.7.0/d8/dfe/classcv_1_1VideoCapture.html#a10867868137c2d142aac30a0648d00fe) (int index, int apiPreference, const std::vector< int > &params), it will produce the following error and fail to open the capture when provide invalid parameters 
```
opencv/modules/videoio/src/backend_static.cpp:26: error: (-213:The function/feature is not implemented) VIDEOIO: Failed to apply invalid or unsupported parameter: [6]=1.23544e+09 / 1235435435 / 0x49a33fab in function 'applyParametersFallback'
```
If you use the open method with this signature [open](https://docs.opencv.org/4.7.0/d8/dfe/classcv_1_1VideoCapture.html#a49e87ea8665f471b76a48c0a6c537fb7) (int index, int apiPreference=[CAP_ANY](https://docs.opencv.org/4.7.0/d4/d15/group__videoio__flags__base.html#gga023786be1ee68a9105bf2e48c700294da77ab1fe260fd182f8ec7655fab27a31d))
and then attempt to set the invalid parameters different behavior occurs. It will open the capture, then attempt to set the invalid parameter and fail but the capture remains open. 

On invalid parameters, the first method should ignore the parameter like `capture.set` instead of throwing an error and refusing to start the capture.

### Steps to reproduce

Produces the above error:
```cpp
int cap_index = 0;
int cap_backend = 0;   
std::vector<int> params = {
    CAP_PROP_HW_ACCELERATION,1,
    CAP_PROP_FOURCC, 12345, // this is purposefully invalid
};
capture.open(cap_index, cap_backend, cap_params);
```
Does not produce an error and opens the capture (ignores invalid FOURCC parameter):
```cpp
int cap_index = 0;
int cap_backend = 0;   
std::vector<int> params = {
    CAP_PROP_HW_ACCELERATION,1,
    CAP_PROP_FOURCC, 12345, // this is purposefully invalid
};
capture.open(cap_index, cap_backend);
for (int i = 0; i < cap_params.size(); i += 2) {
    const int param = cap_params[i];
    const int value = cap_params[i+1];
    capture.set(param,value);
}
```

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)
Repository: rust
Issue: Tracking Issue for stdarch_mips_feature_detection
Labels: O-MIPS,T-libs-api,C-tracking-issue

Feature gate: `#![feature(stdarch_mips_feature_detection)]`

This is a tracking issue for MIPS target feature detection.

### Public API

```rust
// std::arch

macro_rules! is_mips_feature_detected { .. }
macro_rules! is_mips64_feature_detected { .. }
```

### Steps / History

- [ ] Final comment period (FCP)[^1]
- [ ] Stabilization PR

### Unresolved Questions

- None yet.

[^1]: https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html
Repository: rust
Issue: Tracking Issue for stdarch_arm_feature_detection
Labels: O-Arm,T-libs-api,C-tracking-issue

Feature gate: `#![feature(stdarch_arm_feature_detection)]`

This is a tracking issue for ARM target feature detection.

### Public API

```rust
// std::arch

macro_rules! is_arm_feature_detected { .. }
```

### Steps / History

- [ ] Final comment period (FCP)[^1]
- [ ] Stabilization PR

### Unresolved Questions

- None yet.

[^1]: https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html
Repository: rust
Issue: Tracking Issue for stdarch_powerpc_feature_detection
Labels: T-libs-api,O-PowerPC,C-tracking-issue

Feature gate: `#![feature(stdarch_powerpc_feature_detection)]`

This is a tracking issue for PowerPC target feature detection.

### Public API

```rust
// std::arch

macro_rules! is_powerpc_feature_detected { .. }
macro_rules! is_powerpc64_feature_detected { .. }
```

### Steps / History

- [ ] Final comment period (FCP)[^1]
- [ ] Stabilization PR

### Unresolved Questions

- None yet.

[^1]: https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html
Repository: rust
Issue: Tracking Issue for stdarch_riscv_feature_detection
Labels: T-libs-api,C-tracking-issue,O-riscv

Feature gate: `#![feature(stdarch_riscv_feature_detection)]`

This is a tracking issue for RISC-V target feature detection.

### Public API

```rust
// std::arch

macro_rules! is_riscv_feature_detect { .. }
```

### Steps / History

- [ ] Final comment period (FCP)[^1]
- [ ] Stabilization PR

### Unresolved Questions

- None yet.

[^1]: https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html
Repository: pytorch
Issue: Will Deep Implicit Models ever become first class citizens in PyTorch?
Labels: feature,module: autograd,triaged,module: functorch

### 🚀 The feature, motivation and pitch

PyTorch makes it unnecessarily difficult to work with [Deep Implicit Models](https://implicit-layers-tutorial.org/). Deep Implicit Layers/Models are characterized by the need to implement custom backward passes to be efficient, making use of the [implicit function theorem](https://en.wikipedia.org/wiki/Implicit_function_theorem).

In particular, the following issues persist:

- JIT is incompatible with custom backwards. The only way around this is writing custom C++ extensions.  https://github.com/pytorch/pytorch/issues/35749
- Implementing custom backward hooks for a whole `nn.Module` is extremely counter-intuitive, consider this example from Chapter 4:

```python
def forward(self, x):
    # compute forward pass and re-engage autograd tape
    with torch.no_grad():
        z, self.forward_res = self.solver(
            lambda z : self.f(z, x), torch.zeros_like(x), **self.kwargs)
    z = self.f(z,x)
    
    # set up Jacobian vector product (without additional forward calls)
    z0 = z.clone().detach().requires_grad_()
    f0 = self.f(z0,x)
    def backward_hook(grad):
        g, self.backward_res = self.solver(
            lambda y : autograd.grad(f0, z0, y, retain_graph=True)[0] + grad,
            grad, **self.kwargs)
        return g
            
    z.register_hook(backward_hook)
    return z
```

One needs to `no_grad` the forward, and then manually surgically insert the custom backward.

- Custom backward of nn.Modules are also incompatible with JIT, and it's unclear how to work around it.

### Alternatives

JAX supports per-function custom backward overrides via decorators: https://jax.readthedocs.io/en/latest/notebooks/Custom_derivative_rules_for_Python_code.html

```python
import jax.numpy as jnp
from jax import custom_jvp

@custom_jvp
def f(x, y):
  return jnp.sin(x) * y

@f.defjvp
def f_jvp(primals, tangents):
  x, y = primals
  x_dot, y_dot = tangents
  primal_out = f(x, y)
  tangent_out = jnp.cos(x) * x_dot * y + jnp.sin(x) * y_dot
  return primal_out, tangent_out
```

If supported, this would solve all 3 issues.

### Additional context

_No response_

cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7 @msaroufim @wconstab @bdhirsh @anijain2305 @Chillee @samdow @kshitij12345 @janeyx99 @soumith @ngimel
Repository: rust
Issue: Tracking Issue for MIPS arch intrinsics
Labels: O-MIPS,T-libs-api,C-tracking-issue

Feature gate: `#![feature(stdarch_mips)]`

This is a tracking issue for the MIPS intrinsics in `core::arch::{mips,mips64}`.

### Public API

Everything in `core::arch::{mips,mips64}`.

### Steps / History

- [ ] Final comment period (FCP)[^1]
- [ ] Stabilization PR

### Unresolved Questions

- None yet.

[^1]: https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html
Repository: rust
Issue: Tracking Issue for NVPTX arch intrinsics
Labels: T-libs-api,O-NVPTX,C-tracking-issue

Feature gate: `#![feature(stdarch_nvptx)]`

This is a tracking issue for the NVPTX intrinsics in `core::arch::nvptx`.

### Public API

Everything in `core::arch::nvptx`.

### Steps / History

- [ ] Final comment period (FCP)[^1]
- [ ] Stabilization PR

### Unresolved Questions

- Should these intrinsics follow the CUDA API?

[^1]: https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html
Repository: excalidraw
Issue: [Feature Request] Disable Container Text Binding On Filled Shapes
Labels: enhancement,discussion,package:excalidraw

When double clicking a filled shape such as an ellipse a text input element shows up within the element and can make some use cases difficult.

This is very noticeable when using smaller ellipsis as small circles and dots as when the text input engages it augments the shape to an oval shape and can be difficult to work with and easy to accidentally input text.
Repository: ant-design
Issue: 弹层类组件需要统一设置colorBgContainer 为 colorBgElevated
Labels: Inactive,unconfirmed

### Reproduction link

-

### Steps to reproduce

-

### What is expected?

暗色模式下，浮层组件中的 input 应该使用 colorBgElevated 的颜色，而不是使用 colorBgContainer。这个需要在 antd 层做统一处理。

### What is actually happening?

暗色模式下的 input 使用了 colorBgContainer，导致暗色模式下颜色不正常。
![image](https://user-images.githubusercontent.com/28616219/236211499-eb11b146-cee6-4871-92cc-8bdebe9085f4.png)


| Environment | Info |
| --- | --- |
| antd | 5.4.6 |
| React | 18 |
| System | na |
| Browser | na |

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: next.js
Issue: How to load properly the "Local fonts" formats?
Labels: bug,Font (next/font)

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.4.0: Mon Mar  6 21:01:02 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8112
    Binaries:
      Node: 18.15.0
      npm: 8.15.0
      Yarn: 1.22.19
      pnpm: N/A
    Relevant packages:
      next: 13.3.4
      eslint-config-next: 13.3.4
      react: 18.2.0
      react-dom: 18.2.0
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

Font optimization (next/font)

### Link to the code that reproduces this issue

/

### To Reproduce

Hi everyone, 

I'm using `next/font` on my app in order to load some local fonts I have in my public directory.
I used this documentation for this:
https://nextjs.org/docs/basic-features/font-optimization#local-fonts

This is the piece of code, loading the fonts: 

```js
const poppins = localFont({
  preload: true,
  display: 'swap',
  src: [
    {
      path: '../public/fonts/Poppins-Regular.woff',
      weight: 'normal',
      style: 'normal',
    },
    {
      path: '../public/fonts/Poppins-Regular.woff2',
      weight: 'normal',
      style: 'normal',
    },
    {
      path: '../public/fonts/Poppins-Italic.woff',
      weight: 'normal',
      style: 'italic',
    },
    {
      path: '../public/fonts/Poppins-Italic.woff2',
      weight: 'normal',
      style: 'italic',
    },
    {
      path: '../public/fonts/Poppins-SemiBold.woff',
      weight: 'bold',
      style: 'normal',
    },
    {
      path: '../public/fonts/Poppins-SemiBold.woff2',
      weight: 'bold',
      style: 'normal',
    },
  ],
  variable: '--font-poppins',
})
```

Nothing fancy, the only particularity is the font extension, as you can see I'm trying to load woff & woff2 fonts. 

Since I'm using Tailwind btw, I'm adding the fonts like this in my component: 

```js
className={classNames(poppins.variable, makinac.variable)}
```


### Describe the Bug

![CleanShot 2023-05-04 at 15 10 31@2x](https://user-images.githubusercontent.com/4931832/236214578-345c8e01-af53-472e-b307-3f0c519de387.png)
As you can see here, with this setup, all of the fonts are loaded. The woff **and** the woff2. 

Maybe I missed something, but do you know how I could only make the browser load the right font (woff2) and loading the other one (woff) as a fallback? When I read the doc, the `fallback` key only supports the system-ui fonts. 

Thanks!


### Expected Behavior

Only the woff2 should be loaded in the browser, not the woff version of the font. 

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

Vercel
Repository: rust
Issue: Unreachable statement is not checked for const assertions
Labels: C-bug,A-monomorphization

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I tried this code:

```rust
use core::marker::PhantomData;

struct Check<T: Accept>(PhantomData<T>);
impl<T: Accept> Check<T> {
    const CHECK: () = assert!(T::STREAM);
}

trait Accept {
    type Foo;
    const STREAM: bool = false;
}

impl Accept for u64 {
    type Foo = u64;
    const STREAM: bool = false;
}

struct Foo;

impl Foo {
    fn only_stream<T: Accept>(self, t: T)
    {
        let _ = Check::<T>::CHECK;
        println!("Is stream!");
    }
}

fn get_foo() -> Foo {
    todo!()
}

fn main() {
    let foo: Foo = todo!(); // Comment these out to make it fail to compile
    foo.only_stream(5u64);  // this line as well
    
    let foo = get_foo();
    foo.only_stream(5u64);
}
```

I expected to see this happen: I expected the second line in `main` to cause a compilation failure. But due to the `todo` this does not happen.

Instead, this happened: It compiles, but warns about unused code.

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:

```
Stable 1.69
```

this also happens on nightly `1.71.0-nightly (2023-05-03 473f916d836cc662c5bd)`

Playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c3caf7f91c27f00067173e0e83406a24

Found together with @matthiasbeyer
Repository: TypeScript
Issue: new `Move to file` refactoring should avoid name collisions
Labels: Suggestion,Experience Enhancement

# Suggestion

I tested it in insiders + nightly in the following way:

```ts
export const getData = () => ({
  foo: true
})
const data = getData()
```

```ts
// target file
const getData = () => ({
  bar: false
})

const data = getData()
```

After moving

Actual:

```ts
const getData = () => ({
    bar: false
})

const data = getData()
export const getData = () => ({
    foo: true
})
```

Expected:

```ts
const getData = () => ({
    bar: false
})

const data = getData()
export const getData2 = () => ({
    foo: true
})
// original file:
import { getData2 as getData } from "./file2"

const data = getData()
```



I can even see the test that explicitly captures this case (added by @navya9singh in https://github.com/microsoft/TypeScript/pull/53542):
https://github.com/microsoft/TypeScript/blob/ea6441d3d77963b1c692c8aca023a822e039dc67/tests/cases/fourslash/moveToFile_unresolvedImport.ts that would obviously break real world code after. I would expect `a` to be named as `a2` after moving I guess?

THe real problem is that sometimes you just can't tell wether specific file has confliciting top-level identifiers and you have to rename these symbols either in source or target file, but user also could rename these symbols after the refactoring instead (e.g. `getData2` to something else). Introduce variable / function just use one function call to avoid name collisions:

https://github.com/microsoft/TypeScript/blob/7c378dbab3ab590835c3adbd260f37c97fba1111/src/services/refactors/extractSymbol.ts#LL1042C33-L1042C39

The same thing also applies for names coming from imports:

```ts
// source file
import { groupBy } from 'lodash'

groupBy([], (val) => val)
```

```ts
// target file
import { groupBy } from 'lodash'

groupBy([], (val) => val)
```

After refactor:

```ts
// actual
import { groupBy } from 'lodash'
import { groupBy } from 'rambda'

groupBy([], (val) => val)
groupBy((val) => val, [])
```

```ts
// expected
import { groupBy } from 'lodash'
import { groupBy as groupBy2 } from 'rambda'

groupBy([], (val) => val)
groupBy2((val) => val, [])
```
This code is not broken :shrug :.

This is painful when you have huge project that in process of migration from lodash to rambda api.

## 🔍 Search Terms

## ✅ Viability Checklist

## 📃 Motivating Example

<!--
  If you were announcing this feature in a blog post, what's a short explanation that shows
  a developer why this feature improves the language?
-->

## 💻 Use Cases

<!--
  What do you want to use this for?
  What shortcomings exist with current approaches?
  What workarounds are you using in the meantime?
-->