{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/12562","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/12562/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/12562/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/12562/events","html_url":"https://github.com/Microsoft/vscode/issues/12562","id":179049551,"number":12562,"title":"Uri to specific line doesn't work","user":{"login":"tomi","id":10324676,"avatar_url":"https://avatars.githubusercontent.com/u/10324676?v=3","gravatar_id":"","url":"https://api.github.com/users/tomi","html_url":"https://github.com/tomi","followers_url":"https://api.github.com/users/tomi/followers","following_url":"https://api.github.com/users/tomi/following{/other_user}","gists_url":"https://api.github.com/users/tomi/gists{/gist_id}","starred_url":"https://api.github.com/users/tomi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomi/subscriptions","organizations_url":"https://api.github.com/users/tomi/orgs","repos_url":"https://api.github.com/users/tomi/repos","events_url":"https://api.github.com/users/tomi/events{/privacy}","received_events_url":"https://api.github.com/users/tomi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/vscode/labels/bug","name":"bug","color":"E57E7E"},{"url":"https://api.github.com/repos/Microsoft/vscode/labels/webview","name":"webview","color":"c5def5"}],"state":"closed","locked":false,"assignee":{"login":"jrieken","id":1794099,"avatar_url":"https://avatars.githubusercontent.com/u/1794099?v=3","gravatar_id":"","url":"https://api.github.com/users/jrieken","html_url":"https://github.com/jrieken","followers_url":"https://api.github.com/users/jrieken/followers","following_url":"https://api.github.com/users/jrieken/following{/other_user}","gists_url":"https://api.github.com/users/jrieken/gists{/gist_id}","starred_url":"https://api.github.com/users/jrieken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrieken/subscriptions","organizations_url":"https://api.github.com/users/jrieken/orgs","repos_url":"https://api.github.com/users/jrieken/repos","events_url":"https://api.github.com/users/jrieken/events{/privacy}","received_events_url":"https://api.github.com/users/jrieken/received_events","type":"User","site_admin":false},"assignees":[{"login":"jrieken","id":1794099,"avatar_url":"https://avatars.githubusercontent.com/u/1794099?v=3","gravatar_id":"","url":"https://api.github.com/users/jrieken","html_url":"https://github.com/jrieken","followers_url":"https://api.github.com/users/jrieken/followers","following_url":"https://api.github.com/users/jrieken/following{/other_user}","gists_url":"https://api.github.com/users/jrieken/gists{/gist_id}","starred_url":"https://api.github.com/users/jrieken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrieken/subscriptions","organizations_url":"https://api.github.com/users/jrieken/orgs","repos_url":"https://api.github.com/users/jrieken/repos","events_url":"https://api.github.com/users/jrieken/events{/privacy}","received_events_url":"https://api.github.com/users/jrieken/received_events","type":"User","site_admin":false},{"login":"kieferrm","id":4674940,"avatar_url":"https://avatars.githubusercontent.com/u/4674940?v=3","gravatar_id":"","url":"https://api.github.com/users/kieferrm","html_url":"https://github.com/kieferrm","followers_url":"https://api.github.com/users/kieferrm/followers","following_url":"https://api.github.com/users/kieferrm/following{/other_user}","gists_url":"https://api.github.com/users/kieferrm/gists{/gist_id}","starred_url":"https://api.github.com/users/kieferrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kieferrm/subscriptions","organizations_url":"https://api.github.com/users/kieferrm/orgs","repos_url":"https://api.github.com/users/kieferrm/repos","events_url":"https://api.github.com/users/kieferrm/events{/privacy}","received_events_url":"https://api.github.com/users/kieferrm/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/vscode/milestones/29","html_url":"https://github.com/Microsoft/vscode/milestones/October%202016","labels_url":"https://api.github.com/repos/Microsoft/vscode/milestones/29/labels","id":2019000,"number":29,"title":"October 2016","description":null,"creator":{"login":"weinand","id":1898161,"avatar_url":"https://avatars.githubusercontent.com/u/1898161?v=3","gravatar_id":"","url":"https://api.github.com/users/weinand","html_url":"https://github.com/weinand","followers_url":"https://api.github.com/users/weinand/followers","following_url":"https://api.github.com/users/weinand/following{/other_user}","gists_url":"https://api.github.com/users/weinand/gists{/gist_id}","starred_url":"https://api.github.com/users/weinand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weinand/subscriptions","organizations_url":"https://api.github.com/users/weinand/orgs","repos_url":"https://api.github.com/users/weinand/repos","events_url":"https://api.github.com/users/weinand/events{/privacy}","received_events_url":"https://api.github.com/users/weinand/received_events","type":"User","site_admin":false},"open_issues":130,"closed_issues":36,"state":"open","created_at":"2016-09-21T11:16:13Z","updated_at":"2016-10-04T08:53:11Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-09-24T20:14:53Z","updated_at":"2016-10-04T08:53:11Z","closed_at":"2016-10-04T08:53:11Z","body":"- VSCode Version: 1.5.1\r\n- OS Version: 10.11.6 (15G1004)\r\n\r\nSteps to Reproduce:\r\n\r\n1. Create an extension that uses `vscode.previewHtml` command to open an URI that is registered to `TextDocumentContentProvider`\r\n2. Generate a document that contains a link to a file URI to a specific line. I've noticed the file needs to be in the current project that is open. If it's not, the bug doesn't appear.\r\n3. The link doesn't work when it has also a line reference, without it it works.\r\n\r\nFor example I was able to reproduce the issue with the extension below. Execute the command when there's a file open in the project. The URI to the file to a specific line doesn't work, but the URI to the same file without line specified it works.\r\n\r\n```javascript\r\n\"use strict\";\r\n\r\nconst vscode = require(\"vscode\");\r\n\r\nconst scheme = \"test-scheme\";\r\nconst eventEmitter = new vscode.EventEmitter();\r\n\r\nconst provider = {\r\n    scheme,\r\n\r\n    provideTextDocumentContent: function(uri) {\r\n        const file = vscode.window.activeTextEditor.document.uri.toString();\r\n        const urlWithLine = `${ file }#L10`;\r\n        const urlWoLine = `${ file }`;\r\n        return `\r\n<a href=\"${ urlWithLine }\">Link to file with line, doesn't work</a><br/><br/>\r\n<a href=\"${ urlWoLine }\">Link to same file without line, works</a>\r\n`;\r\n    },\r\n\r\n    onDidChange: function() {\r\n        return eventEmitter.event;\r\n    },\r\n\r\n    update: function(uri) {\r\n        eventEmitter.fire(uri);\r\n    }\r\n};\r\n\r\nfunction exec() {\r\n    const uri = vscode.Uri.parse(`${ scheme }://test/test`);\r\n    vscode.commands.executeCommand(\"vscode.previewHtml\", uri);\r\n}\r\n\r\nfunction activate(context) {\r\n    context.subscriptions.push(vscode.commands.registerCommand(\"testExt.exec\", exec));\r\n\r\n    context.subscriptions.push(vscode.workspace.registerTextDocumentContentProvider(scheme, provider));\r\n}\r\n\r\nexports.activate = activate;\r\n```\r\n\r\n![vscode-bug](https://cloud.githubusercontent.com/assets/10324676/18810970/879d1388-82ac-11e6-9e65-a252cfdeabb2.gif)\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/251331558","html_url":"https://github.com/Microsoft/vscode/issues/12562#issuecomment-251331558","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/12562","id":251331558,"user":{"login":"jrieken","id":1794099,"avatar_url":"https://avatars.githubusercontent.com/u/1794099?v=3","gravatar_id":"","url":"https://api.github.com/users/jrieken","html_url":"https://github.com/jrieken","followers_url":"https://api.github.com/users/jrieken/followers","following_url":"https://api.github.com/users/jrieken/following{/other_user}","gists_url":"https://api.github.com/users/jrieken/gists{/gist_id}","starred_url":"https://api.github.com/users/jrieken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrieken/subscriptions","organizations_url":"https://api.github.com/users/jrieken/orgs","repos_url":"https://api.github.com/users/jrieken/repos","events_url":"https://api.github.com/users/jrieken/events{/privacy}","received_events_url":"https://api.github.com/users/jrieken/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T08:53:11Z","updated_at":"2016-10-04T08:53:11Z","body":"fixed with #12966"}}
{"actor":{"display_login":"jrieken"}}