sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Control application of insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets for Array Literal vs Array Access Expression
Labels: Suggestion,Help Wanted,Domain: Formatter,VS Code Tracked

_From @atian25 on March 28, 2017 0:25_

- VSCode Version: Code 1.10.2 **[Unsupported]** (8076a19fdcab7e1fc1707952d652f0bb6c6db331, 2017-03-08T13:56:35.908Z)
- OS Version: Darwin x64 16.3.0
- Extensions: 

|Extension|Author|Version|
|---|---|---|
|output-colorizer|IBM|0.0.11|
|vscode-file-peek|abierbaum|1.0.1|
|Bookmarks|alefragnani|0.12.0|
|project-manager|alefragnani|0.13.5|
|copy-syntax|atian25|0.5.1|
|vscode-custom-css|be5invis|2.3.1|
|npm-intellisense|christian-kohler|1.3.0|
|vscode-mocha-latte|cspotcode|0.2.0|
|vscode-eslint|dbaeumer|1.2.8|
|vscode-npm-source|dkundel|1.0.0|
|code-runner|formulahendry|0.6.15|
|task-master|ianhoney|0.1.39|
|path-autocomplete|ionutvmi|1.4.1|
|plantuml|jebbs|1.3.0|
|md-navigate|jrieken|0.0.1|
|vue|liuji-jim|0.1.5|
|debugger-for-chrome|msjsdiag|2.7.1|
|node-modules-resolve|naumovs|1.0.2|
|peep|nwallace|0.0.5|
|vscode-json-transform|octref|0.1.2|
|unittest-navigate|roblourens|0.0.2|
|preview-vscode|searKing|1.1.4|
|es6-mocha-snippets|spoonscen|0.0.2|
|code-navigation|vikas|0.2.0|
|JavaScriptSnippets|xabikos|1.4.0|;


---

Steps to Reproduce:

`javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets`

```js
// want this
const arr = [ 'a', 'b' ];
// don't want this
arr[ 1 ];
```

_Copied from original issue: Microsoft/vscode#23321_
Repository: kubernetes
Issue: API-Linter: Add a verifier script using gengo to enforce API policies
Labels: sig/api-machinery,lifecycle/frozen

Right now we have several generator scripts (openapi-gen, deepcopy-gen, etc.) that look at the code and generate types/functions. This infrastructure can be used to look at all API types and enforce some policies such as optional fields to be pointer, etc. Please add the policies you want this verifier to enforce in this issue. I will start by a simple verifier for optional fields.

- [ ] Optional fields should be a pointer
- [ ] struct tag and comment tag should match for `patchStrategy` and `patchMergeKey`.
- [ ] `patchStrategy` tag should be used only if the field is a slice. (There are wrong usages in the API now)
- [ ] `patchMergeKey` tag should be used only with `patchStrategy` is `merge`.
Repository: angular
Issue: FormGroup reset() doesn't reset custom form control
Labels: type: bug/fix,freq1: low,area: forms,state: confirmed,forms: ControlValueAccessor,P4

<!--
IF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING
-->

**I'm submitting a ...**  (check one with "x")
```
[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
```

**Current behavior**
<!-- Describe how the bug manifests. -->
Custom form control does not reset when form is reset using the `FormGroup` `reset()` method. The value will clear, but control properties `dirty`, `pristine`, `untouched` and `touched` are not updated.

**Expected behavior**
<!-- Describe what the behavior would be without the bug. -->
I would expected the control properties to reset.

**Minimal reproduction of the problem with instructions**
<!--
If the current behavior is a bug or you can illustrate your feature request better with an example, 
please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
-->
http://plnkr.co/edit/xeIy7DEg5GwTqe7JgOv9

**What is the motivation / use case for changing the behavior?**
<!-- Describe the motivation or the concrete use case -->
The motivation is to use custom form controls.

**Please tell us about your environment:**
<!-- Operating system, IDE, package manager, HTTP server, ... -->
```
@angular/cli: 1.0.0
node: 6.10.1
os: darwin x64
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0
```

* **Angular version:** 2.0.X
<!-- Check whether this is still an issue in the most recent Angular version -->
4

* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
<!-- All browsers where this could be reproduced -->
All 

* **Language:** [all | TypeScript X.X | ES6/7 | ES5]
Typescript

