/* ValaSymbolOutline.c generated by valac 0.56.19, the Vala compiler
 * generated from ValaSymbolOutline.vala, do not modify */

/*-
 * Copyright (c) 2017-2018 elementary LLC. (https://elementary.io)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include "codecore.h"
#include <vala.h>
#include <gio/gio.h>
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <gee.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	SCRATCH_SERVICES_VALA_SYMBOL_OUTLINE_0_PROPERTY,
	SCRATCH_SERVICES_VALA_SYMBOL_OUTLINE_NUM_PROPERTIES
};
static GParamSpec* scratch_services_vala_symbol_outline_properties[SCRATCH_SERVICES_VALA_SYMBOL_OUTLINE_NUM_PROPERTIES];
#define _vala_code_visitor_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_visitor_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block62Data Block62Data;
#define _vala_code_context_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_context_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_report_unref0(var) ((var == NULL) ? NULL : (var = (vala_report_unref (var), NULL)))
typedef struct _Block63Data Block63Data;
#define _g_thread_unref0(var) ((var == NULL) ? NULL : (var = (g_thread_unref (var), NULL)))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))

struct _ScratchServicesValaSymbolOutlinePrivate {
	CodePluginsValaSymbolResolver* resolver;
	ValaParser* parser;
	GCancellable* cancellable;
	guint parse_timeout_id;
};

struct _Block62Data {
	int _ref_count_;
	ScratchServicesValaSymbolOutline* self;
	ValaCodeContext* context;
};

struct _Block63Data {
	int _ref_count_;
	Block62Data * _data62_;
	CodeWidgetsSourceListExpandableItem* new_root;
};

static gint ScratchServicesValaSymbolOutline_private_offset;
static gpointer scratch_services_vala_symbol_outline_parent_class = NULL;
static gpointer report_parent_class = NULL;

static void scratch_services_vala_symbol_outline_doc_closed (ScratchServicesValaSymbolOutline* self,
                                                      ScratchServicesDocument* doc);
static void _scratch_services_vala_symbol_outline_doc_closed_scratch_services_document_doc_closed (ScratchServicesDocument* _sender,
                                                                                            gpointer self);
static void scratch_services_vala_symbol_outline_real_parse_symbols (ScratchServicesSymbolOutline* base);
static Block62Data* block62_data_ref (Block62Data* _data62_);
static void block62_data_unref (void * _userdata_);
static void* __lambda43_ (Block62Data* _data62_);
static Block63Data* block63_data_ref (Block63Data* _data63_);
static void block63_data_unref (void * _userdata_);
static gboolean __lambda44_ (ScratchServicesValaSymbolOutline* self);
static gboolean ___lambda44__gsource_func (gpointer self);
static CodeWidgetsSourceListExpandableItem* scratch_services_vala_symbol_outline_construct_tree (ScratchServicesValaSymbolOutline* self,
                                                                                          GCancellable* cancellable);
static gboolean ___lambda45_ (Block63Data* _data63_);
static void scratch_services_vala_symbol_outline_destroy_all_children (ScratchServicesValaSymbolOutline* self,
                                                                CodeWidgetsSourceListExpandableItem* parent);
static gboolean ____lambda45__gsource_func (gpointer self);
static gpointer ___lambda43__gthread_func (gpointer self);
static void scratch_services_vala_symbol_outline_real_add_tooltips (ScratchServicesSymbolOutline* base,
                                                             CodeWidgetsSourceListExpandableItem* root);
static void scratch_services_vala_symbol_outline_add_tooltip (ScratchServicesValaSymbolOutline* self,
                                                       CodeWidgetsSourceListExpandableItem* parent);
static void scratch_services_vala_symbol_outline_remove (ScratchServicesValaSymbolOutline* self,
                                                  CodeWidgetsSourceListItem* item,
                                                  CodeWidgetsSourceListExpandableItem* parent);
static ScratchServicesValaSymbolItem* scratch_services_vala_symbol_outline_construct_child (ScratchServicesValaSymbolOutline* self,
                                                                                     ValaSymbol* symbol,
                                                                                     CodeWidgetsSourceListExpandableItem* given_parent,
                                                                                     GCancellable* cancellable);
static ScratchServicesValaSymbolItem* scratch_services_vala_symbol_outline_find_existing (ScratchServicesValaSymbolOutline* self,
                                                                                   ValaSymbol* symbol,
                                                                                   CodeWidgetsSourceListExpandableItem* parent,
                                                                                   GCancellable* cancellable);
static GObject * scratch_services_vala_symbol_outline_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties);
static void _scratch_services_vala_symbol_outline___lambda46_ (ScratchServicesValaSymbolOutline* self,
                                                        CodeWidgetsSourceListItem* selected);
static void __scratch_services_vala_symbol_outline___lambda46__code_widgets_source_list_item_selected (CodeWidgetsSourceList* _sender,
                                                                                                CodeWidgetsSourceListItem* item,
                                                                                                gpointer self);
static void scratch_services_vala_symbol_outline_finalize (GObject * obj);
static GType scratch_services_vala_symbol_outline_get_type_once (void);
static void report_real_err (ValaReport* base,
                      ValaSourceReference* ref,
                      const gchar* msg);
static void report_real_warn (ValaReport* base,
                       ValaSourceReference* ref,
                       const gchar* msg);
static void report_real_note (ValaReport* base,
                       ValaSourceReference* ref,
                       const gchar* msg);
static void report_real_depr (ValaReport* base,
                       ValaSourceReference* ref,
                       const gchar* msg);
static GType report_get_type_once (void);

static inline gpointer
scratch_services_vala_symbol_outline_get_instance_private (ScratchServicesValaSymbolOutline* self)
{
	return G_STRUCT_MEMBER_P (self, ScratchServicesValaSymbolOutline_private_offset);
}

ScratchServicesValaSymbolOutline*
scratch_services_vala_symbol_outline_construct (GType object_type,
                                                ScratchServicesDocument* _doc)
{
	ScratchServicesValaSymbolOutline * self = NULL;
	g_return_val_if_fail (_doc != NULL, NULL);
	self = (ScratchServicesValaSymbolOutline*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "hexpand", TRUE, "doc", _doc, NULL);
	return self;
}

ScratchServicesValaSymbolOutline*
scratch_services_vala_symbol_outline_new (ScratchServicesDocument* _doc)
{
	return scratch_services_vala_symbol_outline_construct (SCRATCH_SERVICES_TYPE_VALA_SYMBOL_OUTLINE, _doc);
}

static void
_scratch_services_vala_symbol_outline_doc_closed_scratch_services_document_doc_closed (ScratchServicesDocument* _sender,
                                                                                       gpointer self)
{
	scratch_services_vala_symbol_outline_doc_closed ((ScratchServicesValaSymbolOutline*) self, _sender);
}

static void
scratch_services_vala_symbol_outline_doc_closed (ScratchServicesValaSymbolOutline* self,
                                                 ScratchServicesDocument* doc)
{
	guint _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (doc != NULL);
	g_signal_parse_name ("doc-closed", SCRATCH_SERVICES_TYPE_DOCUMENT, &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (doc, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _scratch_services_vala_symbol_outline_doc_closed_scratch_services_document_doc_closed, self);
	_tmp1_ = self->priv->cancellable;
	if (_tmp1_ != NULL) {
		GCancellable* _tmp2_;
		_tmp2_ = self->priv->cancellable;
		g_cancellable_cancel (_tmp2_);
		_g_object_unref0 (self->priv->cancellable);
		self->priv->cancellable = NULL;
	}
}

static Block62Data*
block62_data_ref (Block62Data* _data62_)
{
	g_atomic_int_inc (&_data62_->_ref_count_);
	return _data62_;
}

static void
block62_data_unref (void * _userdata_)
{
	Block62Data* _data62_;
	_data62_ = (Block62Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data62_->_ref_count_)) {
		ScratchServicesValaSymbolOutline* self;
		self = _data62_->self;
		_vala_code_context_unref0 (_data62_->context);
		_g_object_unref0 (self);
		g_slice_free (Block62Data, _data62_);
	}
}

static Block63Data*
block63_data_ref (Block63Data* _data63_)
{
	g_atomic_int_inc (&_data63_->_ref_count_);
	return _data63_;
}

static void
block63_data_unref (void * _userdata_)
{
	Block63Data* _data63_;
	_data63_ = (Block63Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data63_->_ref_count_)) {
		ScratchServicesValaSymbolOutline* self;
		self = _data63_->_data62_->self;
		_g_object_unref0 (_data63_->new_root);
		block62_data_unref (_data63_->_data62_);
		_data63_->_data62_ = NULL;
		g_slice_free (Block63Data, _data63_);
	}
}

static gboolean
__lambda44_ (ScratchServicesValaSymbolOutline* self)
{
	GCancellable* _tmp0_;
	gboolean result;
	self->priv->parse_timeout_id = (guint) 0;
	((ScratchServicesSymbolOutline*) self)->took_too_long = TRUE;
	_tmp0_ = self->priv->cancellable;
	g_cancellable_cancel (_tmp0_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda44__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda44_ ((ScratchServicesValaSymbolOutline*) self);
	return result;
}

static gboolean
___lambda45_ (Block63Data* _data63_)
{
	Block62Data* _data62_;
	ScratchServicesValaSymbolOutline* self;
	gdouble adjustment_value = 0.0;
	CodeWidgetsSourceList* _tmp0_;
	GtkAdjustment* _tmp1_;
	GtkAdjustment* _tmp2_;
	gdouble _tmp3_;
	gdouble _tmp4_;
	GeeCollection* root_children = NULL;
	CodeWidgetsSourceList* _tmp5_;
	CodeWidgetsSourceListExpandableItem* _tmp6_;
	CodeWidgetsSourceListExpandableItem* _tmp7_;
	GeeCollection* _tmp8_;
	GeeCollection* _tmp9_;
	CodeWidgetsSourceList* _tmp10_;
	CodeWidgetsSourceListExpandableItem* _tmp11_;
	CodeWidgetsSourceListExpandableItem* _tmp12_;
	CodeWidgetsSourceList* _tmp38_;
	CodeWidgetsSourceListExpandableItem* _tmp39_;
	CodeWidgetsSourceListExpandableItem* _tmp40_;
	CodeWidgetsSourceList* _tmp41_;
	CodeWidgetsSourceListExpandableItem* _tmp42_;
	CodeWidgetsSourceListExpandableItem* _tmp43_;
	CodeWidgetsSourceList* _tmp44_;
	GtkAdjustment* _tmp45_;
	GtkAdjustment* _tmp46_;
	gboolean result;
	_data62_ = _data63_->_data62_;
	self = _data62_->self;
	_tmp0_ = ((ScratchServicesSymbolOutline*) self)->store;
	_tmp1_ = gtk_scrolled_window_get_vadjustment ((GtkScrolledWindow*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gtk_adjustment_get_value (_tmp2_);
	_tmp4_ = _tmp3_;
	adjustment_value = _tmp4_;
	_tmp5_ = ((ScratchServicesSymbolOutline*) self)->store;
	_tmp6_ = code_widgets_source_list_get_root (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = code_widgets_source_list_expandable_item_get_children (_tmp7_);
	_tmp9_ = _tmp8_;
	root_children = _tmp9_;
	_tmp10_ = ((ScratchServicesSymbolOutline*) self)->store;
	_tmp11_ = code_widgets_source_list_get_root (_tmp10_);
	_tmp12_ = _tmp11_;
	code_widgets_source_list_expandable_item_clear (_tmp12_);
	{
		GeeIterator* _child_it = NULL;
		GeeCollection* _tmp13_;
		GeeIterator* _tmp14_;
		_tmp13_ = root_children;
		_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
		_child_it = _tmp14_;
		while (TRUE) {
			GeeIterator* _tmp15_;
			CodeWidgetsSourceListItem* child = NULL;
			GeeIterator* _tmp16_;
			gpointer _tmp17_;
			CodeWidgetsSourceListItem* _tmp18_;
			_tmp15_ = _child_it;
			if (!gee_iterator_next (_tmp15_)) {
				break;
			}
			_tmp16_ = _child_it;
			_tmp17_ = gee_iterator_get (_tmp16_);
			child = (CodeWidgetsSourceListItem*) _tmp17_;
			_tmp18_ = child;
			scratch_services_vala_symbol_outline_destroy_all_children (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem));
			_g_object_unref0 (child);
		}
		_g_object_unref0 (_child_it);
	}
	if (((ScratchServicesSymbolOutline*) self)->took_too_long) {
		CodeWidgetsSourceListItem* warning_item = NULL;
		GThemedIcon* _tmp19_;
		gchar* _tmp20_;
		ScratchServicesDocument* _tmp21_;
		ScratchServicesDocument* _tmp22_;
		GFile* _tmp23_;
		GFile* _tmp24_;
		gchar* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		CodeWidgetsSourceListItem* _tmp28_ = NULL;
		CodeWidgetsSourceListItem* _tmp29_;
		CodeWidgetsSourceList* _tmp30_;
		CodeWidgetsSourceListExpandableItem* _tmp31_;
		CodeWidgetsSourceListExpandableItem* _tmp32_;
		CodeWidgetsSourceListItem* _tmp33_;
		_tmp19_ = (GThemedIcon*) g_themed_icon_new ("dialog-warning");
		_tmp20_ = g_strdup_printf ("<big>%s</big>", _ ("Too Many Symbols"));
		_tmp21_ = scratch_services_symbol_outline_get_doc ((ScratchServicesSymbolOutline*) self);
		_tmp22_ = _tmp21_;
		_tmp23_ = scratch_services_document_get_file (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = g_file_get_basename (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = g_strdup_printf (_ ("%s contains too many Vala symbols.\n" \
"Parsing and showing them took too long."), _tmp26_);
		_tmp28_ = code_widgets_source_list_item_new ("");
		code_widgets_source_list_item_set_icon (_tmp28_, (GIcon*) _tmp19_);
		_g_object_unref0 (_tmp19_);
		code_widgets_source_list_item_set_markup (_tmp28_, _tmp20_);
		_g_free0 (_tmp20_);
		code_widgets_source_list_item_set_tooltip (_tmp28_, _tmp27_);
		_g_free0 (_tmp27_);
		code_widgets_source_list_item_set_selectable (_tmp28_, FALSE);
		_tmp29_ = _tmp28_;
		_g_free0 (_tmp26_);
		warning_item = _tmp29_;
		_tmp30_ = ((ScratchServicesSymbolOutline*) self)->store;
		_tmp31_ = code_widgets_source_list_get_root (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = warning_item;
		code_widgets_source_list_expandable_item_add (_tmp32_, _tmp33_);
		_g_object_unref0 (warning_item);
	} else {
		CodeWidgetsSourceList* _tmp34_;
		CodeWidgetsSourceListExpandableItem* _tmp35_;
		CodeWidgetsSourceListExpandableItem* _tmp36_;
		CodeWidgetsSourceListExpandableItem* _tmp37_;
		_tmp34_ = ((ScratchServicesSymbolOutline*) self)->store;
		_tmp35_ = code_widgets_source_list_get_root (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp37_ = _data63_->new_root;
		code_widgets_source_list_expandable_item_add (_tmp36_, (CodeWidgetsSourceListItem*) _tmp37_);
	}
	_tmp38_ = ((ScratchServicesSymbolOutline*) self)->store;
	_tmp39_ = code_widgets_source_list_get_root (_tmp38_);
	_tmp40_ = _tmp39_;
	code_widgets_source_list_expandable_item_expand_all (_tmp40_, TRUE, TRUE);
	_tmp41_ = ((ScratchServicesSymbolOutline*) self)->store;
	_tmp42_ = code_widgets_source_list_get_root (_tmp41_);
	_tmp43_ = _tmp42_;
	scratch_services_symbol_outline_add_tooltips ((ScratchServicesSymbolOutline*) self, _tmp43_);
	_tmp44_ = ((ScratchServicesSymbolOutline*) self)->store;
	_tmp45_ = gtk_scrolled_window_get_vadjustment ((GtkScrolledWindow*) _tmp44_);
	_tmp46_ = _tmp45_;
	gtk_adjustment_set_value (_tmp46_, adjustment_value);
	result = G_SOURCE_REMOVE;
	_g_object_unref0 (root_children);
	return result;
}

static gboolean
____lambda45__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda45_ (self);
	return result;
}

static void*
__lambda43_ (Block62Data* _data62_)
{
	ScratchServicesValaSymbolOutline* self;
	Block63Data* _data63_;
	ValaCodeContext* _tmp0_;
	ValaParser* _tmp1_;
	ValaCodeContext* _tmp2_;
	CodePluginsValaSymbolResolver* _tmp3_;
	CodePluginsValaSymbolResolver* _tmp4_;
	ValaCodeContext* _tmp5_;
	GCancellable* _tmp6_;
	CodeWidgetsSourceListExpandableItem* _tmp7_;
	gboolean _tmp8_ = FALSE;
	GCancellable* _tmp9_;
	void* result;
	self = _data62_->self;
	_data63_ = g_slice_new0 (Block63Data);
	_data63_->_ref_count_ = 1;
	_data63_->_data62_ = block62_data_ref (_data62_);
	_tmp0_ = _data62_->context;
	vala_code_context_push (_tmp0_);
	_tmp1_ = self->priv->parser;
	_tmp2_ = _data62_->context;
	vala_parser_parse (_tmp1_, _tmp2_);
	_tmp3_ = self->priv->resolver;
	code_plugins_vala_symbol_resolver_clear (_tmp3_);
	_tmp4_ = self->priv->resolver;
	_tmp5_ = _data62_->context;
	vala_symbol_resolver_resolve ((ValaSymbolResolver*) _tmp4_, _tmp5_);
	vala_code_context_pop ();
	self->priv->parse_timeout_id = g_timeout_add_full (G_PRIORITY_LOW, (guint) SCRATCH_SERVICES_VALA_SYMBOL_OUTLINE_PARSE_TIME_MAX_MSEC, ___lambda44__gsource_func, g_object_ref (self), g_object_unref);
	_tmp6_ = self->priv->cancellable;
	_tmp7_ = scratch_services_vala_symbol_outline_construct_tree (self, _tmp6_);
	_data63_->new_root = _tmp7_;
	if (self->priv->parse_timeout_id > ((guint) 0)) {
		g_source_remove (self->priv->parse_timeout_id);
	}
	_tmp9_ = self->priv->cancellable;
	if (!g_cancellable_is_cancelled (_tmp9_)) {
		_tmp8_ = TRUE;
	} else {
		_tmp8_ = ((ScratchServicesSymbolOutline*) self)->took_too_long;
	}
	if (_tmp8_) {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda45__gsource_func, block63_data_ref (_data63_), block63_data_unref);
	} else {
		CodeWidgetsSourceListExpandableItem* _tmp10_;
		_tmp10_ = _data63_->new_root;
		scratch_services_vala_symbol_outline_destroy_all_children (self, _tmp10_);
	}
	scratch_services_symbol_outline_after_parse ((ScratchServicesSymbolOutline*) self);
	result = NULL;
	block63_data_unref (_data63_);
	_data63_ = NULL;
	return result;
}

static gpointer
___lambda43__gthread_func (gpointer self)
{
	gpointer result;
	result = __lambda43_ (self);
	block62_data_unref (self);
	return result;
}

static void
scratch_services_vala_symbol_outline_real_parse_symbols (ScratchServicesSymbolOutline* base)
{
	ScratchServicesValaSymbolOutline * self;
	Block62Data* _data62_;
	ValaCodeContext* _tmp0_;
	ValaCodeContext* _tmp1_;
	ValaCodeContext* _tmp2_;
	ScratchServicesDocument* _tmp3_;
	ScratchServicesDocument* _tmp4_;
	GFile* _tmp5_;
	GFile* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	ValaCodeContext* _tmp9_;
	Report* _tmp10_;
	Report* _tmp11_;
	gboolean _tmp12_ = FALSE;
	GCancellable* _tmp13_;
	GCancellable* _tmp16_;
	GThread* _tmp17_;
	GThread* _tmp18_;
	self = (ScratchServicesValaSymbolOutline*) base;
	_data62_ = g_slice_new0 (Block62Data);
	_data62_->_ref_count_ = 1;
	_data62_->self = g_object_ref (self);
	scratch_services_symbol_outline_before_parse ((ScratchServicesSymbolOutline*) self);
	_tmp0_ = vala_code_context_new ();
	_data62_->context = _tmp0_;
	_tmp1_ = _data62_->context;
	vala_code_context_set_target_profile (_tmp1_, VALA_PROFILE_GOBJECT, FALSE);
	_tmp2_ = _data62_->context;
	_tmp3_ = scratch_services_symbol_outline_get_doc ((ScratchServicesSymbolOutline*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = scratch_services_document_get_file (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_file_get_path (_tmp6_);
	_tmp8_ = _tmp7_;
	vala_code_context_add_source_filename (_tmp2_, _tmp8_, FALSE, FALSE);
	_g_free0 (_tmp8_);
	_tmp9_ = _data62_->context;
	_tmp10_ = report_new ();
	_tmp11_ = _tmp10_;
	vala_code_context_set_report (_tmp9_, (ValaReport*) _tmp11_);
	_vala_report_unref0 (_tmp11_);
	_tmp13_ = self->priv->cancellable;
	if (_tmp13_ != NULL) {
		GCancellable* _tmp14_;
		_tmp14_ = self->priv->cancellable;
		_tmp12_ = !g_cancellable_is_cancelled (_tmp14_);
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		GCancellable* _tmp15_;
		_tmp15_ = self->priv->cancellable;
		g_cancellable_cancel (_tmp15_);
	}
	_tmp16_ = g_cancellable_new ();
	_g_object_unref0 (self->priv->cancellable);
	self->priv->cancellable = _tmp16_;
	_tmp17_ = g_thread_new ("parse-symbols", ___lambda43__gthread_func, block62_data_ref (_data62_));
	_tmp18_ = _tmp17_;
	_g_thread_unref0 (_tmp18_);
	block62_data_unref (_data62_);
	_data62_ = NULL;
}

static void
scratch_services_vala_symbol_outline_real_add_tooltips (ScratchServicesSymbolOutline* base,
                                                        CodeWidgetsSourceListExpandableItem* root)
{
	ScratchServicesValaSymbolOutline * self;
	self = (ScratchServicesValaSymbolOutline*) base;
	g_return_if_fail (root != NULL);
	{
		GeeIterator* _parent_it = NULL;
		GeeCollection* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = code_widgets_source_list_expandable_item_get_children (root);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_parent_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			CodeWidgetsSourceListItem* parent = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			CodeWidgetsSourceListItem* _tmp8_;
			_tmp5_ = _parent_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _parent_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			parent = (CodeWidgetsSourceListItem*) _tmp7_;
			_tmp8_ = parent;
			if (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (_tmp8_)) {
				CodeWidgetsSourceListItem* _tmp9_;
				_tmp9_ = parent;
				scratch_services_vala_symbol_outline_add_tooltip (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem));
			}
			_g_object_unref0 (parent);
		}
		_g_object_unref0 (_parent_it);
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static gpointer
_vala_code_node_ref0 (gpointer self)
{
	return self ? vala_code_node_ref (self) : NULL;
}

static void
scratch_services_vala_symbol_outline_add_tooltip (ScratchServicesValaSymbolOutline* self,
                                                  CodeWidgetsSourceListExpandableItem* parent)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (parent != NULL);
	if (SCRATCH_SERVICES_IS_VALA_SYMBOL_ITEM (parent)) {
		ScratchServicesValaSymbolItem* item = NULL;
		ScratchServicesValaSymbolItem* _tmp0_;
		ValaSymbol* symbol = NULL;
		ScratchServicesValaSymbolItem* _tmp1_;
		ValaSymbol* _tmp2_;
		ValaSymbol* _tmp3_;
		ValaSymbol* _tmp4_;
		gchar* _tmp5_ = NULL;
		ValaSymbol* _tmp6_;
		ValaComment* _tmp7_;
		ValaComment* _tmp8_;
		ScratchServicesValaSymbolItem* _tmp16_;
		ScratchServicesDocument* _tmp17_;
		ScratchServicesDocument* _tmp18_;
		ValaSymbol* _tmp19_;
		ValaSourceReference* _tmp20_;
		ValaSourceReference* _tmp21_;
		ValaSourceLocation _tmp22_ = {0};
		ValaSourceLocation _tmp23_;
		ValaSymbol* _tmp24_;
		ValaSourceReference* _tmp25_;
		ValaSourceReference* _tmp26_;
		ValaSourceLocation _tmp27_ = {0};
		ValaSourceLocation _tmp28_;
		ValaSymbol* _tmp29_;
		ValaSourceReference* _tmp30_;
		ValaSourceReference* _tmp31_;
		ValaSourceLocation _tmp32_ = {0};
		ValaSourceLocation _tmp33_;
		ValaSymbol* _tmp34_;
		ValaSourceReference* _tmp35_;
		ValaSourceReference* _tmp36_;
		ValaSourceLocation _tmp37_ = {0};
		ValaSourceLocation _tmp38_;
		gchar* _tmp39_;
		gchar* _tmp40_;
		gchar* _tmp41_;
		gchar* _tmp42_;
		_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (parent, SCRATCH_SERVICES_TYPE_VALA_SYMBOL_ITEM, ScratchServicesValaSymbolItem));
		item = _tmp0_;
		_tmp1_ = item;
		_tmp2_ = scratch_services_vala_symbol_item_get_symbol (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _vala_code_node_ref0 (_tmp3_);
		symbol = _tmp4_;
		_tmp6_ = symbol;
		_tmp7_ = vala_symbol_get_comment (_tmp6_);
		_tmp8_ = _tmp7_;
		if (_tmp8_ != NULL) {
			ValaSymbol* _tmp9_;
			ValaComment* _tmp10_;
			ValaComment* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp9_ = symbol;
			_tmp10_ = vala_symbol_get_comment (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = vala_comment_get_content (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = g_strconcat ("\n", _tmp13_, NULL);
			_g_free0 (_tmp5_);
			_tmp5_ = _tmp14_;
		} else {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			_g_free0 (_tmp5_);
			_tmp5_ = _tmp15_;
		}
		_tmp16_ = item;
		_tmp17_ = scratch_services_symbol_outline_get_doc ((ScratchServicesSymbolOutline*) self);
		_tmp18_ = _tmp17_;
		_tmp19_ = symbol;
		_tmp20_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp19_);
		_tmp21_ = _tmp20_;
		vala_source_reference_get_begin (_tmp21_, &_tmp22_);
		_tmp23_ = _tmp22_;
		_tmp24_ = symbol;
		_tmp25_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp24_);
		_tmp26_ = _tmp25_;
		vala_source_reference_get_begin (_tmp26_, &_tmp27_);
		_tmp28_ = _tmp27_;
		_tmp29_ = symbol;
		_tmp30_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp29_);
		_tmp31_ = _tmp30_;
		vala_source_reference_get_end (_tmp31_, &_tmp32_);
		_tmp33_ = _tmp32_;
		_tmp34_ = symbol;
		_tmp35_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp34_);
		_tmp36_ = _tmp35_;
		vala_source_reference_get_end (_tmp36_, &_tmp37_);
		_tmp38_ = _tmp37_;
		_tmp39_ = scratch_services_document_get_slice (_tmp18_, _tmp23_.line, _tmp28_.column, _tmp33_.line, _tmp38_.column);
		_tmp40_ = _tmp39_;
		_tmp41_ = g_strdup_printf ("%s%s", _tmp40_, _tmp5_);
		_tmp42_ = _tmp41_;
		code_widgets_source_list_item_set_tooltip ((CodeWidgetsSourceListItem*) _tmp16_, _tmp42_);
		_g_free0 (_tmp42_);
		_g_free0 (_tmp40_);
		_g_free0 (_tmp5_);
		_vala_code_node_unref0 (symbol);
		_g_object_unref0 (item);
	}
	scratch_services_symbol_outline_add_tooltips ((ScratchServicesSymbolOutline*) self, parent);
}

static void
scratch_services_vala_symbol_outline_destroy_all_children (ScratchServicesValaSymbolOutline* self,
                                                           CodeWidgetsSourceListExpandableItem* parent)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (parent != NULL);
	{
		GeeIterator* _child_it = NULL;
		GeeCollection* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = code_widgets_source_list_expandable_item_get_children (parent);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_child_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			CodeWidgetsSourceListItem* child = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			CodeWidgetsSourceListItem* _tmp8_;
			_tmp5_ = _child_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _child_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			child = (CodeWidgetsSourceListItem*) _tmp7_;
			_tmp8_ = child;
			scratch_services_vala_symbol_outline_remove (self, _tmp8_, parent);
			_g_object_unref0 (child);
		}
		_g_object_unref0 (_child_it);
	}
}

static void
scratch_services_vala_symbol_outline_remove (ScratchServicesValaSymbolOutline* self,
                                             CodeWidgetsSourceListItem* item,
                                             CodeWidgetsSourceListExpandableItem* parent)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	g_return_if_fail (parent != NULL);
	if (CODE_WIDGETS_SOURCE_LIST_IS_EXPANDABLE_ITEM (item)) {
		scratch_services_vala_symbol_outline_destroy_all_children (self, G_TYPE_CHECK_INSTANCE_CAST (item, CODE_WIDGETS_SOURCE_LIST_TYPE_EXPANDABLE_ITEM, CodeWidgetsSourceListExpandableItem));
	}
	code_widgets_source_list_expandable_item_remove (parent, item);
}

static CodeWidgetsSourceListExpandableItem*
scratch_services_vala_symbol_outline_construct_tree (ScratchServicesValaSymbolOutline* self,
                                                     GCancellable* cancellable)
{
	GeeTreeSet* fields = NULL;
	CodePluginsValaSymbolResolver* _tmp0_;
	GeeTreeSet* _tmp1_;
	GeeTreeSet* symbols = NULL;
	CodePluginsValaSymbolResolver* _tmp2_;
	GeeTreeSet* _tmp3_;
	GeeTreeSet* _tmp4_;
	GeeTreeSet* _tmp5_;
	CodeWidgetsSourceListExpandableItem* new_root = NULL;
	CodeWidgetsSourceListExpandableItem* _tmp6_;
	CodeWidgetsSourceListExpandableItem* _tmp7_;
	ScratchServicesDocument* _tmp8_;
	ScratchServicesDocument* _tmp9_;
	GFile* _tmp10_;
	GFile* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	CodeWidgetsSourceListExpandableItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (cancellable != NULL, NULL);
	_tmp0_ = self->priv->resolver;
	_tmp1_ = code_plugins_vala_symbol_resolver_get_properties_fields (_tmp0_);
	fields = _tmp1_;
	_tmp2_ = self->priv->resolver;
	_tmp3_ = code_plugins_vala_symbol_resolver_get_symbols (_tmp2_);
	symbols = _tmp3_;
	_tmp4_ = symbols;
	_tmp5_ = fields;
	gee_collection_remove_all ((GeeCollection*) _tmp4_, (GeeCollection*) _tmp5_);
	_tmp6_ = code_widgets_source_list_expandable_item_new (_ ("Symbols"));
	new_root = _tmp6_;
	_tmp7_ = new_root;
	_tmp8_ = scratch_services_symbol_outline_get_doc ((ScratchServicesSymbolOutline*) self);
	_tmp9_ = _tmp8_;
	_tmp10_ = scratch_services_document_get_file (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_file_get_basename (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = g_strdup_printf (_ ("Vala symbols found in %s"), _tmp13_);
	_tmp15_ = _tmp14_;
	code_widgets_source_list_item_set_tooltip ((CodeWidgetsSourceListItem*) _tmp7_, _tmp15_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	{
		GeeIterator* _symbol_it = NULL;
		GeeTreeSet* _tmp16_;
		GeeIterator* _tmp17_;
		_tmp16_ = symbols;
		_tmp17_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp16_);
		_symbol_it = _tmp17_;
		while (TRUE) {
			GeeIterator* _tmp18_;
			ValaSymbol* symbol = NULL;
			GeeIterator* _tmp19_;
			gpointer _tmp20_;
			ValaSymbol* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			ValaSymbol* _tmp24_;
			CodeWidgetsSourceListExpandableItem* _tmp25_;
			ScratchServicesValaSymbolItem* _tmp26_;
			ScratchServicesValaSymbolItem* _tmp27_;
			_tmp18_ = _symbol_it;
			if (!gee_iterator_next (_tmp18_)) {
				break;
			}
			_tmp19_ = _symbol_it;
			_tmp20_ = gee_iterator_get (_tmp19_);
			symbol = (ValaSymbol*) _tmp20_;
			if (g_cancellable_is_cancelled (cancellable)) {
				break;
			}
			_tmp21_ = symbol;
			_tmp22_ = vala_symbol_get_name (_tmp21_);
			_tmp23_ = _tmp22_;
			if (_tmp23_ == NULL) {
				continue;
			}
			_tmp24_ = symbol;
			_tmp25_ = new_root;
			_tmp26_ = scratch_services_vala_symbol_outline_construct_child (self, _tmp24_, _tmp25_, cancellable);
			_tmp27_ = _tmp26_;
			_g_object_unref0 (_tmp27_);
			if (!g_cancellable_is_cancelled (cancellable)) {
				g_thread_yield ();
			}
		}
		_g_object_unref0 (_symbol_it);
	}
	result = new_root;
	_g_object_unref0 (symbols);
	_g_object_unref0 (fields);
	return result;
}

static ScratchServicesValaSymbolItem*
scratch_services_vala_symbol_outline_construct_child (ScratchServicesValaSymbolOutline* self,
                                                      ValaSymbol* symbol,
                                                      CodeWidgetsSourceListExpandableItem* given_parent,
                                                      GCancellable* cancellable)
{
	CodeWidgetsSourceListExpandableItem* parent = NULL;
	ValaScope* _tmp0_;
	ValaScope* _tmp1_;
	ValaScope* _tmp2_;
	ValaScope* _tmp3_;
	ValaSymbol* _tmp4_;
	ValaSymbol* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	CodeWidgetsSourceListExpandableItem* _tmp16_;
	ScratchServicesValaSymbolItem* tree_child = NULL;
	ScratchServicesValaSymbolItem* _tmp24_;
	CodeWidgetsSourceListExpandableItem* _tmp25_;
	ScratchServicesValaSymbolItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (symbol != NULL, NULL);
	g_return_val_if_fail (given_parent != NULL, NULL);
	g_return_val_if_fail (cancellable != NULL, NULL);
	_tmp0_ = vala_symbol_get_scope (symbol);
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_scope_get_parent_scope (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = vala_scope_get_owner (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = vala_symbol_get_name (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_ == NULL) {
		CodeWidgetsSourceListExpandableItem* _tmp8_;
		_tmp8_ = _g_object_ref0 (given_parent);
		_g_object_unref0 (parent);
		parent = _tmp8_;
	} else {
		ValaScope* _tmp9_;
		ValaScope* _tmp10_;
		ValaScope* _tmp11_;
		ValaScope* _tmp12_;
		ValaSymbol* _tmp13_;
		ValaSymbol* _tmp14_;
		ScratchServicesValaSymbolItem* _tmp15_;
		_tmp9_ = vala_symbol_get_scope (symbol);
		_tmp10_ = _tmp9_;
		_tmp11_ = vala_scope_get_parent_scope (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = vala_scope_get_owner (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = scratch_services_vala_symbol_outline_find_existing (self, _tmp14_, given_parent, cancellable);
		_g_object_unref0 (parent);
		parent = (CodeWidgetsSourceListExpandableItem*) _tmp15_;
	}
	_tmp16_ = parent;
	if (_tmp16_ == NULL) {
		ValaScope* _tmp17_;
		ValaScope* _tmp18_;
		ValaScope* _tmp19_;
		ValaScope* _tmp20_;
		ValaSymbol* _tmp21_;
		ValaSymbol* _tmp22_;
		ScratchServicesValaSymbolItem* _tmp23_;
		_tmp17_ = vala_symbol_get_scope (symbol);
		_tmp18_ = _tmp17_;
		_tmp19_ = vala_scope_get_parent_scope (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = vala_scope_get_owner (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = scratch_services_vala_symbol_outline_construct_child (self, _tmp22_, given_parent, cancellable);
		_g_object_unref0 (parent);
		parent = (CodeWidgetsSourceListExpandableItem*) _tmp23_;
	}
	_tmp24_ = scratch_services_vala_symbol_item_new (symbol, "");
	tree_child = _tmp24_;
	_tmp25_ = parent;
	code_widgets_source_list_expandable_item_add (_tmp25_, (CodeWidgetsSourceListItem*) tree_child);
	result = tree_child;
	_g_object_unref0 (parent);
	return result;
}

static ScratchServicesValaSymbolItem*
scratch_services_vala_symbol_outline_find_existing (ScratchServicesValaSymbolOutline* self,
                                                    ValaSymbol* symbol,
                                                    CodeWidgetsSourceListExpandableItem* parent,
                                                    GCancellable* cancellable)
{
	ScratchServicesValaSymbolItem* match = NULL;
	ScratchServicesValaSymbolItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (symbol != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (cancellable != NULL, NULL);
	match = NULL;
	{
		GeeIterator* __child_it = NULL;
		GeeCollection* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = code_widgets_source_list_expandable_item_get_children (parent);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		__child_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			CodeWidgetsSourceListItem* _child = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			ScratchServicesValaSymbolItem* child = NULL;
			CodeWidgetsSourceListItem* _tmp8_;
			ScratchServicesValaSymbolItem* _tmp9_;
			ScratchServicesValaSymbolItem* _tmp10_;
			ScratchServicesValaSymbolItem* _tmp11_;
			ValaSymbol* _tmp12_;
			ValaSymbol* _tmp13_;
			_tmp5_ = __child_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = __child_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			_child = (CodeWidgetsSourceListItem*) _tmp7_;
			if (g_cancellable_is_cancelled (cancellable)) {
				_g_object_unref0 (_child);
				break;
			}
			_tmp8_ = _child;
			_tmp9_ = _g_object_ref0 (SCRATCH_SERVICES_IS_VALA_SYMBOL_ITEM (_tmp8_) ? ((ScratchServicesValaSymbolItem*) _tmp8_) : NULL);
			child = _tmp9_;
			_tmp10_ = child;
			if (_tmp10_ == NULL) {
				_g_object_unref0 (child);
				_g_object_unref0 (_child);
				continue;
			}
			_tmp11_ = child;
			_tmp12_ = scratch_services_vala_symbol_item_get_symbol (_tmp11_);
			_tmp13_ = _tmp12_;
			if (_tmp13_ == symbol) {
				ScratchServicesValaSymbolItem* _tmp14_;
				ScratchServicesValaSymbolItem* _tmp15_;
				_tmp14_ = child;
				_tmp15_ = _g_object_ref0 (_tmp14_);
				_g_object_unref0 (match);
				match = _tmp15_;
				_g_object_unref0 (child);
				_g_object_unref0 (_child);
				break;
			} else {
				ScratchServicesValaSymbolItem* res = NULL;
				ScratchServicesValaSymbolItem* _tmp16_;
				ScratchServicesValaSymbolItem* _tmp17_;
				ScratchServicesValaSymbolItem* _tmp18_;
				_tmp16_ = child;
				_tmp17_ = scratch_services_vala_symbol_outline_find_existing (self, symbol, (CodeWidgetsSourceListExpandableItem*) _tmp16_, cancellable);
				res = _tmp17_;
				_tmp18_ = res;
				if (_tmp18_ != NULL) {
					result = res;
					_g_object_unref0 (child);
					_g_object_unref0 (_child);
					_g_object_unref0 (__child_it);
					_g_object_unref0 (match);
					return result;
				}
				_g_object_unref0 (res);
			}
			_g_object_unref0 (child);
			_g_object_unref0 (_child);
		}
		_g_object_unref0 (__child_it);
	}
	result = match;
	return result;
}

static void
_scratch_services_vala_symbol_outline___lambda46_ (ScratchServicesValaSymbolOutline* self,
                                                   CodeWidgetsSourceListItem* selected)
{
	ScratchServicesDocument* _tmp0_;
	ScratchServicesDocument* _tmp1_;
	ValaSymbol* _tmp2_;
	ValaSymbol* _tmp3_;
	ValaSourceReference* _tmp4_;
	ValaSourceReference* _tmp5_;
	ValaSourceLocation _tmp6_ = {0};
	ValaSourceLocation _tmp7_;
	CodeWidgetsSourceList* _tmp8_;
	if (selected == NULL) {
		return;
	}
	_tmp0_ = scratch_services_symbol_outline_get_doc ((ScratchServicesSymbolOutline*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = scratch_services_vala_symbol_item_get_symbol (G_TYPE_CHECK_INSTANCE_CAST (selected, SCRATCH_SERVICES_TYPE_VALA_SYMBOL_ITEM, ScratchServicesValaSymbolItem));
	_tmp3_ = _tmp2_;
	_tmp4_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp3_);
	_tmp5_ = _tmp4_;
	vala_source_reference_get_begin (_tmp5_, &_tmp6_);
	_tmp7_ = _tmp6_;
	scratch_services_document_goto (_tmp1_, _tmp7_.line);
	_tmp8_ = ((ScratchServicesSymbolOutline*) self)->store;
	code_widgets_source_list_set_selected (_tmp8_, NULL);
}

static void
__scratch_services_vala_symbol_outline___lambda46__code_widgets_source_list_item_selected (CodeWidgetsSourceList* _sender,
                                                                                           CodeWidgetsSourceListItem* item,
                                                                                           gpointer self)
{
	_scratch_services_vala_symbol_outline___lambda46_ ((ScratchServicesValaSymbolOutline*) self, item);
}

static GObject *
scratch_services_vala_symbol_outline_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ScratchServicesValaSymbolOutline * self;
	ValaParser* _tmp0_;
	CodePluginsValaSymbolResolver* _tmp1_;
	CodeWidgetsSourceList* _tmp2_;
	ScratchServicesDocument* _tmp3_;
	ScratchServicesDocument* _tmp4_;
	parent_class = G_OBJECT_CLASS (scratch_services_vala_symbol_outline_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCRATCH_SERVICES_TYPE_VALA_SYMBOL_OUTLINE, ScratchServicesValaSymbolOutline);
	_tmp0_ = vala_parser_new ();
	_vala_code_visitor_unref0 (self->priv->parser);
	self->priv->parser = _tmp0_;
	_tmp1_ = code_plugins_vala_symbol_resolver_new ();
	_vala_code_visitor_unref0 (self->priv->resolver);
	self->priv->resolver = _tmp1_;
	_tmp2_ = ((ScratchServicesSymbolOutline*) self)->store;
	g_signal_connect_object (_tmp2_, "item-selected", (GCallback) __scratch_services_vala_symbol_outline___lambda46__code_widgets_source_list_item_selected, self, 0);
	_tmp3_ = scratch_services_symbol_outline_get_doc ((ScratchServicesSymbolOutline*) self);
	_tmp4_ = _tmp3_;
	g_signal_connect_object (_tmp4_, "doc-closed", (GCallback) _scratch_services_vala_symbol_outline_doc_closed_scratch_services_document_doc_closed, self, 0);
	return obj;
}

static void
scratch_services_vala_symbol_outline_class_init (ScratchServicesValaSymbolOutlineClass * klass,
                                                 gpointer klass_data)
{
	ScratchServicesSymbolType* _tmp0_;
	scratch_services_vala_symbol_outline_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ScratchServicesValaSymbolOutline_private_offset);
	((ScratchServicesSymbolOutlineClass *) klass)->parse_symbols = (void (*) (ScratchServicesSymbolOutline*)) scratch_services_vala_symbol_outline_real_parse_symbols;
	((ScratchServicesSymbolOutlineClass *) klass)->add_tooltips = (void (*) (ScratchServicesSymbolOutline*, CodeWidgetsSourceListExpandableItem*)) scratch_services_vala_symbol_outline_real_add_tooltips;
	G_OBJECT_CLASS (klass)->constructor = scratch_services_vala_symbol_outline_constructor;
	G_OBJECT_CLASS (klass)->finalize = scratch_services_vala_symbol_outline_finalize;
	_tmp0_ = g_new0 (ScratchServicesSymbolType, 8);
	_tmp0_[0] = SCRATCH_SERVICES_SYMBOL_TYPE_CLASS;
	_tmp0_[1] = SCRATCH_SERVICES_SYMBOL_TYPE_CONSTRUCTOR;
	_tmp0_[2] = SCRATCH_SERVICES_SYMBOL_TYPE_PROPERTY;
	_tmp0_[3] = SCRATCH_SERVICES_SYMBOL_TYPE_METHOD;
	_tmp0_[4] = SCRATCH_SERVICES_SYMBOL_TYPE_STRUCT;
	_tmp0_[5] = SCRATCH_SERVICES_SYMBOL_TYPE_ENUM;
	_tmp0_[6] = SCRATCH_SERVICES_SYMBOL_TYPE_CONSTANT;
	_tmp0_[7] = SCRATCH_SERVICES_SYMBOL_TYPE_INTERFACE;
	scratch_services_symbol_outline_filters = (g_free (scratch_services_symbol_outline_filters), NULL);
	scratch_services_symbol_outline_filters = _tmp0_;
	scratch_services_symbol_outline_filters_length1 = 8;
}

static void
scratch_services_vala_symbol_outline_instance_init (ScratchServicesValaSymbolOutline * self,
                                                    gpointer klass)
{
	self->priv = scratch_services_vala_symbol_outline_get_instance_private (self);
	self->priv->parse_timeout_id = (guint) 0;
}

static void
scratch_services_vala_symbol_outline_finalize (GObject * obj)
{
	ScratchServicesValaSymbolOutline * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SCRATCH_SERVICES_TYPE_VALA_SYMBOL_OUTLINE, ScratchServicesValaSymbolOutline);
	g_debug ("ValaSymbolOutline.vala:64: Destroy symbol out line");
	_vala_code_visitor_unref0 (self->priv->resolver);
	_vala_code_visitor_unref0 (self->priv->parser);
	_g_object_unref0 (self->priv->cancellable);
	G_OBJECT_CLASS (scratch_services_vala_symbol_outline_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
scratch_services_vala_symbol_outline_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ScratchServicesValaSymbolOutlineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) scratch_services_vala_symbol_outline_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ScratchServicesValaSymbolOutline), 0, (GInstanceInitFunc) scratch_services_vala_symbol_outline_instance_init, NULL };
	GType scratch_services_vala_symbol_outline_type_id;
	scratch_services_vala_symbol_outline_type_id = g_type_register_static (SCRATCH_SERVICES_TYPE_SYMBOL_OUTLINE, "ScratchServicesValaSymbolOutline", &g_define_type_info, G_TYPE_FLAG_NONE);
	ScratchServicesValaSymbolOutline_private_offset = g_type_add_instance_private (scratch_services_vala_symbol_outline_type_id, sizeof (ScratchServicesValaSymbolOutlinePrivate));
	return scratch_services_vala_symbol_outline_type_id;
}

GType
scratch_services_vala_symbol_outline_get_type (void)
{
	static gsize scratch_services_vala_symbol_outline_type_id__once = 0;
	if (g_once_init_enter (&scratch_services_vala_symbol_outline_type_id__once)) {
		GType scratch_services_vala_symbol_outline_type_id;
		scratch_services_vala_symbol_outline_type_id = scratch_services_vala_symbol_outline_get_type_once ();
		g_once_init_leave (&scratch_services_vala_symbol_outline_type_id__once, scratch_services_vala_symbol_outline_type_id);
	}
	return scratch_services_vala_symbol_outline_type_id__once;
}

static void
report_real_err (ValaReport* base,
                 ValaSourceReference* ref,
                 const gchar* msg)
{
	Report * self;
	self = (Report*) base;
	g_return_if_fail (msg != NULL);
}

static void
report_real_warn (ValaReport* base,
                  ValaSourceReference* ref,
                  const gchar* msg)
{
	Report * self;
	self = (Report*) base;
	g_return_if_fail (msg != NULL);
}

static void
report_real_note (ValaReport* base,
                  ValaSourceReference* ref,
                  const gchar* msg)
{
	Report * self;
	self = (Report*) base;
	g_return_if_fail (msg != NULL);
}

static void
report_real_depr (ValaReport* base,
                  ValaSourceReference* ref,
                  const gchar* msg)
{
	Report * self;
	self = (Report*) base;
	g_return_if_fail (msg != NULL);
}

Report*
report_construct (GType object_type)
{
	Report* self = NULL;
	self = (Report*) vala_report_construct (object_type);
	return self;
}

Report*
report_new (void)
{
	return report_construct (TYPE_REPORT);
}

static void
report_class_init (ReportClass * klass,
                   gpointer klass_data)
{
	report_parent_class = g_type_class_peek_parent (klass);
	((ValaReportClass *) klass)->err = (void (*) (ValaReport*, ValaSourceReference*, const gchar*)) report_real_err;
	((ValaReportClass *) klass)->warn = (void (*) (ValaReport*, ValaSourceReference*, const gchar*)) report_real_warn;
	((ValaReportClass *) klass)->note = (void (*) (ValaReport*, ValaSourceReference*, const gchar*)) report_real_note;
	((ValaReportClass *) klass)->depr = (void (*) (ValaReport*, ValaSourceReference*, const gchar*)) report_real_depr;
}

static void
report_instance_init (Report * self,
                      gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
report_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ReportClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) report_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Report), 0, (GInstanceInitFunc) report_instance_init, NULL };
	GType report_type_id;
	report_type_id = g_type_register_static (VALA_TYPE_REPORT, "Report", &g_define_type_info, G_TYPE_FLAG_NONE);
	return report_type_id;
}

GType
report_get_type (void)
{
	static gsize report_type_id__once = 0;
	if (g_once_init_enter (&report_type_id__once)) {
		GType report_type_id;
		report_type_id = report_get_type_once ();
		g_once_init_leave (&report_type_id__once, report_type_id);
	}
	return report_type_id__once;
}

