Skip to content

Commit

Permalink
Revert debugging stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
benwaffle committed Oct 12, 2019
1 parent 554c80f commit 6dcf8ed
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 45 deletions.
4 changes: 0 additions & 4 deletions context.vala
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,6 @@ class Vls.Context {
return _sources[uri];
}

// public TextDocument? get_source_file_by_path (string path) {
// Collection<TextDocument> files = get_source_files ();
// }

public Collection<TextDocument> get_source_files () {
return _sources.values;
}
Expand Down
2 changes: 1 addition & 1 deletion lint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

io.elementary.vala-lint -c .vala-lint.conf .
io.elementary.vala-lint -c .vala-lint.conf -d .
40 changes: 0 additions & 40 deletions main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -54,32 +54,6 @@ class Vls.TextDocument : Object {
}
}

class DummyDataType : Vala.DataType {
public override Vala.DataType copy () {
return new DummyDataType ();
}

public override string to_string () {
return "(null)";
}
}

void print_expr (Vala.Expression e) {
var dummy = new DummyDataType ();
debug ("======= Expression ========");
debug (@"> $(e.to_string ()) <");
debug (@"formal_target_type = $(e.formal_target_type ?? dummy)");
debug (@"formal_value_type = $(e.formal_value_type ?? dummy)");
debug (@"lvalue = $(e.lvalue)");
debug (@"parent_statement = $(e.parent_statement)");
debug (@"symbol_reference = $(e.symbol_reference)");
debug (@"target_type = $(e.target_type)");
debug (@"target_value.value_type = $(e.target_value != null ? e.target_value.value_type.to_string () : "(null)")");
debug (@"target_value.actual_value_type = $(e.target_value != null ? e.target_value.actual_value_type.to_string () : "(null)")");
debug (@"value_type = $(e.value_type)");
debug ("===========================");
}

class Vls.Server {
Jsonrpc.Server server;
MainLoop loop;
Expand Down Expand Up @@ -777,11 +751,6 @@ class Vls.Server {
var p = parse_variant <LanguageServer.TextDocumentPositionParams> (@params);
debug ("get definition in %s at %u,%u", p.textDocument.uri,
p.position.line, p.position.character);

foreach (var sf in ctx.code_context.get_source_files ().to_array ()) {
debug ("=> SF %s", sf.filename);
}

var sourcefile = ctx.get_source_file (p.textDocument.uri);
if (sourcefile == null) {
debug ("unknown file %s", p.textDocument.uri);
Expand Down Expand Up @@ -841,17 +810,8 @@ class Vls.Server {
}

if (best is Vala.Expression && !(best is Vala.Literal)) { // expressions
// if (best is Vala.MemberAccess) {
// var ma = (Vala.MemberAccess)best;
// debug ("============ PARENT ===========");
// if (ma.parent_node is Vala.Expression)
// print_expr (ma.parent_node as Vala.Expression);
// else
// debug ("parent is a %s", ma.parent_node.type_name);
// }
var b = (Vala.Expression)best;
debug ("best (%s / %s @ %s) is a Expression", best.to_string (), best.type_name, best.source_reference.to_string ());
print_expr (b);
if (b.symbol_reference != null && b.symbol_reference.source_reference != null) {
best = b.symbol_reference;
debug ("best is now the symbol_reference => %p (%s / %s @ %s)", best, best.type_name, best.to_string (), best.source_reference.to_string ());
Expand Down

0 comments on commit 6dcf8ed

Please sign in to comment.