sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Keep indentation level consistent in a multiline list
Labels: Bug,Help Wanted,Domain: Formatter

Copied from #3436:

> Another example:
> 
> ``` typescript
> return (
>     h.div({
>         className: "view-node-row",
>         style: {
>             width: width,
>             height: rowHeight
>         }
>     },
>         backgroundElement,
>         centerElement,
>         toolsElement,
>         h.div({ className: "nodes" }, items)
>         )
>     );
> ```
> 
> While I expect:
> 
> ``` typescript
> return (
>     h.div({
>         className: "view-node-row",
>         style: {
>             width: width,
>             height: rowHeight
>         }
>     },
>     backgroundElement,
>     centerElement,
>     toolsElement,
>     h.div({ className: "nodes" }, items)
>     )
> );
> ```
Repository: go
Issue: cmd/internal/obj: stackGuardMultiplier is wrong for a cross-compiler
Labels: compiler/runtime

This issue is similar to that reported in https://github.com/golang/go/issues/12764 except that GOOS=linux and i'm running on a fairly pristine image of macosx El Capitan.

when cross compiling to GOOS=linux on macosx El Capitan using go 1.5.1 I get a nosplit stack overflow. It happens in the link step, AFAICT from using the -v option to go build.

runtime.cgocallbackg: nosplit stack overflow
504 assumed on entry to runtime.cgocallbackg (nosplit)
416 after runtime.cgocallbackg (nosplit) uses 88
408 on entry to runtime.exitsyscall (nosplit)
288 after runtime.exitsyscall (nosplit) uses 120
280 on entry to runtime.exitsyscallfast (nosplit)
120 after runtime.exitsyscallfast (nosplit) uses 160
112 on entry to runtime.writebarrierptr (nosplit)
64 after runtime.writebarrierptr (nosplit) uses 48
56 on entry to runtime.writebarrierptr_nostore1 (nosplit)
0 after runtime.writebarrierptr_nostore1 (nosplit) uses 56
-8 on entry to runtime.acquirem (nosplit)
reflect.typelinks: nosplit stack overflow
504 assumed on entry to reflect.typelinks (nosplit)
352 after reflect.typelinks (nosplit) uses 152
344 on entry to runtime.typedmemmove (nosplit)
320 after runtime.typedmemmove (nosplit) uses 24
312 on entry to runtime.heapBitsBulkBarrier (nosplit)
192 after runtime.heapBitsBulkBarrier (nosplit) uses 120
184 on entry to runtime.throw (nosplit)
160 after runtime.throw (nosplit) uses 24
152 on entry to runtime.dopanic (nosplit)
72 after runtime.dopanic (nosplit) uses 80
64 on entry to runtime.getcallerpc (nosplit)
56 after runtime.getcallerpc (nosplit) uses 8
48 on entry to runtime.nextBarrierPC (nosplit)
8 after runtime.nextBarrierPC (nosplit) uses 40
0 on entry to runtime.panicindex
-8 on entry to runtime.morestack (nosplit)
runtime.cgocallback_gofunc: nosplit stack overflow
504 assumed on entry to runtime.cgocallback_gofunc (nosplit)
496 after runtime.cgocallback_gofunc (nosplit) uses 8
488 on entry to runtime.cgocallbackg (nosplit)
400 after runtime.cgocallbackg (nosplit) uses 88
392 on entry to runtime.exitsyscall (nosplit)
272 after runtime.exitsyscall (nosplit) uses 120
264 on entry to runtime.exitsyscallfast (nosplit)
104 after runtime.exitsyscallfast (nosplit) uses 160
96 on entry to runtime.writebarrierptr (nosplit)
48 after runtime.writebarrierptr (nosplit) uses 48
40 on entry to runtime.writebarrierptr_nostore1 (nosplit)
-16 after runtime.writebarrierptr_nostore1 (nosplit) uses 56
Repository: go
Issue: x/net/http2: TestServer_RejectsLargeFrames fails with "An existing connection was forcibly closed by the remote host" on windows
Labels: OS-Windows

From windows-amd64-gce builder http://build.golang.org/log/a0906e4fa3713e6512cdff9af6662d1db0faad0d

