{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/monaco-editor/issues/973","repository_url":"https://api.github.com/repos/Microsoft/monaco-editor","labels_url":"https://api.github.com/repos/Microsoft/monaco-editor/issues/973/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/monaco-editor/issues/973/comments","events_url":"https://api.github.com/repos/Microsoft/monaco-editor/issues/973/events","html_url":"https://github.com/Microsoft/monaco-editor/issues/973","id":343806514,"node_id":"MDU6SXNzdWUzNDM4MDY1MTQ=","number":973,"title":"Wrong typing of `IEditorConstructionOptions.model`","user":{"login":"ulrichb","id":388796,"node_id":"MDQ6VXNlcjM4ODc5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/388796?v=4","gravatar_id":"","url":"https://api.github.com/users/ulrichb","html_url":"https://github.com/ulrichb","followers_url":"https://api.github.com/users/ulrichb/followers","following_url":"https://api.github.com/users/ulrichb/following{/other_user}","gists_url":"https://api.github.com/users/ulrichb/gists{/gist_id}","starred_url":"https://api.github.com/users/ulrichb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulrichb/subscriptions","organizations_url":"https://api.github.com/users/ulrichb/orgs","repos_url":"https://api.github.com/users/ulrichb/repos","events_url":"https://api.github.com/users/ulrichb/events{/privacy}","received_events_url":"https://api.github.com/users/ulrichb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"alexandrudima","id":5047891,"node_id":"MDQ6VXNlcjUwNDc4OTE=","avatar_url":"https://avatars3.githubusercontent.com/u/5047891?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrudima","html_url":"https://github.com/alexandrudima","followers_url":"https://api.github.com/users/alexandrudima/followers","following_url":"https://api.github.com/users/alexandrudima/following{/other_user}","gists_url":"https://api.github.com/users/alexandrudima/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrudima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrudima/subscriptions","organizations_url":"https://api.github.com/users/alexandrudima/orgs","repos_url":"https://api.github.com/users/alexandrudima/repos","events_url":"https://api.github.com/users/alexandrudima/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrudima/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexandrudima","id":5047891,"node_id":"MDQ6VXNlcjUwNDc4OTE=","avatar_url":"https://avatars3.githubusercontent.com/u/5047891?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrudima","html_url":"https://github.com/alexandrudima","followers_url":"https://api.github.com/users/alexandrudima/followers","following_url":"https://api.github.com/users/alexandrudima/following{/other_user}","gists_url":"https://api.github.com/users/alexandrudima/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrudima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrudima/subscriptions","organizations_url":"https://api.github.com/users/alexandrudima/orgs","repos_url":"https://api.github.com/users/alexandrudima/repos","events_url":"https://api.github.com/users/alexandrudima/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrudima/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/monaco-editor/milestones/15","html_url":"https://github.com/Microsoft/monaco-editor/milestone/15","labels_url":"https://api.github.com/repos/Microsoft/monaco-editor/milestones/15/labels","id":3557960,"node_id":"MDk6TWlsZXN0b25lMzU1Nzk2MA==","number":15,"title":"July 2018","description":"","creator":{"login":"alexandrudima","id":5047891,"node_id":"MDQ6VXNlcjUwNDc4OTE=","avatar_url":"https://avatars3.githubusercontent.com/u/5047891?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrudima","html_url":"https://github.com/alexandrudima","followers_url":"https://api.github.com/users/alexandrudima/followers","following_url":"https://api.github.com/users/alexandrudima/following{/other_user}","gists_url":"https://api.github.com/users/alexandrudima/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrudima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrudima/subscriptions","organizations_url":"https://api.github.com/users/alexandrudima/orgs","repos_url":"https://api.github.com/users/alexandrudima/repos","events_url":"https://api.github.com/users/alexandrudima/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrudima/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":1,"state":"open","created_at":"2018-08-09T10:05:12Z","updated_at":"2018-08-09T10:55:42Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-07-23T21:42:18Z","updated_at":"2018-08-09T10:55:42Z","closed_at":"2018-08-09T10:55:42Z","author_association":"NONE","body":"At the moment [`IEditorConstructionOptions.model`](https://github.com/Microsoft/monaco-editor/blob/14f6229243233f456eb688c0dbdf505c61731b64/monaco.d.ts#L1011-L1014) is typed `ITextModel | undefined` but it should be typed `ITextModel | null | undefined`.\r\n\r\nNote that the difference between null and undefined is that `null` does not create a model (see [this comment](https://github.com/Microsoft/monaco-editor/blob/14f6229243233f456eb688c0dbdf505c61731b64/monaco.d.ts#L1017)) and `undefined` creates an _empty_ model.\r\n\r\nConsequently also [`ICodeEditor.getModel()`](https://github.com/Microsoft/monaco-editor/blob/14f6229243233f456eb688c0dbdf505c61731b64/monaco.d.ts#L3721) (and possibly other occurrences) need to include `null` too.\r\n\r\nAlso [`setModel()`](https://github.com/Microsoft/monaco-editor/blob/14f6229243233f456eb688c0dbdf505c61731b64/monaco.d.ts#L2152-L2154) should include `null`."}}
{"actor":{"display_login":"alexandrudima"}}