* **Node (for AoT issues):** `node --version` =   
node: 6.10.1
Repository: go
Issue: cmd/cgo: C code with function taking pointer typedef leads to C compiler warning
Labels: help wanted,NeedsFix,compiler/runtime

Building this file gets a warning from the C compiler:

    package main
    
    // typedef struct { int i; } *PS;
    // void F(PS p) {}
    import "C"
    
    func main() {
    	C.F(nil)
    }

The warning I see is:

    # command-line-arguments
    cgo-gcc-prolog: In function ‘_cgo_0164fa09626e_Cfunc_F’:
    cgo-gcc-prolog:37:2: warning: passing argument 1 of ‘F’ from incompatible pointer type [enabled by default]
    /home/iant/foo8.go:4:7: note: expected ‘PS’ but argument is of type ‘struct <anonymous> *’
     // void F(PS p) {}
           ^

The code generated by cgo looks like:

    CGO_NO_SANITIZE_THREAD
    void
    _cgo_0164fa09626e_Cfunc_F(void *v)
    {
    	struct {
    		struct {int i; }* p0;
    	} __attribute__((__packed__, __gcc_struct__)) *a = v;
    	_cgo_tsan_acquire();
    	F(a->p0);
    	_cgo_tsan_release();
    }

The C function expects `PS*` but we are passing `struct{int i;}*`.  That is, we aren't using the typedef.

Changing the Go code to use `C.PS(unsafe.Pointer(nil))` also fails in the same way.
Repository: TypeScript
Issue: Unable to specify return type of class extends T implements IFooable
Labels: Suggestion,In Discussion

<!-- BUGS: Please use this template. -->
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->

**TypeScript Version:**  2.2.1 / nightly (2.2.0-dev.201xxxxx)

**Code**

```ts
// A *self-contained* demonstration of the problem follows...
export type Constructor<T> = new (...args: any[]) => T;
export interface IFooable { FooProp: string; }
export function FooableMixin<T extends Constructor<{}>>(Base: T) {
    return class extends Base implements IFooable {
        FooProp: string;
        constructor(...args: any[]) {
            super(...args);
        }
    }
}
export class BaseBar { BarProp: string = "baz"; }
export class FooableBar extends FooableMixin ( BaseBar ) {}
let foobar = new FooableBar();
foobar.FooProp = foobar.BarProp; 
/* This is ok since FooableBar extends an Anonymous class inheriting from BaseBar and implementing IFooable */
```
If I turn on "declaration: true" in tsconfig.json this constuct breaks since the Anonymous class counts as private and not exported type (error TS4060) which is kind of natural since it is Anonymous.

What we need is a way to describe Classes as return types.

**Expected behavior:**

A d.ts file with a type declaration for the Mixin function Fooable that defines a Anonymous Class return type in the style of:
```
declare function Fooable(T extends Constructor<{}>): (class extends T implements IFooable);
```
**Actual behavior:**

TS4060 error when compiling with the "declaration" flag.
If casting the Anonymous Class return value to <any> or T, the interface is lost.
Repository: angular
Issue: Leave animation not running in a nested animation of a child component
Labels: type: bug/fix,area: animations,freq3: high,P3

**I'm submitting a ...**  (check one with "x")
```
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
```

**Current behavior**
I have 2 components (1 parent, 1 child) which should be running 2 different animations at the same time when something triggers in the parent component. The child component is adding an element to the DOM in this case and the enter animation for this element is running fine. When the animation is running backwards because the condition is not met anymore the leave animation in the child component is not running at all. 

When I remove the animation on the parent component the animations of the child component are running fine. 

The animations of the parent component are always running fine. 

This happens only in angular4. Its working as expected in 2.4.10 without any changes.

**Minimal reproduction of the problem with instructions**
Here is the plunkr to demonstrate the problem: https://plnkr.co/edit/a250XgG9FFomAeAYWOSo?p=preview

The yellow block should be moving to the left when leaving, but its not. When you remove "[@move]="direction"" on the div in the parent component you will see that the leave animation is defined correctly because now its running. The enter animation is always fine.

* **Angular version:** 4.0.1 (its working in 2.4.10)

* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
all
Repository: rust
Issue: Get rid of the "rust-call" hack 
Labels: C-cleanup,A-closures,T-compiler