```
--- FAIL: TestServer_RejectsLargeFrames (0.31s)
    http2_test.go:64: 2015/11/30 20:57:53 127.0.0.1:49238: connection error: PROTOCOL_ERROR
    http2_test.go:64: 2015/11/30 20:57:53 127.0.0.1:49238: connection error: PROTOCOL_ERROR
    http2_test.go:64: 2015/11/30 20:57:53 127.0.0.1:49238: connection error: PROTOCOL_ERROR
...
    http2_test.go:64: 2015/11/30 20:57:53 127.0.0.1:49238: connection error: PROTOCOL_ERROR
    http2_test.go:64: 2015/11/30 20:57:53 127.0.0.1:49238: connection error: PROTOCOL_ERROR
    http2_test.go:64: 2015/11/30 20:57:53 127.0.0.1:49238: connection error: PROTOCOL_ERROR
    server_test.go:413: Error while expecting a GOAWAY frame: read tcp 127.0.0.1:49238->127.0.0.1:49237: wsarecv: An existing connection was forcibly closed by the remote host.
FAIL
FAIL    golang.org/x/net/http2  2.668s
```

I can reproduce this here. I don't know what the problem is.

Alex
Repository: rust
Issue: Desugared x.index(y) is not equivalent to x[y]
Labels: A-lifetimes,P-medium,I-needs-decision,T-lang,C-bug

``` rust
use std::ops::Index;

fn main() {
    let _sugar = &"a".to_owned()[..];
    let _desugar1 = "a".to_owned().index(..);
    let _desugar2 = &*"a".to_owned().index(..);
}
```

```
<anon>:5:21: 5:35 error: borrowed value does not live long enough
<anon>:5     let _desugar1 = "a".to_owned().index(..);
                             ^~~~~~~~~~~~~~
<anon>:5:46: 6:49 note: reference must be valid for the block suffix following statement 1 at 5:45...
<anon>:5     let _desugar1 = "a".to_owned().index(..);
<anon>:6     let _desugar2 = &*"a".to_owned().index(..);}
<anon>:5:5: 5:46 note: ...but borrowed value is only valid for the statement at 5:4
<anon>:5     let _desugar1 = "a".to_owned().index(..);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:5:5: 5:46 help: consider using a `let` binding to increase its lifetime
<anon>:5     let _desugar1 = "a".to_owned().index(..);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:6:23: 6:37 error: borrowed value does not live long enough
<anon>:6     let _desugar2 = &*"a".to_owned().index(..);}
                               ^~~~~~~~~~~~~~
<anon>:6:48: 6:49 note: reference must be valid for the block suffix following statement 2 at 6:47...
<anon>:6     let _desugar2 = &*"a".to_owned().index(..);}
                                                        ^
<anon>:6:5: 6:48 note: ...but borrowed value is only valid for the statement at 6:4
<anon>:6     let _desugar2 = &*"a".to_owned().index(..);}
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:6:5: 6:48 help: consider using a `let` binding to increase its lifetime
<anon>:6     let _desugar2 = &*"a".to_owned().index(..);}
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

If the `let _desugar`s are commented out, it compiles fine.

It seems a method call is treated differently to the `[]` syntax. This may be a purposeful consequence of the design of temporary lifetimes, I don't know.
Repository: go
Issue: x/mobile/cmd/gomobile: gomobile bind -n -target=ios fails when attempting to read Info.plist
Labels: mobile

Using gomobile version +01216d9

The following command fails to complete:

```
$  gomobile bind -n -target=ios golang.org/x/mobile/asset
```

with the following error:

```
mkdir -p Asset.framework/Versions/A/Headers
mkdir -p Asset.framework/Versions/A/Resources
ln -s Versions/Current/Resources Asset.framework/Resources
gomobile: open Asset.framework/Resources/Info.plist: no such file or directory
```
Repository: TypeScript
Issue: Opaque types for WebGL
Labels: Bug,Help Wanted,Domain: lib.d.ts

WebGL types are included in the default `lib.d.ts`. However, most types are defined as empty interfaces, which means that the compiler doesn't catch many WebGL errors.

Consider the following code:

``` ts
function foo(gl: WebGLRenderingContext, fbo: WebGLFramebuffer) {
  gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); // Correct call
  gl.bindFramebuffer(gl.FRAMEBUFFER, "abc"); // This should be a compile error!

  fbo = gl.createFramebuffer(); // Correct call
  fbo = new WebGLFramebuffer; // This should be a compile error!
}
```
- The second parameter of `gl.bindFramebuffer` should be a `WebGLFramebuffer` object, but passing a `string` does not emit a compile error or warning.
- The type `WebGLFramebuffer` can only be constructed via `WebGLRenderingContext.createFramebuffer`, calling new throws an error at runtime

Ideally, Typescript would know that `WebGLFramebuffer`, even though it has no public properties, cannot be constructed or converted to any other type.
I assume that this is not easy to specify with structural typing, but having such opaque types could be useful for other libraries as well (e.g., for returning handles).

If that is not possible, can we find a workaround that at least helps catching the above mentioned bugs?

For reference, here's how the above types are currently defined in `lib.d.ts`:

``` ts
interface WebGLFramebuffer extends WebGLObject {
}
declare var WebGLFramebuffer: {
    prototype: WebGLFramebuffer;
    new(): WebGLFramebuffer;
}
interface WebGLRenderingContext {
    bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void;
    // + many other methods
}
```
Repository: youtube-dl
Issue: Site support Request: Realm.io Videos
Labels: site-support-request

Up till a couple weeks ago, Realm hosted their videos on Youtube, but they've now switched to Wistia. Here's an example page: https://realm.io/news/alexis-gallagher-3d-touch-swift/

```
$ youtube-dl --version
2015.11.27.1
```

```
$ youtube-dl -jv "https://realm.io/news/alexis-gallagher-3d-touch-swift/"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-jv', u'https://realm.io/news/alexis-gallagher-3d-touch-swift/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.11.27.1
[debug] Python version 2.7.10 - Darwin-15.0.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
WARNING: Falling back on generic information extractor.
ERROR: Unsupported URL: https://realm.io/news/alexis-gallagher-3d-touch-swift/
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 1282, in _real_extract
    doc = compat_etree_fromstring(webpage.encode('utf-8'))
  File "/usr/local/bin/youtube-dl/youtube_dl/compat.py", line 248, in compat_etree_fromstring
    doc = _XML(text, parser=etree.XMLParser(target=etree.TreeBuilder(element_factory=_element_factory)))
  File "/usr/local/bin/youtube-dl/youtube_dl/compat.py", line 237, in _XML
    parser.feed(text)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
    raise err
