def get_navigation(self, view, r):
        # FIXME(guillermooo): we may have a race condition here, or get info
        # for the wrong file.
        navigation = editor_context.navigation

        if not navigation:
            sublime.status_message('Dart: No navigation available.')
            return

        sources = navigation.regions

        # TODO(guillermooo): move this check to the generated API.
        targets = [source for source in sources
                        if source.offset <= r.begin() <= (source.offset + source.length)]

        if not targets:
            show_status_tooltip("No navigations available at this location.", timeout=3000)
            sublime.status_message('Dart: No navigations available for the current location.')
            return

        first_target = targets[0].targets[0]
        first_target = navigation.targets[first_target]

        fname = navigation.files[first_target.fileIndex]
        row = first_target.startLine
        col = first_target.startColumn

        self.window.open_file("{}:{}:{}".format(fname, row, col), sublime.ENCODED_POSITION)
dataset/ETHPy150Open guillermooo/dart-sublime-bundle/navigation.py/DartGoToDeclaration.get_navigation/original