sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Assertion signature on generics doesn't narrow
Labels: Bug,Help Wanted

### 🔎 Search Terms

Assertion AND signature

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about Assertion Signatures, Generics.


### ⏯ Playground Link

https://www.typescriptlang.org/play/?noUncheckedIndexedAccess=true&allowUnusedLabels=true&downlevelIteration=true&noEmitHelpers=true&noUnusedLocals=true&noUnusedParameters=true&preserveConstEnums=true&removeComments=true&importHelpers=true&target=99&useUnknownInCatchVariables=false&exactOptionalPropertyTypes=true&noImplicitOverride=true&noFallthroughCasesInSwitch=true&noPropertyAccessFromIndexSignature=true&inlineSourceMap=true&inlineSources=true&stripInternal=true&ts=5.6.2#code/FAehAICIHEHtYCbgIYGdUFMBOAXSAucAW2QGsNVwEKcsBXAYxzqwEsA7Ac3FUYYwwJQEAGZ12TVrHYp02HAAoGhcaXawA7uwCUhNJlyUG4AN7DwFi6xHgFAQgbbT5y6-A4AFlk3h2GDeAAKgCeAA4YAKJY3lgKAOQAgnK4UjIiyKwANoJx2gDcLpYAvuYl5pAAQshI+vIEVDT0TCwc3NgxwGISOKmyBjgAPADCAHxKhEO6ffJGzq7Wtg5OZm6Wnt4BfgEh4VEx8Un9velZOfnAriVlGAAeobC44F2S0u40CpkcFISotK0A2gBdKa-NhcIHOC6rcDZHBPcTKObQ1zsZBEDA-P5cArI1yfPyoTFgzhAnHQorgAA+vjomUy4AAvDS6QUoasRA9bAxpL8YV9wLAbPiKMs2biFgoALLITwAOiwyHYCFgRAUTgG4AADLKAKyi3HQ56MpEG5Go9GESAARw02EgABoxaa3MLCeB-sLAY7nZcyQaKRhMpgTT7argFM9zj7LNz2LyTOaMPa+QSKUznnlLGBwAMGXnwBEAEqFgDyhfAAAkixEnabXbLQnRUB4Pl8o9HpuHE+A7Pm4sgAEYMXJ+3ElZHj6ESyO11ZYDDMLBpBGy12j1zzxcyNdiopAA

### 💻 Code

```ts

// "Good assert": makes destructuring succeed
// function assert(c: unknown): asserts c {
//     if (!c) {
//         throw new TypeError('Assertion failed');
//     }
// }

// "Bad assert": destructuring error
function assert<C>(c: C): asserts c {
    if (!c) {
        throw new TypeError('Assertion failed');
    }
}

export function test(lines: string[]): string[] {

        let func: {
            name: string;
            lines: string[];
        } | null = null;

        for (const line of lines) {
            if (Math.random() < 0.5) {
                func = {
                    name: "qwer",
                    lines: [line],
                };
            } else {
                assert(func);
                const {name, lines} = func;   // <=== ERROR HERE: 'name' implicitly has type 'any'
                lines.push(line);
                assert(name !== 'abc');
            }
        }
        if (func)
            return func.lines;
        return lines;
    }
```


### 🙁 Actual behavior


When the generic-assert implementation is active, the line -
```ts
const {name, lines} = func;
```
errors with `'name' implicitly has type 'any'`.

When the `unknown` assert implementation is active, types are properly inferred.

### 🙂 Expected behavior

Both `assert` versions contain assertion signature, and both should be able to narrow the type.

### Additional information about the issue

_No response_
Repository: vscode
Issue: VSCode opens automatically when I plug in a mass storage device or click on "open with File Manager" (dolphin)
Labels: bug,install-update,linux,confirmation-pending

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No
yes
<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 
- 1.93
- OS Version: 
- Kubuntu 23.10

Steps to Reproduce:

1. plug in msc
2. click on "open with file manager"


I think vscode helped itself to auto-handle some mime-type that I did not ask it to, which usually gets handled by dolphin. Please don't do this microsoft. undo it. really lame mcro d*** move. vscode is awesome, but disguisting to consider itself anywhere close to a sufficient replacement for dolphin.
Repository: PowerToys
Issue: Markdown Preview Blocks Pictures
Labels: Issue-Bug,Product-File Explorer,Needs-Triage

