sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: cmd/cgo: []byte argument has Go pointer to Go pointer
Labels: NeedsFix

With Go 1.11 and HEAD: `go version devel +a2a3dd00c9 Thu Sep 13 09:52:57 2018 +0000 darwin/amd64`, the following program:

```
package main

// void f(void* ptr) {}
import "C"

import (
	"compress/gzip"
	"unsafe"
)

type cgoWriter struct{}

func (cgoWriter) Write(p []byte) (int, error) {
	ptr := unsafe.Pointer(&p[0])
	C.f(ptr)
	return 0, nil
}

func main() {
	w := cgoWriter{}
	gzw := gzip.NewWriter(w)
	gzw.Close() // calls cgoWriter.Write
}
```

Panics:

```
panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running]:
main.cgoWriter.Write.func1(0xc00015e020)
	/Users/crawshaw/junk.go:15 +0x48
main.cgoWriter.Write(0xc00015e020, 0x1, 0xf8, 0xc0000b1e50, 0x4027ff1, 0x40dad60)
	/Users/crawshaw/junk.go:15 +0x35
compress/flate.(*huffmanBitWriter).write(0xc00015e000, 0xc00015e020, 0x1, 0xf8)
	/Users/crawshaw/go/go/src/compress/flate/huffman_bit_writer.go:136 +0x5f
compress/flate.(*huffmanBitWriter).flush(0xc00015e000)
	/Users/crawshaw/go/go/src/compress/flate/huffman_bit_writer.go:128 +0xb7
compress/flate.(*huffmanBitWriter).writeStoredHeader(0xc00015e000, 0x0, 0x1)
	/Users/crawshaw/go/go/src/compress/flate/huffman_bit_writer.go:412 +0x63
compress/flate.(*compressor).close(0xc0000ba000, 0x0, 0xc0000a62b0)
	/Users/crawshaw/go/go/src/compress/flate/deflate.go:647 +0x83
compress/flate.(*Writer).Close(0xc0000ba000, 0x0, 0x0)
	/Users/crawshaw/go/go/src/compress/flate/deflate.go:729 +0x2d
compress/gzip.(*Writer).Close(0xc0000a6210, 0x419bf30, 0xc0000a6210)
	/Users/crawshaw/go/go/src/compress/gzip/gzip.go:242 +0x6e
main.main()
	/Users/crawshaw/junk.go:22 +0x47
```

I suspect (but cannot yet show that) this is related to the fact that gzip.Writer is passing a []byte to the Write method made out of an array field of the gzip.Writer struct.
Repository: create-react-app
Issue: Svg will crack when import with ReactComponent
Labels: issue: needs investigation

I have several needs to hover a button and change color of the svg path stroke/fill
It will work perfectly most of time I use it as a component can assign a classname.
While sometimes the svg image will crack and I sure it is complete when I use it as <img src=...> 
I think it is a bug, thanks for help 

FYI  svg source : https://reurl.cc/8yAkX

> Import {ReactComopnent as Graph } from '..../.svg'
> 
> render() .... 
> <div> < Graph/> </div> 

npm 6.4.1
react 16.6.0

---------------------------------------------------------------------------------------------
Thanks for your patient :)
I finally get a simple one.
Here is the code :
```
import React, { Component } from 'react';
import './App.css';
import {ReactComponent as A }　from './A.svg'
import  {ReactComponent as B }　from './B.svg'
class App extends Component {
  render() {
    return (
      <div className="App">
       <A/>
       <B/>
      </div>
    );
  }
}
export default App;
```


and FYI here is those 2 svg 
https://reurl.cc/ZGlzg
https://reurl.cc/gWnEV

btw, you might need set background color to see it clearly.

