GitHub PullRequestReviewCommentEvent at 2014-04-24 17:49:43
Repository: spark
Actor: umop
Payload: {"comment":{"url":"https://api.github.com/repos/dart-lang/spark/pulls/comments/11961395","id":11961395,"diff_hunk":"@@ -173,6 +187,27 @@ class DartEditor extends TextEditor {\n       super._create(aceManager, file);\n \n   bool get supportsOutline => true;\n+\n+  void navigateToDeclaration() {\n+    int offset = _session.document.positionToIndex(\n+        aceManager._aceEditor.cursorPosition);\n+\n+    aceManager._analysisService.getDeclarationFor(file, offset).then(\n+        (svc.Declaration declaration) {\n+      if (declaration != null) {\n+        workspace.File targetFile = declaration.getFile(file.project);\n+\n+        // Open targetFile and select the range of text.\n+        if (targetFile != null) {\n+          aceManager.delegate.openEditor(targetFile).then((Editor editor) {","path":"ide/app/lib/ace.dart","position":44,"original_position":44,"commit_id":"5d7f255b1fbee5acf6dc4a7d5cec588ac67b8d5d","original_commit_id":"5d7f255b1fbee5acf6dc4a7d5cec588ac67b8d5d","user":{"login":"umop","id":357955,"avatar_url":"https://avatars.githubusercontent.com/u/357955?","gravatar_id":"760a960a97dc4d2ba2cf242b740004cf","url":"https://api.github.com/users/umop","html_url":"https://github.com/umop","followers_url":"https://api.github.com/users/umop/followers","following_url":"https://api.github.com/users/umop/following{/other_user}","gists_url":"https://api.github.com/users/umop/gists{/gist_id}","starred_url":"https://api.github.com/users/umop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umop/subscriptions","organizations_url":"https://api.github.com/users/umop/orgs","repos_url":"https://api.github.com/users/umop/repos","events_url":"https://api.github.com/users/umop/events{/privacy}","received_events_url":"https://api.github.com/users/umop/received_events","type":"User","site_admin":false},"body":"Ah.  This is what I was missing.  Feels a bit strange / unMVC to control the opened file from the editor.  Should this maybe live in AceManager or somewhere external to Editor?","created_at":"2014-04-24T17:49:43Z","updated_at":"2014-04-24T17:49:43Z","html_url":"https://github.com/dart-lang/spark/pull/1685#discussion_r11961395","pull_request_url":"https://api.github.com/repos/dart-lang/spark/pulls/1685","_links":{"self":{"href":"https://api.github.com/repos/dart-lang/spark/pulls/comments/11961395"},"html":{"href":"https://github.com/dart-lang/spark/pull/1685#discussion_r11961395"},"pull_request":{"href":"https://api.github.com/repos/dart-lang/spark/pulls/1685"}}}}