ParseError: not well-formed (invalid token): line 7, column 145
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 663, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 290, in extract
    return self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 1887, in _real_extract
    raise UnsupportedError(url)
UnsupportedError: Unsupported URL: https://realm.io/news/alexis-gallagher-3d-touch-swift/
```
Repository: vscode
Issue: Exclude all files except for...
Labels: feature-request,file-explorer,file-glob

The files exclude allows you to set `true/false` values, but it doesn't seem to take them completely into account.

For example, I would like to hide **everything** except for the scripts folder. You might then assume that this would do this:

```
{
    "files.exclude":
    {
        "**/*": true,
        "**/Scripts": false
    }
}
```

It does not do that, it just hides everything. In order to achieve this, you must list every file and directory except for the **Scripts** directory, and who knows how many directories there are and if a new directory/file gets added you then must edit the list to exclude those.

In the end, their should be a way to hide everything except for xxx.
Repository: youtube-dl
Issue: Site request: ispot.tv
Labels: site-support-request

URL Example: http://www.ispot.tv/ad/7p_Q/viagra-fishing

Output:

C:>youtube-dl -v http://www.ispot.tv/ad/7p_Q/viagra-fishing
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.ispot.tv/ad/7p_Q/viagra-fishing'
]
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2015.11.27.1
[debug] Python version 2.7.10 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-71346-gdf4fca2
[debug] Proxy map: {}
[generic] viagra-fishing: Requesting header
WARNING: Falling back on generic information extractor.
[generic] viagra-fishing: Downloading webpage
[generic] viagra-fishing: Extracting information
ERROR: Unsupported URL: http://www.ispot.tv/ad/7p_Q/viagra-fishing
Traceback (most recent call last):
  File "youtube_dl\extractor\generic.pyo", line 1282, in _real_extract
  File "youtube_dl\compat.pyo", line 248, in compat_etree_fromstring
  File "youtube_dl\compat.pyo", line 237, in _XML
  File "xml\etree\ElementTree.pyo", line 1642, in feed
  File "xml\etree\ElementTree.pyo", line 1506, in _raiseerror
ParseError: mismatched tag: line 79, column 6
Traceback (most recent call last):
  File "youtube_dl\YoutubeDL.pyo", line 663, in extract_info
  File "youtube_dl\extractor\common.pyo", line 290, in extract
  File "youtube_dl\extractor\generic.pyo", line 1887, in _real_extract
UnsupportedError: Unsupported URL: http://www.ispot.tv/ad/7p_Q/viagra-fishing

Thanks
Ringo
Repository: vscode
Issue: Macro like keybindings
Labels: feature-request,keybindings

When creating keyboard shortcuts, it would be nice if you could pass an array of commands (to execute like a macro) that would run the commands in that order.

So take this for example:

```
{
    "key": "ctrl+s",
    "command": [
        "editor.action.format",
        "editor.action.trimTrailingWhitespace",
        "workbench.action.files.save"
    ],
    "when": "editorTextFocus"
}
```

It would format the file, remove trailing white space then save the file.
Repository: go
Issue: net/rpc: `(*Client).Go` is not asynchronous with respect to outbound traffic
Labels: NeedsInvestigation

In the event of a network partition, `net/rpc.(*Client).Go` can block, which is surprising given the documented behaviour of this method.
Repository: TypeScript
Issue: Polymorphic "this" for static members
Labels: Suggestion,In Discussion

When trying to implement a fairly basic, but polymorphic, active record style model system we run into issues with the type system not respecting `this` when used in conjunction with a constructor or template/generic.

I've posted before about this here, #5493, and #5492 appears to mention this behavior also.

And here is an SO post this that I made:
http://stackoverflow.com/questions/33443793/create-a-generic-factory-in-typescript-unsolved

I have recycled my example from #5493 into this ticket for further discussion. I wanted an open ticket representing the desire for such a thing and for discussion but the other two are closed.

Here is an example that outlines a model `Factory` which produces models. If you want to customize the `BaseModel` that comes back from the `Factory` you should be able to override it. However this fails because `this` cannot be used in a static member.

``` typescript
// Typically in a library
export interface InstanceConstructor<T extends BaseModel> {
    new(fac: Factory<T>): T;
}

