{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/11250","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/11250/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/11250/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/11250/events","html_url":"https://github.com/Microsoft/vscode/issues/11250","id":174124176,"number":11250,"title":"Is it possible to call a command registered in an extension from the tasks.json?","user":{"login":"yanchenw","id":1532591,"avatar_url":"https://avatars.githubusercontent.com/u/1532591?v=3","gravatar_id":"","url":"https://api.github.com/users/yanchenw","html_url":"https://github.com/yanchenw","followers_url":"https://api.github.com/users/yanchenw/followers","following_url":"https://api.github.com/users/yanchenw/following{/other_user}","gists_url":"https://api.github.com/users/yanchenw/gists{/gist_id}","starred_url":"https://api.github.com/users/yanchenw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanchenw/subscriptions","organizations_url":"https://api.github.com/users/yanchenw/orgs","repos_url":"https://api.github.com/users/yanchenw/repos","events_url":"https://api.github.com/users/yanchenw/events{/privacy}","received_events_url":"https://api.github.com/users/yanchenw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/vscode/labels/feature-request","name":"feature-request","color":"bfe5bf"},{"url":"https://api.github.com/repos/Microsoft/vscode/labels/tasks","name":"tasks","color":"1d76db"}],"state":"open","locked":false,"assignee":{"login":"dbaeumer","id":1931590,"avatar_url":"https://avatars.githubusercontent.com/u/1931590?v=3","gravatar_id":"","url":"https://api.github.com/users/dbaeumer","html_url":"https://github.com/dbaeumer","followers_url":"https://api.github.com/users/dbaeumer/followers","following_url":"https://api.github.com/users/dbaeumer/following{/other_user}","gists_url":"https://api.github.com/users/dbaeumer/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaeumer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaeumer/subscriptions","organizations_url":"https://api.github.com/users/dbaeumer/orgs","repos_url":"https://api.github.com/users/dbaeumer/repos","events_url":"https://api.github.com/users/dbaeumer/events{/privacy}","received_events_url":"https://api.github.com/users/dbaeumer/received_events","type":"User","site_admin":false},"assignees":[{"login":"dbaeumer","id":1931590,"avatar_url":"https://avatars.githubusercontent.com/u/1931590?v=3","gravatar_id":"","url":"https://api.github.com/users/dbaeumer","html_url":"https://github.com/dbaeumer","followers_url":"https://api.github.com/users/dbaeumer/followers","following_url":"https://api.github.com/users/dbaeumer/following{/other_user}","gists_url":"https://api.github.com/users/dbaeumer/gists{/gist_id}","starred_url":"https://api.github.com/users/dbaeumer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbaeumer/subscriptions","organizations_url":"https://api.github.com/users/dbaeumer/orgs","repos_url":"https://api.github.com/users/dbaeumer/repos","events_url":"https://api.github.com/users/dbaeumer/events{/privacy}","received_events_url":"https://api.github.com/users/dbaeumer/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/vscode/milestones/8","html_url":"https://github.com/Microsoft/vscode/milestones/Backlog","labels_url":"https://api.github.com/repos/Microsoft/vscode/milestones/8/labels","id":1412124,"number":8,"title":"Backlog","description":"Work not yet planned for a specific release.","creator":{"login":"chrisdias","id":1487073,"avatar_url":"https://avatars.githubusercontent.com/u/1487073?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdias","html_url":"https://github.com/chrisdias","followers_url":"https://api.github.com/users/chrisdias/followers","following_url":"https://api.github.com/users/chrisdias/following{/other_user}","gists_url":"https://api.github.com/users/chrisdias/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdias/subscriptions","organizations_url":"https://api.github.com/users/chrisdias/orgs","repos_url":"https://api.github.com/users/chrisdias/repos","events_url":"https://api.github.com/users/chrisdias/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdias/received_events","type":"User","site_admin":false},"open_issues":1386,"closed_issues":860,"state":"open","created_at":"2015-11-15T10:30:19Z","updated_at":"2016-09-03T09:09:10Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-08-30T20:57:40Z","updated_at":"2016-09-03T15:48:06Z","closed_at":null,"body":"I have a VS Code extension which registered a command via vscode.commands.registerCommand('extension.sayHello').\r\n\r\nIs there anyway I can define a task in tasks.json which invokes this command?\r\n\r\n```\r\n{\r\n    \"version\": \"0.1.0\",\r\n    \"command\": \"vscode\", // here\r\n    \"isShellCommand\": false,\r\n    \"args\": [],\r\n        \"tasks\": [\r\n            {\r\n                \"taskName\": \"sayHello\", // here\r\n                \"suppressTaskName\": true,\r\n                \"args\": [],\r\n                \"isBuildCommand\": false,\r\n                \"showOutput\": \"always\",\r\n                \"echoCommand\": true\r\n            }\r\n        ]\r\n}\r\n```\r\n\r\nAlternatively, is it possible to invoke this command from preLaunchTask in launch.json?\r\n\r\n```\r\n    \"configurations\": [\r\n        {\r\n            \"name\":\"Test\",\r\n            \"request\": \"launch\",\r\n            \"preLaunchTask\": \"vscode.extension.sayHello\" // here?\r\n        }\r\n    ]\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/244553884","html_url":"https://github.com/Microsoft/vscode/issues/11250#issuecomment-244553884","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/11250","id":244553884,"user":{"login":"egamma","id":172399,"avatar_url":"https://avatars.githubusercontent.com/u/172399?v=3","gravatar_id":"","url":"https://api.github.com/users/egamma","html_url":"https://github.com/egamma","followers_url":"https://api.github.com/users/egamma/followers","following_url":"https://api.github.com/users/egamma/following{/other_user}","gists_url":"https://api.github.com/users/egamma/gists{/gist_id}","starred_url":"https://api.github.com/users/egamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egamma/subscriptions","organizations_url":"https://api.github.com/users/egamma/orgs","repos_url":"https://api.github.com/users/egamma/repos","events_url":"https://api.github.com/users/egamma/events{/privacy}","received_events_url":"https://api.github.com/users/egamma/received_events","type":"User","site_admin":false},"created_at":"2016-09-03T15:48:06Z","updated_at":"2016-09-03T15:48:06Z","body":"@yanchenw \r\n\r\n>@dbaeumer @isidorn actually my problem is not to \"activate\" the extension but to subscribe to the debug and build event to do something every time user start debug or build. \r\n\r\nI recommend to not do this via some subscription mechanism, but your extension should generate a custom task.json and contribute to the launch.config (API for doing this will be added soon).\r\n\r\n>The problem is we wrap our service functions in .net dll and try to invoke them in vs code extension using service hub, but it seems hard for current VS code extension to support the e2e scenario we need.\r\n\r\nMy recommendation would be to write the service functions as a node module that you then consume in VS Code from your extension as a dependency and in VS you consume the service through ServiceHub.\r\n\r\nCan you point me to the service functions so that I can understand this scenario better? "}}
{"actor":{"display_login":"egamma"}}