{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/1608","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/1608/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/1608/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/1608/events","html_url":"https://github.com/Microsoft/vscode/issues/1608","id":123628396,"number":1608,"title":"Jungle of editor abstractions and services","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},"labels":[{"url":"https://api.github.com/repos/Microsoft/vscode/labels/debt","name":"debt","color":"bfe5bf"}],"state":"open","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},"milestone":{"url":"https://api.github.com/repos/Microsoft/vscode/milestones/3","html_url":"https://github.com/Microsoft/vscode/milestones/Jan%202016","labels_url":"https://api.github.com/repos/Microsoft/vscode/milestones/3/labels","id":1354261,"number":3,"title":"Jan 2016","description":"","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":34,"closed_issues":67,"state":"open","created_at":"2015-10-13T23:36:50Z","updated_at":"2016-01-06T15:49:53Z","due_on":"2016-01-29T23:00:00Z","closed_at":null},"comments":8,"created_at":"2015-12-23T09:36:21Z","updated_at":"2016-01-06T18:57:34Z","closed_at":null,"body":"We have many ways to talk about models and editors and while it might have made sense back then we should consider to consolidate them. Let's start by taking inventory:\r\n\r\nOn the service side we have:\r\n\r\n1. IEditorService (in platform/editor/common)\r\n2. IWorkbenchEditorService (in workbench/services/editor)\r\n3. ICodeEditorService (in editor/common/services)\r\n4. IModelService (in editor/common/services)\r\n\r\nThe latter two use editor types like `IModel`, `ICodeEditor` etc while the former two abstract them away, like `IEditor` and `ITextEditorModel`.  Tho, those abstractions are very weak and often you encounter code like this: `let editor = this.editorService.getActiveEditor(); this.lastKnownEditorViewState = (<IEditor>editor.getControl()).saveViewState();`\r\n\r\nI think this needs simplification in the face of the challenge of building a simple API that hides all of this. Also, there are semantic differences, like `IWorkbenchEditorService` not knowing anything about inline-editors and `ICodeEditorService` not knowing anything about the _active_ editor etc. \r\n\r\nLet's collection more issues and let's discuss @alexandrudima @bpasero \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/comments/169419838","html_url":"https://github.com/Microsoft/vscode/issues/1608#issuecomment-169419838","issue_url":"https://api.github.com/repos/Microsoft/vscode/issues/1608","id":169419838,"user":{"login":"alexandrudima","id":5047891,"avatar_url":"https://avatars.githubusercontent.com/u/5047891?v=3","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},"created_at":"2016-01-06T18:57:34Z","updated_at":"2016-01-06T18:57:34Z","body":":+1: for consolidation, but I'm not sure how.\r\n\r\nI originally added `ICodeEditorService` because I needed a means to go from a global context (keybinding dispatching) to the code editor that should receive the command without sticking pointers in the DOM. Since then, I think we also use the `ICodeEditorService` for syncing text editors to the extension host.\r\n\r\nThe `IModelService` acts as the syncing hub for all text buffers which I think is a lot better than before when the text syncing happened through the modes.\r\n\r\nHard to say where to cut from. Perhaps we should look at the users of `IEditorService` in the `platform` and `editor` layer, I think most of the times `IEditorService` is used for opening things. Perhaps that should be done somehow differently or renamed (e.g. `IEditorService` sometimes opens a web browser and not an editor...). Also `getActiveEditor` is a bit misleading (implies there is always an active editor?) as the focus could be in a viewlet or no editors are opened, in which case I'm not sure what that method returns."}}