export class Factory<T extends BaseModel> {
    constructor(private cls: InstanceConstructor<T>) {}

    get() {
        return new this.cls(this);
    }
}

export class BaseModel {
    // NOTE: Does not work....
    constructor(private fac: Factory<this>) {}

    refresh() {
        // get returns a new instance, but it should be of
        // type Model, not BaseModel.
        return this.fac.get();
    }
}

// Application Code
export class Model extends BaseModel {
    do() {
        return true;
    }
}

// Kinda sucks that Factory cannot infer the "Model" type
let f = new Factory<Model>(Model);
let a = f.get();

// b is inferred as any here.
let b = a.refresh();
```

Maybe this issue is silly and there is an easy workaround. I welcome comments regarding how such a pattern can be achieved.
Repository: go
Issue: x/mobile/bind: support slices of supported structs
Labels: mobile

Just want to know if it will ever be possible to support slices of supported. I currently have to write a wrapper object around an array to pass it back and forth between IOS and Go.
Repository: vscode
Issue: Don't activate dirty file indicator if the file state matches the previous written state
Labels: feature-request,file-io,keep

Vscode show me I have unsaved changes:
![image](https://cloud.githubusercontent.com/assets/91045/11530276/235e4580-9915-11e5-8e63-f6f2e39159b4.png)

Ok, before I saved it, I check md5 for this file.
![image](https://cloud.githubusercontent.com/assets/91045/11530264/09f00110-9915-11e5-87eb-2566c3bb26b4.png)

After save nothing changes.
![image](https://cloud.githubusercontent.com/assets/91045/11530290/3775d4a2-9915-11e5-8efc-283ae880cce0.png)

It happens time to time and it's very annoying.


UPD:

It's about user experience.

Dirty flag means something has changed.

Not ideal, but probably acceptable, if dirty flag is set when editor has history but no actual changes happened, when user input initiated it, for example, after pressing space and then backspace).
No actual changes here, but we still have a history (initiated by user).

And user for sure didn't expect, if dirty flag is set as result of any plugin action (in this case code reformatting), which in result doesn't apply any changes to editor.
Repository: javascript
Issue: Explicitly clarify naming policy for React event handler methods
Labels: question

The [ordering section](https://github.com/airbnb/javascript/tree/master/react#ordering) implies that event handlers should be named `onFoo` rather than `handleFoo` per FB examples. Is this an explicit rule? If so, it would be nice to have it listed in either the "naming" or "methods" sections.
Repository: rust
Issue: Debug trait for tuples, array/slices, Vec, String (etc?) do not respect `width` parameter
Labels: T-libs-api,C-bug,A-fmt

Consider the following println:

``` rust
    let msg = "Hello";
    println!("(i,j,k): |{:30}|", msg);
```

This is using the `width` parameter to ensure that the output occupies _at least_ `width` characters. (One can provide other arguments like fill/alignment to adjust the fill character or whether the output is left/right/center- alligned.)  See docs here: https://doc.rust-lang.org/std/fmt/#width

In other words, it prints this (note the distance between the two occurrences of `|`):

```
(i,j,k): |Hello                         |
```

So, the problem:

The `Debug` trait seems to honor `width` for numeric and pointer types, but not for other types.

For example: 

``` rust
    println!("(i,j,k): |{:30?}|", msg);
