{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5829","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5829/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5829/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5829/events","html_url":"https://github.com/Microsoft/TypeScript/issues/5829","id":119470452,"number":5829,"title":"tsserver must either inform 'clients' about tsconfig.json changes or recompute diagnostics","user":{"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},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"zhengbli","id":1171301,"avatar_url":"https://avatars.githubusercontent.com/u/1171301?v=3","gravatar_id":"","url":"https://api.github.com/users/zhengbli","html_url":"https://github.com/zhengbli","followers_url":"https://api.github.com/users/zhengbli/followers","following_url":"https://api.github.com/users/zhengbli/following{/other_user}","gists_url":"https://api.github.com/users/zhengbli/gists{/gist_id}","starred_url":"https://api.github.com/users/zhengbli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhengbli/subscriptions","organizations_url":"https://api.github.com/users/zhengbli/orgs","repos_url":"https://api.github.com/users/zhengbli/repos","events_url":"https://api.github.com/users/zhengbli/events{/privacy}","received_events_url":"https://api.github.com/users/zhengbli/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/15","html_url":"https://github.com/Microsoft/TypeScript/milestones/TypeScript%201.8","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/15/labels","id":1347987,"number":15,"title":"TypeScript 1.8","description":"","creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":133,"closed_issues":135,"state":"open","created_at":"2015-10-09T22:07:47Z","updated_at":"2015-12-07T03:56:28Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-11-30T11:08:51Z","updated_at":"2015-12-07T15:22:12Z","closed_at":null,"body":"Clients currently need to actively request diagnostics for TS files from the tsserver. The are not pushed 'automatically' by the tsserver. This causes problems when the tsconfig.json file changes. Consider the following test case:\r\n\r\n- a TS file with use of decorators.\r\n- tsconfig.json doesn't have a experimentalDecorators flag.\r\n- editor shows a corresponding error\r\n\r\nUser edits the tsconfig.json file and adds experimentalDecorators: true. \r\n\r\nDepending on timing the errors in the editor disappear. Here is what happens in detail in VSCode and tsserver:\r\n\r\n- the tsconfig.json file gets saved: both tsserver and VSCode receive the file event\r\n- case 1.) VSCode processes the file event first and requests diagnostics but the tsserver hasn't processed the event yet. As a result the errors don't disappear.\r\n- case 2.) tsserver has processed the file event before VSCode requests diagnostics. The errors disappear.\r\n\r\nTo reliable fix this the tsserver must either inform the editor about a 'reload' of the tsconfig.json file so that the editor re-requests all diagnostics. Of we change the protocol in a way that the tsserver can decide by itself to re-compute diagnostics. "},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/162555725","html_url":"https://github.com/Microsoft/TypeScript/issues/5829#issuecomment-162555725","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/5829","id":162555725,"user":{"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},"created_at":"2015-12-07T15:22:11Z","updated_at":"2015-12-07T15:22:11Z","body":"But the tsserver could better optimize this. Consider the case where the server manages two 'open' tsconfig.json project. Now one tsconfig.json file changes. If the editor needs to request the errors it will do it for all open file since the editor doesn't want to recode the logic of knowing which files are covered by which tsconfig.json file. However the tsserver already has that knowledge and only recomputes errors for open files covered by the tsconfig.json file that changed. This results in shorter blocking calls at the end."}}