*Based on https://github.com/rust-lang/rfcs/pull/1921#issuecomment-282164515*

Currently, we fake variadics by defining functions with the `rust-call` ABI. These functions receive a tuple as parameter (of arbitrary arity and types), but in their ABI the tuple is expanded. It would be great to get rid of this hack and in the process pave the way for the eventual feature of variadic generics.
Repository: go
Issue: cmd/cgo: type error when using pointers to C functions
Labels: compiler/runtime

If I try to pass a C function pointer back to C from Go, I get a type error.  It appears that cgo is mapping the function pointer type to `*[0]byte` (since there isn't a direct way to express C function-pointer types in the Go type system), but it isn't inserting the correct type conversions when referring to function-pointer values:

cgocallback/main.go:
```go
package main

/*
#include <stdio.h>

static void invoke(void (*f)()) {
	f();
}

void print_hello() {
	printf("Hello, !");
}
*/
import "C"

func main() {
	C.invoke(C.print_hello)
}
```

```
bcmills:~$ go build cgocallback
# cgocallback
src/cgocallback/main.go:17: cannot use _Cgo_ptr(_Cfpvar_fp_print_hello) (type unsafe.Pointer) as type *[0]byte in argument to _Cfunc_invoke
```

The workaround is to define a typedef for the function pointer type an explicitly convert to the typedef, but it would be nice if that workaround were not necessary.

```go
package main

/*
…
typedef void (*closure)();
*/
import "C"

func main() {
	C.invoke(C.closure(C.print_hello))
}
```

```
bcmills:~$ go version
go version devel +2bbfa6f746 Thu Mar 9 15:36:43 2017 -0500 linux/amd64
```
Repository: go
Issue: cmd/cgo: link error when using pointers to static C functions
Labels: help wanted,NeedsFix,compiler/runtime

If I try to pass a pointer to a static C function, I get a link error.

cgocallback/main.go:
```go
package main

/*
#include <stdio.h>

static void invoke(void (*f)()) {
	f();
}

static void print_hello() {
	printf("Hello, !");
}

typedef void (*closure)();  // https://golang.org/issue/19835
*/
import "C"

func main() {
	C.invoke(C.closure(C.print_hello))
}
```

```
bcmills:~$ go build cgocallback
# cgocallback
/tmp/go-build059026917/cgocallback/_obj/_cgo_main.o:(.data.rel+0x0): undefined reference to `print_hello'
collect2: error: ld returned 1 exit status
```

The workaround is to use external linkage for functions used as function pointers, but in some cases that means I have to use more verbose names to avoid collisions.

(Possibly related to #19835.)

```
bcmills:~$ go version
go version devel +2bbfa6f746 Thu Mar 9 15:36:43 2017 -0500 linux/amd64
bcmills:~$ $(go env CC) --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
```
Repository: go
Issue: cmd/cgo: emit forward-declarations for cgo-exported Go functions
Labels: help wanted,NeedsFix

I'm trying to pass a Go function as a C function pointer.

I expect to be able to do that by exporting the Go function to C, then passing the C name of the Go function:

```go
package main

/*
static void invoke(void (*f)()) {
	f();
}

typedef void (*closure)();  // https://golang.org/issue/19835
*/
import "C"

import "fmt"

//export go_print_hello
func go_print_hello() {
	fmt.Println("Hello, !")
}

func main() {
	C.invoke(C.closure(C.go_print_hello))
}
```

Unfortunately, that results in a cgo error:
```
bcmills:~$ go build cgocallback
# cgocallback
could not determine kind of name for C.go_print_hello
```

As a workaround, I can add an explicit forward-declaration of the Go function to the C preamble:
```
/*
…
void go_print_hello();
*/
import "C"
```

Given that cgo (presumably) already knows the C declarations for the functions it is exporting, I would prefer that it emit those forward-declarations itself.  Since all C types should be defined by the end of the user-defined preamble, it seems like cgo could emit the forward declarations immediately following the preamble.

(If user code needs to refer to the Go functions within the preamble itself, requiring an explicit forward-declaration seems reasonable.)

```
bcmills:~$ go version
go version devel +2bbfa6f746 Thu Mar 9 15:36:43 2017 -0500 linux/amd64
```
Repository: rust
Issue: Rustdoc impl blocks refer to private names
Labels: T-rustdoc,C-bug,A-local-reexports

The [`flate2`](https://docs.rs/flate2/0.2.17/flate2/) crate is structured roughly like this:

```rust
mod gz {
    pub struct EncoderReader;

    impl EncoderReader {
        pub fn new() -> EncoderReader {
            unimplemented!()
        }
    }
}

pub use gz::EncoderReader as GzEncoder;
```

The rustdoc of `GzEncoder` is correctly titled but the impl blocks on the page refer to the private name of the type. I would expect the impl blocks and methods to use the public name, just like the top of the page does.

---

![selection_030](https://cloud.githubusercontent.com/assets/1940490/24679795/42ed355a-1943-11e7-838a-36cc4b9f3935.png)
Repository: flutter
Issue: Improve flutter build latency on iOS
Labels: platform-ios,tool,c: performance,platform-mac,t: xcode,P2,team-ios,triaged-ios

`flutter build ios` takes 30+s on my monster mac pro. Would be nice to get it faster.

Some candidates:
100+ms to read the CFBundleIdentifier from the project
1000+ms to print the build settings to do some variable substitution. Maybe we can cache this.
400+ms to check cocoapods version. Maybe we can ask for forgiveness instead of permission
1900+ms to check cocoapods dependencies. Don't know if there's any caching we can use
22000+ms to run `/usr/bin/env xcrun xcodebuild clean build -configuration Release ONLY_ACTIVE_ARCH=YES -workspace Runner.xcworkspace -scheme Runner BUILD_DIR=build/ios -sdk iphoneos -arch arm64`. Do we really need to clean first?
Repository: flutter
Issue: Optimize the animation phase's performance
Labels: framework,a: animation,c: performance,P3,team-framework,triaged-framework

#9138 caused a 0.4ms average frame draw latency increase on flutter_gallery_ios__transition_perf's average_frame_build_time_millis and 1500ms regression on microbenchmarks_ios's stock_build_iteration. 

Suspect due to there being 2 SlideTransitions instead of 1.
Repository: electron
Issue: API to access localStorage in the main process
Labels: enhancement :sparkles:

I expect some apis to get, set and remove localStorage data, just like those apis of cookies.

Here are apis of cookies:
```
ses.cookies.get(filter, callback)
ses.cookies.set(details, callback)
ses.cookies.remove(url, name, callback)
```

Expected apis of localStorage
```
ses.localStorage.get(filter, callback)
ses.localStorage.set(details, callback)
ses.localStorage.remove(url, name, callback)
```
Repository: rust
Issue: Confusing type error due to strange inferred type for a closure argument
Labels: A-type-system,C-enhancement,A-diagnostics,P-medium,A-closures,T-compiler,A-inference,D-confusing,D-newcomer-roadblock,T-types

This [example](https://play.rust-lang.org/?gist=e1edb587259e492444d69d63f2052537&version=nightly&backtrace=0):

```rust
pub struct Request<'a, 'b: 'a> {
    a: &'a (),
    b: &'b (),
}
pub trait Handler: Send + Sync + 'static {
    fn handle(&self, &mut Request) -> Result<(),()>;
}
impl<F> Handler for F where F: Send + Sync + 'static + Fn(&mut Request) -> Result<(),()> {
    fn handle(&self, _: &mut Request) -> Result<(),()> {
        unimplemented!()
    }
}
fn make_handler(h: &'static Handler) -> Box<Handler> {
    Box::new(move |req| h.handle(req))
}
```
errors with
```
error[E0271]: type mismatch resolving `for<'r, 'r, 'r> <[closure@<anon>:14:14: 14:38 h:_] as std::ops::FnOnce<(&'r mut Request<'r, 'r>,)>>::Output == std::result::Result<(), ()>`
  --> <anon>:14:5
   |