```

does not necessarily put at least 30 characters between the two `|` characters that it prints; in the case of `msg` given above, it prints:

```
(i,j,k): |"Hello"|
```

Here is a [playpen](http://is.gd/NGt8cW) illustrating the problem on several inputs.
Repository: go
Issue: x/tools/cmd/oracle: 'implements' query needs to inspect all packages in the analysis scope
Labels: Tools

The implements query inspects only the query package and its forward transitive closure, but users expect (and the documentation states) that it will report all related types in the analysis scope.  Thus a query at bufio.Reader will report io.Reader, but a query at io.Reader will not report *bufio.Reader.

This is mostly likely a regression due to commit b28839e4 in March.

The implements query should load all necessary packages in the analysis scope.  It may be profitable to skip type-checking of all function bodies that do not contain a type declaration.
Repository: go
Issue: runtime: additional memory profiler report modes or similar
Labels: NeedsInvestigation

Memory profiler reports heap contents at the end of one of the previous GCs. This makes profiles "stable" in the sense that it does not dependent on exact point in time it is queried (just after GC, just before GC, somewhere in the middle). It makes sense. However, we see periodic confusion caused by the fact that actual memory consumption is actually 2x of what's reported. The meaning of the reported numbers is not obvious, it is reasonable to assume that if a tool says X MB, then memory consumption should be ~X MB.

While what we report is a useful view of reality, it is not the only view possible and maybe it should not be the default view. I think that all of the following views are useful:
- heap contents at the end of GC cycle (what we report now); shows more-of-less persistent data in heap and allows to understand why my heap is that large
- heap contents at the _beginning_ of GC cycle (total memory consumption should be GOGC times larger than the prvious one); allows to understand memory consumption of the program and shows kind of worst case view of heap; this view can also be appealing to developers with C/C++ background
- difference between the previous two modes (what was collected during a GC cycle); allows to understand why GCs are happening so frequently and optimize performance (identify transient allocs)

Also, if you are presented with several options, it forces you to ask yourself a question regarding the difference between these options. If you understand the difference, you interpret the data correctly.

The proposal is to add these additional modes to memory profiler. Exact set of modes and the default mode is discussable. Degenerate case would be just to switch the default.

From implementation point of view, I think all proposed modes are easy to implement in the current phased design.
Repository: vscode
Issue: Explore: Integrated TypeScript building/transpilation
Labels: feature-request,upstream,typescript

Make it simpler to setup TypeScript compilation.
Can we make this incrementally?
Repository: go
Issue: cmd/cgo: make identical C types identical Go types across packages
Labels: compiler/runtime

https://golang.org/cmd/cgo/ says:

>  Cgo translates C types into equivalent unexported Go types. Because the translations are unexported, a Go package should not expose C types in its exported API: a C type used in one Go package is different from the same C type used in another.

While that's a convenient workaround for allowing access to struct fields and other names that would otherwise be inaccessible as Go identifiers, it greatly complicates the process of writing Go APIs for export to C callers.  The Go code to produce and/or manipulate C values must be essentially confined to a single package.

It would be nice to remove that restriction: instead of treating C types as unexported local types, we should treat them as exported types in the "C" package (and similarly export the lower-case names that would otherwise be unexported).
Repository: TypeScript
Issue: [tsserver] "Error processing request. watch  ENOENT" with TypeScript 1.7.3
Labels: Bug,Help Wanted

I have a problem "Error processing request. watch  ENOENT" when I send an open command. To reproduce since I have migrated to 1.7.3 (with 1.6, it worked).

Here steps to reproduce the problem:
- create a folder `C:/sample`  which contains 2 files : 
  - `a.ts` which is empty
  -  `tsconfig.json` which contains `{}`
- do `cd .C:/sample`
- do `node YOU_TYPESCRIPT_PATH/lib/tsserver.js`
- do `{"seq":0,"type":"request","command":"open","arguments":{"file":"a.ts"}}`

After validate the open command, tsserver throws the following error:

``` json
{"seq":0,"type":"response","command":"open","request_seq":0,"success":false,"mes
sage":"Error processing request. watch  ENOENT"}
```

After debugging, it seems that problem comes from https://github.com/Microsoft/TypeScript/blob/master/src/server/editorServices.ts#L1245

``` javascript
project.directoryWatcher = this.host.watchDirectory(
                    ts.getDirectoryPath(configFilename),
                    path => this.directoryWatchedForSourceFilesChanged(project, path),
                    /*recursive*/ true
                );
```

The `ts.getDirectoryPath(configFilename)` return empty, and it seems that it's the problem.

Many thanks for your help.