### Microsoft PowerToys version

0.84.1

### Installation method

WinGet

### Running as admin

None

### Area(s) with issue?

File Explorer: Preview Pane

### Steps to reproduce

Open a Markdown with picture links.

### ✔️ Expected Behavior

Show the formatted Markdown WITH linked pictures.

This was previously discussed in Issue #3713 in May of 2020 with few comments, no resolution, and then closed.  I have been using this Preview feature since it arrived and only recently, since July, has this become a problem for me.  Not sure what changed.

### ❌ Actual Behavior

The message "Some pictures have been blocked to help prevent the sender from identifying this computer. Open this item to view pictures." is shown at the top of the preview pane and a small icon with an "X" is shown where pictures are supposed to be shown

### Other Software

_No response_
Repository: vscode
Issue: Notebook Diff editor changes
Labels: debt,notebook-diff

With the introduction of a collapsible input section in diff view, we now have 3 collapsible sections - Input, Metadata, Output
With all of these sections, we have pretty much the same code to calculate heights of each section.
We also have 3 editors per cell, 1 in each section (input editor, metadata editor, output json editor)

* Most of this can be simplified to make it common
* We might want to ensure some of the layout calculations can be unit tested as well 
E.g. The calculation of height can be validated in unit tests
Right now there are no tests to verify this, hence if height calculations are incorrect there's a lot of shifting of ui
* Unit tests to ensure the layout doesn't change more than once 
I.e. when loading a cell diff for input and metadata the height should be determine in one sweep.
E.g. if calculation is wrong, then editor is painted the actual height will be different from original calculated, hence there's a re-layout, causing shifting in ui...
Repository: neovim
Issue: LSP: lsp.completion with completeopt=noinsert,menuone aggressively inserts text
Labels: bug,lsp,completion

### Problem
I try lsp.completion, and it is almost unusable for me because it aggressively insert text to my buffer instead of letting me choose it first.




### Steps to reproduce using "nvim -u minimal_init.lua"

   * Install pyright 
   ```sh
npm i -g pyright
```
   
* Create minimal_init.lua in the current directory
```sh
touch minimal_init.lua
```

Add these lines to `minimal_init.lua`
```lua
 vim.api.nvim_create_autocmd('FileType', {
	-- This handler will fire when the buffer's 'filetype' is "python"
	pattern = 'python',
	callback = function(args)
		vim.lsp.start({
			name = 'pyright',
			cmd = { 'pyright-langserver', '--stdio' },

			-- Set the "root directory" to the parent directory of the file in the
			-- current buffer (`args.buf`) that contains either a "setup.py" or a
			-- "pyproject.toml" file. Files that share a root directory will reuse
			-- the connection to the same LSP server.
			root_dir = vim.fs.root(args.buf, { 'setup.py', 'pyproject.toml' }),
		})
	end,
})

vim.api.nvim_create_autocmd('LspAttach', {
	callback = function(args)
		local client = vim.lsp.get_client_by_id(args.data.client_id)
		if client.supports_method('textDocument/completion') and vim.lsp.completion then
			-- Enable auto-completion
			vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
		end
	end,
})
```

Run Neovim with minimal_init 
```sh
nvim -u minimal_init.lua
```

Create a python file (for example `main.py`) and write a line 
```python
print("
```

You will see what I saw right after you type the quotation mark


### Expected behavior

I want it to just show the suggestions list and let me choose from one of them instead of directly insert the word to my buffer


### Nvim version (nvim -v)

Neovim v0.11.0-dev-888+g4075e613b

### Language server name/version

pyright 1.1.383

### Operating system/version

Ubuntu 24.04.01

### Log file

_No response_
Repository: pytorch
Issue: Not decomposing CompositeImplicitAutograd ops in post-dispatch export changes autocast (and possibly more) behavior when compared with eager mode
Labels: triaged,oncall: pt2,export-triaged,oncall: export

Let’s assume we have a CompositeImplicitAutograd op foo that calls torch.prod. If we have the following function:
```py
def f(x):
    with torch.amp.autocast(“cpu”):
        return torch.ops.aten.foo(x)
```

