{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/50248","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/50248/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/50248/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/50248/events","html_url":"https://github.com/Microsoft/vscode/issues/50248","id":325082234,"number":50248,"title":"Add CodeActionContext.triggerKind","user":{"login":"mjbvz","id":12821956,"avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false},"labels":[{"id":869332220,"url":"https://api.github.com/repos/Microsoft/vscode/labels/api-proposal","name":"api-proposal","color":"83defc","default":false},{"id":635068821,"url":"https://api.github.com/repos/Microsoft/vscode/labels/on-testplan","name":"on-testplan","color":"E2A1C2","default":false}],"state":"closed","locked":false,"assignee":{"login":"mjbvz","id":12821956,"avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false},"assignees":[{"login":"mjbvz","id":12821956,"avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/vscode/milestones/67","html_url":"https://github.com/Microsoft/vscode/milestone/67","labels_url":"https://api.github.com/repos/Microsoft/vscode/milestones/67/labels","id":3236860,"number":67,"title":"May 2018","description":"","creator":{"login":"mjbvz","id":12821956,"avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false},"open_issues":133,"closed_issues":347,"state":"open","created_at":"2018-04-03T01:16:18Z","updated_at":"2018-05-25T21:53:58Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-05-21T22:39:33Z","updated_at":"2018-05-25T21:59:08Z","closed_at":"2018-05-24T15:14:09Z","author_association":"CONTRIBUTOR","body":"**Problem**\r\nIn JS/TS, we currently only show refactorings when the user has an active selection. This logic prevents us from showing the `move to file` refactoring in cases like:\r\n\r\n```ts\r\nclass Foo {}\r\n```\r\n\r\nif the user merely puts their cursor on `Foo` and requests refactorings\r\n\r\n**Proposal**\r\nIn JS/TS, computing refactorings can be expensive, so we'd like the following:\r\n\r\n* Automatically show refactorings if the user has an active selection\r\n* Always show refactorings if the user requests them (regardless of current selection)\r\n\r\nTo support the second case, I propose adding a `triggerKind` to the `CodeActionContext`:\r\n\r\n```ts\r\ninterface CodeActionTriggerKind {\r\n     Automatic,\r\n    Manual\r\n}\r\n\r\ninterface CodeActionContext {\r\n    ...\r\n\r\n    triggerKind?: CodeActionTriggerKind\r\n}\r\n```\r\n\r\nThis would allow the JS/TS refactor provider to check the `triggerKind` before trying to compute refactorings\r\n\r\n/ cc @jrieken \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/392198258","html_url":"https://github.com/Microsoft/vscode/issues/50248#issuecomment-392198258","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/50248","id":392198258,"user":{"login":"mjbvz","id":12821956,"avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false},"created_at":"2018-05-25T21:59:08Z","updated_at":"2018-05-25T21:59:08Z","author_association":"CONTRIBUTOR","body":"This will be verified as part of #50486"}}
{"actor":{"display_login":"mjbvz"}}