14 |     Box::new(move |req| h.handle(req))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter , found concrete lifetime
   |
   = note: concrete lifetime that was found is lifetime '_#9r
   = note: required because of the requirements on the impl of `Handler` for `[closure@<anon>:14:14: 14:38 h:_]`
   = note: required for the cast to the object type `Handler`
```

Annotating the closure parameter `|req: &mut Response|` allow the example to compile.
Interesting, annotating with `|req: &&mut Response|` produces a similarly-structured error, so I believe we're inferring `&&mut` here (maybe related to autoderef?).
Repository: three.js
Issue: Object3D clone userData exception
Labels: Suggestion

When calling `Object3D.clone()` I get an exception `a.geometries is undefined` at `Object3D.toJSON` method line 11028. In my Object3D instance I try to clone, I also store a reference to the `Scene` object in the `userData` property.

As far as I can see, the exception appears since `Object3D.clone()` tries to copy the `userData` object. When calling `Scene.toJSON` method it is tried to copy all descendants of the scene. In my case it crashes when it is tried to copy a `GridHelper `child object of the scene.

This error also appears when calling `Object3D.clone(false)` to prevent a recursive behavior. In this case, I would expect that this kind of recursive `userData` JSON copy is switched off. 

Maybe it would be useful to document that also `userData` is cloned recursively and that the stored `userData` objects must provide a custom `toJSON` method to influence this behavior. What do you think?

##### Three.js version
- [x] r84
##### Browser
- [x] Chrome
- [x] Firefox
##### OS
- [x] Windows
Repository: vscode
Issue: Symbol outline multi-line highlight is visually inconsistent when interleaved with code lens
Labels: feature-request,ux,editor-core

If the symbol outline is highlighting an entry that spans multiple lines and there is a code lens within that range, the code lens line is not highlighted. See attached image.

It seems like the code lens line should also be highlighted in the same color.

- VSCode Version: 1.10.2, happens on 1.11 insiders as well.
- OS Version: Win10

![image](https://cloud.githubusercontent.com/assets/356714/24696929/29556e48-19a0-11e7-9522-1894e91ab250.png)
Repository: youtube-dl
Issue: [bilibili]Can't support a video containing many pages.
Labels: request

---

### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.04.03*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2017.04.03**

### Before submitting an *issue* make sure you have:
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones

### What is the purpose of your *issue*?
- [x] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---

### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your *issue*

---

for example,the URL http://www.bilibili.com/video/av9291699 
there are 4 videos in it.but if I use the command `youtube-dl -F http://www.bilibili.com/video/av9595179`