This is how it happened : 
as long as I use them in the same time, one specific svg will crack.
In this situation, B will become an incomplete image... 
like [this](https://reurl.cc/6abRd) : 
Not for every svg. I try to edit svg like delete <defs> and <mask>
It works only for another svg..., but not for every svg files.
Thanks for help
Repository: node
Issue: discussion: put subsystem, team and label metadata in file(s) in this repo
Labels: discuss,meta

Right now there are multiple places that somewhat capture the label and subsystem metadata in this repo:

In core-validate-commit:

https://github.com/nodejs/core-validate-commit/blob/4e64157b6a87267fd4b9f0598159eeb968e04e21/lib/rules/subsystem.js#L5-L68

In github-bot:

https://github.com/nodejs/github-bot/blob/8d4b7199f871fe37f2528520e79a0d8568960184/lib/node-labels.js#L5-L139

And of course the source of truth about labels is https://github.com/nodejs/node/labels

There is also discussion about automation of pinging teams, similar to how the now-removed CODEOWNERS file used to work (because the GitHub implementation didn't actually work for us). But to implement any of that, we will need this information actually written down somewhere in some format

https://github.com/nodejs/automation/issues/27

Also related: Store list of collaborators and TSC in a JSON file https://github.com/nodejs/node/issues/23623

Note that one of the reasons that CODEOWNERS is removed is that the pinging only worked for teams who have write access to this repo, and in core there are two type of groups we need to ping: WGs or teams whose members may or may not have write access but need to be informed (observers), and collaborators who tend to review the files more often than the others (owners).

At a glance, I think the information is basically a mapping of `file_pattern -> (subsystem, owners[], observers[], labels[])` - but maybe there is more e.g. precedence and hierarchy. (note that subsystems are not equivalent to labels, as labels can be `dont-land-*`)

I propose to put this information in this repo, and then we could figure out how to utilize it for automation - but it still has value even just as a general dictionary to look things up, even for humans.

On the automation's side - we could use it to ping people (or just suggest to you who to ping without actually pinging them so you don't accidentally create noise), to request reviews, to check reviews when landing PRs, to make sure the labels and their descriptions are not out of date, to dynamically introduce new subsystems in commit messages (to validate) etc. More importantly we can introduce new meta information and remove them by submitting PRs to these meta files instead of updating all the relevant projects (e.g. the bot doesn't know about all the files and the dont-land labels there are really out of date. If it just grabs the information from the master, we are more likely to keep the information up-to-date).

I don't know if there is a particularly good format, maybe a JSON or YAML? Or a variant of the removed CODEOWNERS (see https://github.com/nodejs/node/pull/21161) file?

For reference, WPT uses a [META.yml](https://github.com/web-platform-tests/wpt/blob/master/url/META.yml), v8 uses [OWNERS](https://github.com/v8/v8/blob/master/src/OWNERS), both seem to be home-grown files placed in different level of directories.
Repository: vscode
Issue: [theme] inspect tool for workbench colors
Labels: feature-request,themes

Issue Type: Feature Request
Relevant Issues: There was one but I'm unable to find it, this is an idea to perhaps explore it. Maybe the bot can find it.

## Live Editor Theming
The original issue puts forward the idea of live editing a theme, such that when a change is applied, it's applied automatically without reloads and allows the developee to see what exactly changed. There are still a few downsides that I feel this feature request would solve. But before I explain, I'll describe my idea to push it further.


## Idea In-depth
My plan is to perhaps be able to have a 'Theme Dev Mode' of some sorts where the editor is put into a 'frozen' state (by this, I don't mean a 'Not Responding' state, but rather you can't type, UI actions don't do anything but are toggleable, basically a disabled state) and devs are able to click on various UI elements or scopes to open a pop up detailing all the possible relevant scopes that can be defined.

This is similar to the current `Developer: Inspect TM Scopes` but adds in support for UI too, and would be part of the 'live' experience

## How would this benefit developers
The original issue stated that it would help theme developers (the live theme idea in general), and I believe this notion. would. boost the efficiency further. Currently many devs probably go to the docs to find their relevant UI scope, but this could be made easier as the pop ups detailed here could also be powered by docs. 

## Issues this specific idea would solve
(relating to this idea, not necessarily the original issue)

- Time consumed searching for scopes
- Much more friendly towards new devs


Cons:
- May be hard to implement, though the 'disabled' state is one thatvs started groundwork in the Walkthrough on the Welcome page
Repository: godot
Issue: Some shortcuts on macOS don't work
Labels: bug,platform:macos,topic:editor,confirmed

**Godot version:**
3.0.6

**OS/device including version:**
mac os x, "High Sierra", Version 10.13.6 (17G2307)

**Issue description:**
I'm facing the issue that some shortcuts on my mac don't work though they are configured in the editor settings as shortcuts.

Examples of working and not working shortcuts:: 

ctrl+cmd+D - toggle fullscreen: works

ctrl+cmd+D - switch to distraction free view: does not work

shift+cmd+O - open scene: works

cmd+y - restore after undo: works

cmd+y - custom shortcut to delete line: does not work, though the default behaviour for cmd-y (restore) has been removed

There are also shortcuts that have an _unexpected_ behaviour. For example pressing alt+1 inside the text editor. Instead of switching to the 2d scene editor a special char is insert.

And I also would like to add a *comment* regarding cmd+left and cmd+right and cmd+backspace:
cmd+left/right works in the text editor, but (mostly) not in editor form fields. 
cmd+backspace deletes on mac os the whole line. No effect in Godot (text editor included), although if I set cmd+backspace in the preferences to delete a line

**Steps to reproduce:**
Open the script editor and press the hotkeys
Repository: TypeScript
Issue: Annoyingly useless Symbol completions
Labels: Bug,Help Wanted,Effort: Moderate,Domain: Completion Lists

```ts
""./**/
```

![image](https://user-images.githubusercontent.com/972891/48051834-10818f80-e15b-11e8-99cb-6f757453db38.png)

I guess the way I think about it, element access completions are pretty uncommon and should be considered lower-priority; and yet, they're the top item I'm given in a completion list. Is this for discoverability?

Additionally, if I actually commit to these completions, I end up *outside* of the place I want to continue typing:

```ts
""[Symbol]/*we currently end up here!*/

""[Symbol/*rather than here!*/]

""[Symbol./*or potentially here!*/]
```
Repository: TypeScript
Issue: API: Allow passing TypeScript.SourceFile / AST directly to transpileModule
Labels: Suggestion,In Discussion,API

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section.

-->

## Search Terms

transpileModule directly AST SourceFile source performance

<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

## Suggestion

<!-- A summary of what you'd like to see added or changed -->

Currently, [`TypeScript.transpileModule`](https://github.com/Microsoft/TypeScript/blob/865b3e786277233585e1586edba52bf837b61b71/src/services/transpile.ts#L26) accepts string and option as parameters. It would be nice to have another method like this which can accept `TypeScript.SourceFile` directly.

## Use Cases

<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->

Currently I'm building [a parser which accepts JS](https://github.com/ryanelian/instapack/blob/terser/src/SyntaxLevelChecker.test.ts) for scanning whether ECMAScript syntax above user's project language level / `tsconfig.json:target` is used. *(For example: Your project targets ES2015 but one of the library imported uses ES2017 async-await syntax)*

When benchmarked, simply scanning the AST is faster (medium-sized project: 2s. no scan: 1 second) rather than straight-up transpiling every single library in node_modules (same project: 8s). Then, I only need to transpile JS files above project target level for optimal build performance!

It would be nice if I can pass the AST which I obtained from above process straight to `transpileModule` to prevent double parsing. (Especially since `transpileModule` uses some internal options such as `suppressOutputPathCheck` and `allowNonTsExtensions`) 

## Examples

<!-- Show how this would be used and what the behavior would be -->

Proposed API:

```ts
transpileModuleAst(source: TypeScript.SourceFile, transpileOptions: TypeScript.transpileOptions): TypeScript.TranspileOutput
```

## Checklist

My suggestion meets these guidelines:
* [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. new expression-level syntax)
Repository: vscode
Issue: Regex replace in a large file clears an "innocent" line following a block of affected lines
Labels: bug,editor-find

Dear friends,

replacing a regex in a small file works fine, whereas doing so on a large file (originally 5.5M lines) results in incorrect behaviour 100% of time.

I have tried the steps below with the current VSCode release, the insiders build, and again the current release with extensions disabled, all on Win10 with the same (deterministic) result.

<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
Version: 1.28.2 (user setup)
- Commit: 7f3ce96ff4729c91352ae6def877e59c561f4850
- Date: 2018-10-17T00:23:51.859Z
- Electron: 2.0.9
- Chrome: 61.0.3163.100
- Node.js: 8.9.3
- V8: 6.1.534.41
- Architecture: x64

Version: 1.29.0-insider (user setup)
- Commit: bdfe4fd41f6a5fe538197b3cba937230249a563a
- Date: 2018-11-04T13:04:20.759Z
- Electron: 2.0.12

Steps to Reproduce:

1. Download, unzip, and open the [small file](https://github.com/Microsoft/vscode/files/2552357/odstavec_closing_tag_untouched.vert.txt) (29 lines) and the [large one](https://github.com/Microsoft/vscode/files/2552322/odstavec_closing_tag_cleared.zip) (6.3 M lines, 100 MiB), in which the content of the small file is simply duplicated more than 200,000 times. _The files contain vertical text: the first attested (Old) Czech sentence represented in tab-separated values wrapped in XML-like tags, a part of a text corpus._
2. Observe that on the small file, replacing the regex ^([^\t<]+).*$ with $1 works correctly. _The regex is supposed to strip annotation from non-XML lines (i.e. keep only the first column):_

 **_a	a|a|a		k0|k8|k9_**
 Sedlatu
 .
 &lt;/odstavec&gt;
 &lt;/folio&gt;

becomes

 **_a_**
 Sedlatu
 .
 &lt;/odstavec&gt;
 &lt;/folio&gt;

3. On the large file, not only the annotation is removed; lines with closing tags (&lt;/odstavec&gt;) which immediately follow _affected_ lines are cleared as well:

 **_a_**
 Sedlatu
 .
 **[line cleared]**
 &lt;/folio&gt;

Thank you for resolving this issue!

PS: 7-Zip compresses the 100 MiB file to a 15 KiB archive, ZIP creates a 447 KiB archive.
Repository: TypeScript
Issue: Using createProgram outside node environment throws unhelpful exception message
Labels: Suggestion,In Discussion,API

When running `createProgram` from inside my angular app I'm thrown the 'ts.sys is undefined' error. This error is not helpful since I'm not given the reason for it. It took me a lot of time researching and eventually a question on SO (https://stackoverflow.com/questions/52969177/typescript-createprogram-throwing-ts-sys-is-undefined) to get the answer.

A more elaborate error message would've had been of great help.

**TypeScript Version:**  3.1.3

**Search Terms:** 'ts.sys is undefined'

**Code**

```ts
try {
    createProgram(Utils.getFileNames(), {
        lib: ['lib.es6.d.ts']
        // target: ScriptTarget.ES5,
        // module: ModuleKind.CommonJS
    });
} catch (ex) {
    debugger;
}
```

**Expected behavior:**

An exception message explaining I should run this code from node environment or pass my own compiler.

**Actual behavior:**

Throws 'ts.sys is undefined'
Repository: go
Issue: cmd/go: go list -m -json output changes if module version supplied
Labels: NeedsInvestigation,GoCommand,modules

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.11.1 linux/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
GOARCH="amd64"
GOBIN="/home/myitcv/go-modules-by-example/.bin"
GOCACHE="/home/myitcv/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/myitcv/gostuff"
GOPROXY=""
GORACE=""
GOROOT="/home/myitcv/gos"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/myitcv/go-modules-by-example/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build283609322=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

```
$ git clone https://github.com/myitcvscratch/usenonmod /tmp/usenonmod
Cloning into '/tmp/usenonmod'...
$ cd /tmp/usenonmod
$ git checkout 8f021b7b44b6abe1c2cc18d87e72eb28dd1f6a33
HEAD is now at 8f021b7... Initial commit
$ go mod tidy
go: downloading github.com/myitcvscratch/nonmod v0.0.0-20181105194257-9516961eb10a
go: downloading golang.org/x/tools v0.0.0-20181105194243-ebdbadb46e45
$ go list -m all
github.com/myitcvscratch/usenonmod
github.com/myitcvscratch/nonmod v0.0.0-20181105194257-9516961eb10a
golang.org/x/tools v0.0.0-20181105194243-ebdbadb46e45
$ go list -m -json golang.org/x/tools
{
        "Path": "golang.org/x/tools",
        "Version": "v0.0.0-20181105194243-ebdbadb46e45",
        "Time": "2018-11-05T19:42:43Z",
        "Indirect": true,
        "Dir": "/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20181105194243-ebdbadb46e45",
        "GoMod": "/gopath/pkg/mod/cache/download/golang.org/x/tools/@v/v0.0.0-20181105194243-ebdbadb46e45.mod"
}
$ go list -m -json golang.org/x/tools@v0.0.0-20181105194243-ebdbadb46e45
{
        "Path": "golang.org/x/tools",
        "Version": "v0.0.0-20181105194243-ebdbadb46e45",
        "Time": "2018-11-05T19:42:43Z",
        "Dir": "/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20181105194243-ebdbadb46e45",
        "GoMod": "/gopath/pkg/mod/cache/download/golang.org/x/tools/@v/v0.0.0-20181105194243-ebdbadb46e45.mod"
}
```

### What did you expect to see?

The same output for both `go list -m -json` commands.

### What did you see instead?

The `.Indirect` field is missing if the version is provided, as in the second call.
Repository: electron
Issue: Too inconvenient to do conditional menu items using the menu template builder
Labels: enhancement :sparkles:

**Is your feature request related to a problem? Please describe.**

I previously opened https://github.com/electron/electron/issues/13754, but instead of going with my preferred solution of filtering out falsy values, they went with strict type checking, which is fine, but it also means it's very inconvenient to do inline conditional menus.

This is not possible:

```js
electron.Menu.buildFromTemplate([
	{
		type: 'separator',
	},
	isLoggedIn ? {
		label: 'Foo'
	} : undefined
]);
```

You might be fooled into thinking you can just do this:

```js
electron.Menu.buildFromTemplate([
	{
		type: 'separator',
	},
	{
		label: 'Foo',
		visible: isLoggedIn
	}
]);
```

But that will still show the separator, even when `visible: false`:

<img width="377" alt="screen shot 2018-11-06 at 19 32 48" src="https://user-images.githubusercontent.com/170270/48064578-c223cd80-e1fa-11e8-9d14-e49a8e4044a6.png">


**Describe the solution you'd like**

I'd like Electron to either:

1. Allow `undefined` and filter it out (deeply/recursively). That would be my preferred and most convenient solution.
2. Add a `{type: 'empty'}` that is filtered out (deeply/recursively).

**Describe alternatives you've considered**

Remove moot `{type: 'separator}` items. For example, when there's is a separator and then an `{visible: false}` item at the end, the separator should be filtered out as otherwise it would look weird. 

**Additional context**

Cross-platform apps have a lot of conditional menu items. It should not be this hard to do it.
Repository: vscode
Issue: API should support to create a folder
Labels: feature-request,api,file-io,workspace-edit
Repository: neovim
Issue: :terminal command to jump between prompts
Labels: enhancement,terminal

I think a pretty nice feature of the terminal mode (`:terminal`) would be the possibility to jump between prompts, when being in normal mode in the terminal buffer.

E.g. my window looks like so:
```
+-------------------------------------------------------------------------+
|$ ls                                                                     |
|decode.c  encode.c  executor.c  gc.c  typval.c           typval_encode.h |
|decode.h  encode.h  executor.h  gc.h  typval_encode.c.h  typval.h        |
|$ █                                                                      |
|                                                                         |
|--TERMINAL--                                                             |
+-------------------------------------------------------------------------+
```
and I am in normal mode and type e.g. `:PrevPrompt` and get:
```
+-------------------------------------------------------------------------+
|$ █s                                                                     |
|decode.c  encode.c  executor.c  gc.c  typval.c           typval_encode.h |
|decode.h  encode.h  executor.h  gc.h  typval_encode.c.h  typval.h        |
|$                                                                        |
|                                                                         |
|--TERMINAL--                                                             |
+-------------------------------------------------------------------------+
```
Then I type e.g. `:NextPrompt` and would be at first position again:
```
+-------------------------------------------------------------------------+
|$ ls                                                                     |
|decode.c  encode.c  executor.c  gc.c  typval.c           typval_encode.h |
|decode.h  encode.h  executor.h  gc.h  typval_encode.c.h  typval.h        |
|$ █                                                                      |
|                                                                         |
|--TERMINAL--                                                             |
+-------------------------------------------------------------------------+
```

Of course some can search `$` and jump between prompts but not in a clean way since the output of terminal commands could contain the prompt string (or parts of it).