sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: checkJs: x.js should use x.d.ts for type inference
Labels: Suggestion,Awaiting More Feedback

# Suggestion

<!--
  Please fill in each section completely. Thank you!
-->

## 🔍 Search Terms

checkjs, declaration files

## ✅ Viability Checklist

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).


## ⭐ Suggestion

If a declaration file with the same name than a JavaScript file is available (in the same location), then the declaration file should be used to check the js file.

## 📃 Motivating Example

Assume that "checkJs" and "strict" options are enabled.

Given the following files:
```ts
// @filename a.d.ts
export function f(n: number): number;
```

```ts
// @filename a.js
function f(a) {
    // Parameter 'a' implicitly has an 'any' type
    return a + 1
}
```

the type of `f` should be inferred and should thus type-check. TSC does not currently use `a.d.ts` to infer types of `a.js`.
Note that importing `f` in another js file, already infer `f`'s type

```ts
// @filename b.js
import { f } from "./a.js"
// type of f is inferred
```
Repository: neovim
Issue: LSP: support manual request callback cancellation/modification
Labels: enhancement,lsp

Ran into this issue while working on Julian/lean.nvim#79. In this case, we're certain we want to prevent a callback from occurring, but the language server doesn't "play nicely" and [acknowledge cancellation](https://github.com/neovim/neovim/blob/03d15d9e098d75ddb6962aa9b27c2218e370a3b9/runtime/lua/vim/lsp/rpc.lua#L538)  after `client.cancel_request(req_id)`, which [is needed to `nil` the callback](https://github.com/neovim/neovim/blob/03d15d9e098d75ddb6962aa9b27c2218e370a3b9/runtime/lua/vim/lsp/rpc.lua#L552).

It would seem convenient to expose the `message_callbacks` list from `rpc.lua` via a method like `client.set_request_callback(req_id, callback)`, which would make it possible to not only `nil` the callback, but more generally reset it to a new one, after the request has been made.

Is there a specific reason why these callbacks were hidden entirely? Or is there already some workaround I'm unaware of?
Repository: youtube-dl
Issue: Give mpv the youtube dash mpd url instead of direct video/url
Labels: request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.06.06. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Search the bugtracker for similar feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a feature request
- [x] I've verified that I'm running youtube-dl version **2021.06.06**
- [x] I've searched the bugtracker for similar feature requests including closed ones


## Description

<!--
Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
-->

When i use mpv direct with youtube dash mpd url, the video loads much quicker. Can we have an option that give ytdl the dash url back to mpv (when an extractor can get dash url). In json-output or in the values that gives -g option back.

`youtube-dl "http://youtube.video.link" --try-mpeg-dash-url-instead-of-filename`

thx
Repository: vscode
Issue: Custom dialog removes leading whitespace from lines
Labels: bug,dialogs

```js
"window.dialogStyle": "custom",
```

Example if you use `JSON.stringify(object, null, '    ')` native dialog preserves the whitespaces:

![Screenshot (101)](https://user-images.githubusercontent.com/9638156/124978584-a53e9880-e03a-11eb-9e52-b83761413fab.png)

And custom dialog deletes them:

![Screenshot (102)](https://user-images.githubusercontent.com/9638156/124978594-a96ab600-e03a-11eb-95f1-7bb45ba5768e.png)
Repository: rust
Issue: Inconsistent lifetime rules with parameter patterns
Labels: A-lifetimes,T-compiler,A-patterns,C-discussion

Here's an example derived from https://github.com/rayon-rs/rayon/issues/866:
[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6bdb2536f5a94b3c8afd89d75a597b7e)

```rust
fn main() {
    let mut v = vec![vec![1, 2, 3], vec![4, 5, 6]];

    v.iter_mut().for_each(|mut x| {
        let mut c = x.clone();
        x = &mut c; // borrowed value does not live long enough
        x[0] = 0;
    });

    v.iter_mut().enumerate().for_each(|mut x| {
        let mut c = x.1.clone();
        x.1 = &mut c; // borrowed value does not live long enough
        x.1[0] = 0;
    });

    v.iter_mut().enumerate().for_each(|(_i, mut x)| {
        let mut c = x.clone();
        x = &mut c; // this works!
        x[0] = 0;
    });
}
```

The first two loops fail, because `x` has an "external" lifetime that `c` can't possibly satisfy. However, with the third pattern, `x` gets a local lifetime which _can_ be assigned from `c`. @nikomatsakis explained it this way:

> I think this has to do with the details of how the MIR desugaring works. I'm not sure it's _intentional_, but it's interesting... when you have `(u, mut x)` as the parameter pattern, the closure is effectively converted into this:
> 
> ```rust
> |tmp| {
>      let (u, mut x) = tmp;
> }
> ```
> 
> and so `x` is a local variable inside the closure. Therefore, it's lifetime is independent from `tmp` and it can be given a lifetime that includes the lifetime of `c`. The _actual argument_ (`tmp`) has to have a lifetime that is "external" from the closure body (something the caller could reference).
> 
> If you don't have a pattern (or, rather, you have a trivial pattern like `x`) you get a hard error either way.

> This feels unfortunate, but I'm trying to decide what fix I would want to apply. :)

In the original issue, @evergreen-trading-systems was surprised not to get an error in the destructured case, but I don't think that's something we could (or should) go back on now. It would be more interesting if even the trivial pattern could be made to work with a reduced lifetime.
Repository: node
Issue: Wrong sort return with Intl.Collator
Labels: i18n-api

### Version

v14.17.0

### Platform

#66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

### Subsystem

_No response_

### What steps will reproduce the bug?

[{'name': 'CT'},  {'name': 'CH'}].sort((a, b) => {
  return new Intl.Collator('br', { numeric: true, sensitivity: 'base' }).compare(a.name, b.name)
});

Run the above command in Node 17.



### How often does it reproduce? Is there a required condition?

every time.

### What is the expected behavior?

Output of: [ { name: 'CH' }, { name: 'CT' } ]

(Reproduces in Node 14.16.1)

### What do you see instead?

Output of: [ { name: 'CT' }, { name: 'CH' } ]

### Additional information

_No response_
Repository: youtube-dl
Issue: How to download mp3 of a single episode?
Labels: question

Hi. How to download mp3 of a single episode?
Repository: TypeScript
Issue: Show code comments in union types
Labels: Suggestion,Experience Enhancement

# Suggestion

When I use union types in Typescript, the annotations of the types are missing and cannot be given. I would like to be able to show some code its meaning with the help of annotation hints.

## 🔍 Search Terms

union types comments

## ✅ Viability Checklist

<!--
   Suggestions that don't meet all these criteria are very, very unlikely to be accepted.
   We always recommend reviewing the TypeScript design goals before investing time writing
   a proposal for ideas outside the scope of the project.
-->
My suggestion meets these guidelines:

* [ ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [ ] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).


## ⭐ Suggestion
![image](https://user-images.githubusercontent.com/7822744/125048204-43ca0880-e0d2-11eb-9202-1c83b4a0f356.png)

[playground](https://www.typescriptlang.org/play?ts=4.3.5#code/PQKhCgAIUhBBzAppASogjgVwJYCdEAmkAogHYCGARgDaGQD2ukAcvQC5QjCThsCeAB2QB5AAoAhAAySAjABZIAXkgByMVNlyVAbnCgI0SAHFEpAoiZoseOmSq0ijFu07degkROkyArEtXq3j464O5CkADCwgAixP6BmpAAPpAJvrqh2KRsFgBm5ADGyADKAO7YbAUAFpAA3lCQ2ADOdjSEABQF9OYAXJExxACUfZT09LTkpLoAvqG0bJAAbn1lFdX+9ZCNLRRtBJ3diH1RsYN1DVv4bJi4pJD51E2Iuluz0xmLAHTNrQ7tal5ZMFBkA)

## 📃 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?
-->
Repository: neovim
Issue: How to get global current directory?
Labels: enhancement

how to get global current directory is not clear in the docs
https://github.com/neovim/neovim/blob/1c416892879de6b78038f2cc2f1487eff46abb60/runtime/doc/eval.txt#L4513-L4524

I am using `execute 'cd' getcwd(-1)` in vim
Repository: godot
Issue: Context menu does not disappear on right click in single window mode
Labels: bug,topic:editor,confirmed,topic:gui

### Godot version

4.0.dev (a5b2988a01)

### System information

macOS 11.4

### Issue description

In single window mode, the context menu does not disappear & re-popup on right click.

### Steps to reproduce

1. Make sure the editor is in single window mode.
2. Right click in the script editor or any text box to popup the context menu.
3. Right click somewhere else, the context menu does not disappear & re-popup.

### Minimal reproduction project

_No response_
Repository: TypeScript
Issue: Docs: Incorrect link to d.ts declaration file in wiki doc JavaScript Language Service in Visual Studio
Labels: Docs

https://github.com/microsoft/TypeScript/wiki/JavaScript-Language-Service-in-Visual-Studio#-intellisense-based-on-typescript-declaration-files has a link to [more info](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/declaration%20files/Introduction.md) which is archived.

It should probably be pointed somewhere else. i am unsure where.
Repository: godot
Issue: Profiler silently fails if "Profiler Frame Max Functions" is exceeded
Labels: bug,topic:editor

### Godot version

3.3.2.stable

### System information

5.12.15-arch1-1

### Issue description

If you start the Profiler and the number of called functions exceeds the value set in

> Editor Settings -> Debugger -> Profiler Frame Max Functions

the Profiler will show all 0s for Time and Call

![2021-07-09-074954_1138x223_scrot](https://user-images.githubusercontent.com/65245864/125067307-7c45f400-e08a-11eb-997e-f87e5926baff.png)

Increasing the value to be greater than the number of functions called resolves the issue.

Is it possible to add a warning for when it fails because the maximum is exceeded? There are only two results for "Profiler Frame Max Functions" on Google and I only found it by searching through the source code while troubleshooting the Profiler failure

### Steps to reproduce

In a project with a number of function calls navigate to

> Editor Settings -> Debugger -> Profiler Frame Max Functions

and change the value to a very small number then run the Profiler

### Minimal reproduction project

_No response_
Repository: go
Issue: cmd/compile: eliminate redundant zeroing after lower pass
Labels: Performance,NeedsInvestigation,compiler/runtime

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.16.4 windows/amd64
</pre>

### Does this issue reproduce with the latest release?
Yes


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\tdakkota\AppData\Local\go-build
set GOENV=C:\Users\tdakkota\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\tdakkota\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\tdakkota\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.16.4
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\tdakkota\GolandProjects\gh\abc\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
</pre></details>

### What did you do?

https://go.godbolt.org/z/64qsjGTcd
```go
package foo

func foo(v uint64) (b [8]byte) {
	b[0] = byte(v)
	b[1] = byte(v >> 8)
	b[2] = byte(v >> 16)
	b[3] = byte(v >> 24)
	b[4] = byte(v >> 32)
	b[5] = byte(v >> 40)
	b[6] = byte(v >> 48)
	b[7] = byte(v >> 56)
	return b
}
```


### What did you expect to see?
Compiler should generate 

```asm
        MOVQ    "".v+8(SP), AX
        MOVQ    AX, "".b+16(SP)
```

### What did you see instead?
Compiler generates 
```asm
        MOVQ    $0, "".b+16(SP) // redundant zeroing
        MOVQ    "".v+8(SP), AX
        MOVQ    AX, "".b+16(SP)
```

According to SSA dump and rules, I see that one-byte shift-and-moves are folded to one `MOVQ` during `lower` pass, so zeroing cannot be elimated during `opt` passes. 
https://github.com/golang/go/blob/04cd717a269d94d3b3459a3aaf43bc71e3112b7a/src/cmd/compile/internal/ssa/gen/AMD64.rules#L1965-L1982
Repository: PowerToys
Issue: FancyZone: Please support restore all windows position and size with one hotkey, after windows position and size changed by extend-monitor pull-out and push-in.
Labels: Idea-Enhancement,Product-FancyZones

### Description of the new feature / enhancement

I have config all of window position and size into three layouts for every monitor, 
but after my laptop pull-out all extend-monitor, the windows size and position changed. 
And then I push-in all extend monitor,  the windows postion and size hadn't' been restored.
Even I tried config hotkey, but there is not hotkey for saving and restore. 
So, how to use this tool for restore windows position and size after extend-monitor pull-out&push-in.

### Scenario when this would be used?

Please support restore all windows position and size with one hotkey, after windows position and size changed by extend-monitor pull-out and push-in.

### Supporting information

windows 10.
Repository: pytorch
Issue: New module: Split log softmax with loss
Labels: feature,module: nn,triaged

## 🚀 Feature: SplitLogSoftmaxWithLoss
<!-- A clear and concise description of the feature proposal -->

An approximation of Log Softmax based on [splitsoftmax](https://gist.github.com/alisafaya/785e431539917cfbaab23281b77699d9). 

## Motivation

<!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->

The current and only existing softmax approximation module in pytorch [AdaptiveLogSoftmaxWithLoss](https://pytorch.org/docs/stable/generated/torch.nn.AdaptiveLogSoftmaxWithLoss.html#torch.nn.AdaptiveLogSoftmaxWithLoss) implementation is that it has two downsides: 

- You cannot share weights with Embedding layer when using it for sequence modeling tasks.
- You are bound to pass your input through two sequential linear layers, even if you choose `div_value = 1.0` 

## Pitch

<!-- A clear and concise description of what you want to happen. -->

I would like to introduce `SplitLogSoftmaxWithLoss` module to PyTorch. This module calculates an approximation of `nn.CrossEntropyLoss`. This module splits the possible outputs of Softmax into multiple clusters the same way [AdaptiveLogSoftmaxWithLoss](https://pytorch.org/docs/stable/generated/torch.nn.AdaptiveLogSoftmaxWithLoss.html#torch.nn.AdaptiveLogSoftmaxWithLoss) does, the main difference is that `SplitLogSoftmaxWithLoss` does not use smaller sequential linear layers for projecting the input of Softmax into the final output, but it uses a single linear layer with the same size. This is similar to setting `div_value = 1.0` in `AdaptiveLogSoftmaxWithLoss`. But this way you can make use of sharing weights between the `Embedding` layer and the final `Projection` layer inside  `SplitLogSoftmaxWithLoss`. 

I have prepared a working implementation of it in this gist [splitsoftmax.py](https://gist.github.com/alisafaya/785e431539917cfbaab23281b77699d9) based on [splitcross](https://github.com/ari-holtzman/genlm/blob/master/splitcross.py). The original splitcross implementation doesn't support multiple splits `cutoffs`, where as the one I am sharing supports them. 


cc @albanD @mruberry @jbschlosser
Repository: pytorch
Issue: Reduce with any(), all(), median() over multiple dimensions
Labels: triaged,enhancement,module: numpy,module: reductions

## 🚀 Feature
I propose to add the ability to reduce a tensor with `any(), all(), median()` over _multiple_ dimensions not just one.

## Motivation
Functions that reduce a tensor have the same arguments `dim`/`keepdim`. This includes things like `sum(), mean()`. But unlike `sum()` the functions mentioned above can only reduce over a _single_ dimension. Adding the ability to pass tuples and not only ints to the `dim` argument would greatly simplify a lot of code.

## Pitch
I propose adding the ability to pass tuples and not only ints to the `dim` argument of these "reducing"  tensor functions:
`any(), all(), median()`
so they have a consistent behaviour with `sum()` and `mean()`. Maybe there are other functions that I'm not aware of that also fall into this category: The general idea is that we could make all functions consistent that reduce a tensor by a dimension by applying an associative operation over the entries along the dimension.

For `min()`, and `max()` this was solved by introducing `amin()` and `amax()` (see https://github.com/pytorch/pytorch/pull/43092). For `sum()` this was implemented in https://github.com/pytorch/pytorch/pull/6152 We also have it for `var()` and `std()` https://github.com/pytorch/pytorch/issues/824

## Alternatives

none



cc @mruberry @rgommers @heitorschueroff
Repository: rust
Issue: don't eagerly emit errors when evaluating constants during selection
Labels: T-compiler,C-bug,A-const-generics,D-verbose,F-generic_const_exprs

```rust
#![feature(const_generics, const_evaluatable_checked)]

struct Bar<const N: usize>;
trait Foo {}

impl<const N: usize> Foo for Bar<N> where [u8; N - 1]:  {}

impl Foo for Bar<0> {}

```
currently errors with
```
error[E0080]: evaluation of `<Bar<0_usize> as Foo>::{constant#0}` failed
 --> src/lib.rs:6:48
  |
6 | impl<const N: usize> Foo for Bar<N> where [u8; N - 1]:  {}
  |                                                ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
```
while checking whether the two impls overlap during coherence. Failing to evaluate a generic constant in the where clauses should not eagerly cause an error if it happens during selection. See #81339 for how to fix this issue, I did not have the capacity to finish that PR.


<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

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

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: pytorch
Issue: using DistributedSampler   occur RuntimeError: Expected a 'cuda:0' generator device but found 'cpu'
Labels: oncall: distributed,module: dataloader,triaged

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->

## To Reproduce

Steps to reproduce the behavior:

1.
1.
1.

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment

Please copy and paste the output from our
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py)
(or fill out the checklist below manually).

You can get the script and run it with:
```
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```

 - PyTorch Version (e.g., 1.0):
 - OS (e.g., Linux):
 - How you installed PyTorch (`conda`, `pip`, source):
 - Build command you used (if compiling from source):
 - Python version:
 - CUDA/cuDNN version:
 - GPU models and configuration:
 - Any other relevant information:

## Additional context

<!-- Add any other context about the problem here. -->


cc @SsnL @VitalyFedyunin @ejguan @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @agolynski @SciPioneer @H-Huang @mrzzd @cbalioglu @gcramer23