I can only see the information about the first video:
```
[BiliBili] 9595179: Downloading webpage
[BiliBili] 9595179: Downloading video info page
[info] Available formats for 9595179:
format code  extension  resolution note
0            mp4        unknown
1            mp4        unknown    369.28MiB (best)
```
Only if I execute `youtube-dl -F http://www.bilibili.com/video/av9595179/index_1.html` to `youtube-dl -F http://www.bilibili.com/video/av9595179/index_4.html` can I download all the 4 videos correctly.Can you fix it?or tell me the way to parse how many videoes in an ID.
Repository: vscode
Issue: [Feature] Option to disable cmd+click trigger for goToDefinition
Labels: feature-request,editor-core

Starting ~2 weeks ago, I have been plagued by this feature. Somehow I manage to trigger this feature about 60% of the time when I am trying to copy+paste. It is the same issue as reported here, but in the editor so am creating this ticket as suggested by @bpasero .

https://github.com/Microsoft/vscode/issues/7827#issuecomment-238237206

- VSCode Version: Version 1.10.2 (1.10.2)
- OS Version: OS X 10.11.6 (15G31)

Steps to Reproduce:

1. Cmd+click a followable definition.
2. Unexpectedly arrive somewhere deep in node_modules.

Don't get me wrong, I love this feature but whatever changes were made recently seem to be incompatible with my muscle memory when copying text. So, I would like to change the keybinding, or at the very least turn it off altogether.
Repository: vscode
Issue: Keyboard mappings with `setxkbmap` on Linux not working
Labels: bug,help wanted,keybindings,linux

- VSCode Version: 1.11.0
- OS Version: Ubuntu 16.04

I have my Caps Lock key bound to Escape using `setxkbmap` on Linux. This worked fine till 1.10, but broke with 1.11. At first I thought it was an issue with the VSCodeVim extension, but the issue persists with all the other Vim extensions on the marketplace as well. Pressing the escape button still works as expected.

The binding is still respected everywhere else in the operating system, it's only Visual Studio Code that ignores it for some reason.

Steps to Reproduce:

1. Run `setxkbmap -option caps:escape` (binds caps to escape for the duration of the session)
2. Hitting caps lock when in insert mode (with a Vim extension like VSCodeVim installed) no longer puts you normal mode.
3. Hitting escape still works as expected and puts you in normal mode.