then if we do post-dispatch export:
- if we don’t preserve aten.foo, then prod will get autocast behavior, resulting a graph that looks like the following:
```py
def graph(x):
    y = x.to(float32)
    z = at::prod(y)
    return z
```
- If we do preserve aten.foo, then the prod inside it will never get the autocast behavior! If x is lower precision (float16), we don’t end up upcasting for prod, then our model becomes numerically unstable.
```py
def graph(x):
    # Note that there is no upcast to float32
    y = torch.ops.aten.foo(x)
    return y
```

We can probably reproduce this for other DispatchKey-based subsystems as well. 

## Potential solutions

Solution 1: If we want to be really correct about these things, then in the export graph there should be an autocast HOP, like the following:
```py
def graph(x):
    y = run_with_autocast_state(torch.ops.aten.foo, x)
    return y
```

`run_with_autocast_state` turns on torch.amp.autocast while running the operator -- when this graph gets executed, then `foo` will decompose into `prod`, which will then have its input upcasted.

Solution 2: If autocast is enabled, require the user give us an autocast registration for any compositeimplicitautograd ops that we don't want to decompose.


cc @ezyang @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4
Repository: pytorch
Issue: Device transfer for NJT within torch.compile allocates a new nested int
Labels: triaged,module: nestedtensor,oncall: pt2

Note that this differs from eager behavior for `njt.to(device)`, where the nested int from the input shape is purposefully includes in the output shape, as expected.

Repro:

```python
import torch

def f(nt):
    return nt.to(device="cpu")

compiled_f = torch.compile(f)

nt = torch.nested.nested_tensor([
    torch.randn(2, 5),
    torch.randn(3, 5),
    torch.randn(4, 5),
], layout=torch.jagged, device="cuda")

out = f(nt)
out_compile = compiled_f(nt)
# fails; torch.Size([7, j1]) for out and torch.Size([7, j2]) for out_compile
assert out.shape == out_compile.shape
```

cc @cpuhrsch @bhosmer @drisspg @soulitzer @davidberard98 @YuqingJ @ezyang @chauhang @penguinwu
Repository: PowerToys
Issue: [Workspaces] WinSCP not loading at the correct location
Labels: Issue-Bug,Needs-Triage,Product-Workspaces

### Microsoft PowerToys version

0.85.0

### Installation method

PowerToys auto-update

### Running as admin

No

### Area(s) with issue?

Workspaces

### Steps to reproduce

Install https://winscp.net/eng/download.php
Save a workspace with the WinSCP window
Open WinSCP manually, move the windows to another location and close it to make windows save that location.
Launch the workspace.

### ✔️ Expected Behavior

WinSCP launches in the workspace saved location.

### ❌ Actual Behavior

WinSCP launches in the windows saved location.

### Other Software

Win 11 23H2
Repository: godot
Issue: Unable to Export for NativeAOT on Android
Labels: enhancement,platform:android,topic:dotnet,topic:export

### Tested versions

- Reproducible in v4.3.stable.mono

### System information

Windows 11

### Issue description

**The Problem**
I've been testing my game on various mobile devices with high end and low end targets. On one of the lower end targets (Google Pixel 4a) a cold startup takes about ~26 seconds! This is an unacceptably slow startup time considering my game's binary is under 250mb. On empty Godot projects the startup time is excellent, and I had a hard time believing the assets being loaded was adding all that extra time.

**The Source**
Long story short it seems to be a long standing issue that the dotnet runtime on Android has a slow startup time because of `JIT` compilation and other various factors. This is something that's been hotly debated with projects such as Xamarin and its successor Maui. One solution to this is native ahead of time compilation. Starting with `.NET 8,` there's experimental support for Android.

**The Bug**
As of `4.3,` Godot [doesn't support](https://godotengine.org/article/platform-state-in-csharp-for-godot-4-2/) `NativeAOT` out of the box for Android. Just mono. `iOS` also has experimental support within the dotnet runtime, but that is supported in Godot (or at least that's the default functionality since `NativeAOT` is required on `iOS`). 

