Fixed a bug, updated the README

This commit is contained in:
Hackerpilot 2013-08-11 20:07:58 +00:00
parent 954907325f
commit 20e575bdc2
2 changed files with 4 additions and 2 deletions

View File

@ -15,7 +15,7 @@ back to the client.
* Autocompletion of __traits, scope, and extern arguments * Autocompletion of __traits, scope, and extern arguments
* Autocompletion of enums * Autocompletion of enums
* Autocompletion of class, struct, and interface instances. * Autocompletion of class, struct, and interface instances.
* Display of call tips (but only for the first overload) * Display of call tips for functions and constructors
* Not working: * Not working:
* Automatic starting of the server by the client * Automatic starting of the server by the client
* Windows support (I don't know that it won't work, but this program is not tested on Windows yet) * Windows support (I don't know that it won't work, but this program is not tested on Windows yet)

View File

@ -31,6 +31,7 @@ import std.conv;
import actypes; import actypes;
import messages; import messages;
import modulecache; import modulecache;
import autocomplete;
class AutocompleteVisitor : ASTVisitor class AutocompleteVisitor : ASTVisitor
{ {
@ -112,7 +113,7 @@ class AutocompleteVisitor : ASTVisitor
s.name = member.name.value; s.name = member.name.value;
s.location = member.name.startIndex; s.location = member.name.startIndex;
if (type is null) if (type is null)
s.resolvedType = scope_.findSymbolInScope("int"); s.resolvedType = scope_.findSymbolsInScope("int")[0];
else else
s.type = type; s.type = type;
if (parentSymbol !is null) if (parentSymbol !is null)
@ -299,6 +300,7 @@ class AutocompleteVisitor : ASTVisitor
override void visit(Module mod) override void visit(Module mod)
{ {
scope_ = new Scope(0, size_t.max); scope_ = new Scope(0, size_t.max);
scope_.symbols ~= builtinSymbols;
mod.accept(this); mod.accept(this);
} }