To enable `NativeAOT` all one must do is use the `<PublishAOT>` tag in the `.csproj` file. The problem is, to make it work properly, other tags are needed that are overridden by Godot during the export process which is the bug. On such example is the `RuntimeIdenitifer` tag. `linux-bionic-arm64` is the currently used runtime identifier for `NativeAOT` but Godot always overrides it to `android-arm64` even when it's specified in the `.csproj` file. So, theoretically Godot can support `NativeAOT` on android with this limitation lifted.


### Steps to reproduce

1. Create project with C# script.
2. Export for android with `NativeAOT` enabled.
3. Build fails.

### Minimal reproduction project (MRP)

N/A
Repository: godot
Issue: Bone editor does not have the ability to set rest directly
Labels: topic:editor,documentation,topic:3d

### Tested versions

Reproducible in v4.3.stable.official

### System information

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - integrated Intel(R) UHD Graphics (Intel Corporation; 31.0.101.2125) - Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 Threads)

### Issue description

I was using a game template that I think was probably from an older version of Godot, and I noticed that the Errors console was being flooded with an error reading "invert: condition "det == 0" is true". After a little research, I found out I needed to fix the resting positions of some bones that had been incorrectly configured. However, when I tried, I found that the options to do so were grayed out.
![image](https://github.com/user-attachments/assets/fec08b59-b38b-4946-9927-f9d82c77bc44)

### Steps to reproduce

1. Open the MRP.
2. In gobot.tscn, click on the Skeleton3D node under Armature.
3. Click on the FootL or FootR bones.
4. Attempt to edit the values under Rest. If the issue is with the model like I can only assume it is, they should be uneditable.

### Minimal reproduction project (MRP)

[Let Me Edit My Bones You Fuck.zip](https://github.com/user-attachments/files/17247439/Let.Me.Edit.My.Bones.You.Fuck.zip)
Repository: neovim
Issue: :profile can "stream" to its file eagerly instead of batched
Labels: enhancement,performance,vimscript,lua

### Problem

I wish there were a proper way to debug non-recoverable hangs.

The current profile command works for only recoverable hangs. What do I mean by it ? 
I recently had a hang that seemed quite long. I could reproduce it , and do `profile start`  before it happens. However, in case the hang was infinite (which happened in other cases) , there is really no way to debug. Because you can't run `profile stop` and no file is generated.



### Expected behavior

Could there be a command that generates a stream of function calls (something that I guess profile uses internally)  ? 
So that if at certain point there is a freeze, you can see the last calls.

Thanks
Repository: TypeScript
Issue: Improve module resolution using "paths" of "tsconfig.json" file
Labels: Suggestion,Awaiting More Feedback

### 🔍 Search Terms

Today the "paths" property only accepts the asterisk as a wildcard character, which means it is necessary to keep redeclaring other modules when they are in subdirectories, example:

```json
{
  "compilerOptions": {
    "paths": {
      "libs/async": ["libs/async/src"],
      "libs/async/*": ["libs/async/src/*"],
      "libs/crypto": ["libs/crypto/src"],
      "libs/crypto/*": ["libs/crypto/src/*"],
      "libs/database": ["libs/database/src"],
      "libs/database/*": ["libs/database/src/*"],
      "libs/domain": ["libs/domain/src"],
      "libs/domain/*": ["libs/domain/src/*"],
      "libs/logger": ["libs/logger/src"],
      "libs/logger/*": ["libs/logger/src/*"],
    }
  }
}
```

Wouldn't it be interesting to accept other characters as it happens with regex? Example:

```json
{
  "compilerOptions": {
    "paths": {
      "libs/$1": ["libs/$1/src"],
      "libs/$1/*": ["libs/$1/src/*"],
    }
  }
}
```

This would make TypeScript resolution more dynamic, making it easier to set up monorepos.

### ✅ 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 isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- [X] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals

### ⭐ Suggestion

Add more wildcards to "paths" property in tsconfig.json, like dynamic directory names (`$0` for example), or create a way to use JS/TS to build and return the tsconfig object, with this I can trace the workspace folder extracting all directores needed.

### 📃 Motivating Example

Normally i'm use only one or 2 paths in tsconfig but I had started to work with NestJS using workspaces and each new app or library need to be added into a new element

### 💻 Use Cases

1. What do you want to use this for?

Any project using workspaces and having lots of sub packages

2. What shortcomings exist with current approaches?

Today is required to declare every directory manually every time when a new app or lib are created in NestJS workspace

3. What workarounds are you using in the meantime?

Today i need to make every change manually...
Repository: pytorch
Issue: Docs are little bit outdated for torch logs
Labels: good first issue,module: logging,triaged,oncall: pt2

### 📚 The doc issue

At the end of setup here I assume the output should be some log describing the program rather than saying that the device does not support torch.compile.

https://pytorch.org/tutorials/recipes/torch_logs.html#setup

### Suggest a potential alternative/fix

Run the program in the tutorial and update the doc :) 

cc @ezyang @chauhang @penguinwu
Repository: go
Issue: net: support Linux vsock sockets
Labels: NeedsInvestigation

### Proposal Details

There exists basic support for `AF_VSOCK` sockets implemented in #19434.

Could support for such sockets please be added to the net module? For example `net.FileListener` can operate on TCP and UNIX sockets, but fails on vsock sockets.
Repository: electron
Issue: [Feature Request]: Add ability to register IPC Main Listeners that do not consume the event object
Labels: enhancement :sparkles:

### Preflight Checklist

- [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [x] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

When writing ipcMain handlers, I often find myself wishing to discard the event (especially for handlers that serve another function and might be called from other functions from the backend.

### Proposed Solution

I suggest that the handlers described should have overloads added that do not require the event to be specified, eliminating this use case entirely. This would prevent duplication of parameters (as described in solution 1), non-type specific anonymous functions (solution 2), or the need for helper functions (solution 3).

### Alternatives Considered

This leads me to one of the following user-side solutions:

```typescript
ipcMain.on('channel', (_e: unknown, ...args: Parameters<typeof myHandlerFunction>)
    : Promise<void> => myHandlerFunction(...args));`
```
```typescript
ipcMain.on('channel', (_e: unknown, arg1: string, arg2: string)
     : Promise<void> => myHandlerFunction(arg1, arg2)); 
```
```typescript
/**
 * Accepts a function and arguments from IPC, discards the event argument sends the rest to the function with the specified type.
 * @param handler
 * @returns callable to handle IPC event
 */
export default function handleEvent<T extends (...args: Parameters<T>) => ReturnType<T>>(handler: T) {
  return (_e: unknown, ...args: Parameters<T>): ReturnType<T> => handler(...args);
}

ipcMain.on('channel', handleEvent(myHandlerFunction));
```

### Additional Information

_No response_
Repository: kubernetes
Issue: `/proxy/stats/summary` returning incorrect PVC capacity bytes
Labels: kind/bug,sig/storage,triage/needs-information,triage/accepted

<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!

If the matter is security related, please disclose it privately see https://github.com/kubernetes/kube-state-metrics/blob/main/SECURITY.md
-->

**What happened**:

When querying `kubectl get --raw /api/v1/nodes/<node-ip>/proxy/stats/summary`, the capacity bytes returned for PVCs are not what are shown in tools like k9s which therefore tell me that tooling built around this endpoint will show incorrect values.

**What you expected to happen**:

PVC capacity and other metrics show the correct sizes

**How to reproduce it (as minimally and precisely as possible)**:

```bash
$ kubectl get --raw "/api/v1/nodes/ip-<>.ec2.internal/proxy/stats/summary"
...
        {
          "time": "2024-09-30T18:27:06Z",
          "availableBytes": 467653439488,
          "capacityBytes": 1623168045056,
          "usedBytes": 1155497828352,
          "inodesFree": 100516333,
          "inodes": 100663296,
          "inodesUsed": 146963,
          "name": "pvc-data",
          "pvcRef": {
            "name": "name-pvc",
            "namespace": "namespace-pvc"
          }
        },
...
```

Take capacity bytes, convert to GiB/MiB, compare with k9s or other tooling for `spec.resources.requests.storage`

I used: `kubectl get pvc name-pvc -o json` to get the spec requests to compare against (which was larger by 125 MiB):
```
    },
    "spec": {
        "accessModes": [
            "ReadWriteOnce"
        ],
        "resources": {
            "requests": {
                "storage": "9600Gi"
            }
        },
```

**Anything else we need to know?**:

**Environment**:

* kube-state-metrics version:
* Kubernetes version (use `kubectl version`): v1.27.14
* Cloud provider or hardware configuration: AWS EKS
* Other info: