Get rid of extra logging

This commit is contained in:
Hackerpilot 2014-08-03 23:08:19 +00:00
parent cdc57193d1
commit 6547a562bd
1 changed files with 20 additions and 20 deletions

View File

@ -50,7 +50,7 @@ import stupidlog;
*/ */
AutocompleteResponse getDoc(const AutocompleteRequest request) AutocompleteResponse getDoc(const AutocompleteRequest request)
{ {
Log.trace("Getting doc comments"); // Log.trace("Getting doc comments");
AutocompleteResponse response; AutocompleteResponse response;
auto allocator = scoped!(CAllocatorImpl!(BlockAllocator!(1024 * 16)))(); auto allocator = scoped!(CAllocatorImpl!(BlockAllocator!(1024 * 16)))();
auto cache = StringCache(StringCache.defaultBucketCount); auto cache = StringCache(StringCache.defaultBucketCount);
@ -62,10 +62,10 @@ AutocompleteResponse getDoc(const AutocompleteRequest request)
{ {
if (symbol.doc is null) if (symbol.doc is null)
{ {
Log.trace("Doc comment for ", symbol.name, " was null"); // Log.trace("Doc comment for ", symbol.name, " was null");
continue; continue;
} }
Log.trace("Adding doc comment for ", symbol.name, ": ", symbol.doc); // Log.trace("Adding doc comment for ", symbol.name, ": ", symbol.doc);
response.docComments ~= formatComment(symbol.doc); response.docComments ~= formatComment(symbol.doc);
} }
return response; return response;
@ -80,7 +80,7 @@ AutocompleteResponse getDoc(const AutocompleteRequest request)
*/ */
AutocompleteResponse findDeclaration(const AutocompleteRequest request) AutocompleteResponse findDeclaration(const AutocompleteRequest request)
{ {
Log.trace("Finding declaration"); // Log.trace("Finding declaration");
AutocompleteResponse response; AutocompleteResponse response;
auto allocator = scoped!(CAllocatorImpl!(BlockAllocator!(1024 * 16)))(); auto allocator = scoped!(CAllocatorImpl!(BlockAllocator!(1024 * 16)))();
auto cache = StringCache(StringCache.defaultBucketCount); auto cache = StringCache(StringCache.defaultBucketCount);
@ -90,8 +90,8 @@ AutocompleteResponse findDeclaration(const AutocompleteRequest request)
{ {
response.symbolLocation = symbols[0].location; response.symbolLocation = symbols[0].location;
response.symbolFilePath = symbols[0].symbolFile.idup; response.symbolFilePath = symbols[0].symbolFile.idup;
Log.info(symbols[0].name, " declared in ", // Log.trace(symbols[0].name, " declared in ",
response.symbolFilePath, " at ", response.symbolLocation); // response.symbolFilePath, " at ", response.symbolLocation);
} }
else else
Log.error("Could not find symbol"); Log.error("Could not find symbol");
@ -107,7 +107,7 @@ AutocompleteResponse findDeclaration(const AutocompleteRequest request)
*/ */
AutocompleteResponse complete(const AutocompleteRequest request) AutocompleteResponse complete(const AutocompleteRequest request)
{ {
Log.info("Got a completion request"); // Log.info("Got a completion request");
const(Token)[] tokenArray; const(Token)[] tokenArray;
auto cache = StringCache(StringCache.defaultBucketCount); auto cache = StringCache(StringCache.defaultBucketCount);
@ -295,14 +295,14 @@ ACSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
T tokens, size_t cursorPosition, CompletionType completionType) T tokens, size_t cursorPosition, CompletionType completionType)
{ {
import std.d.lexer; import std.d.lexer;
Log.trace("Getting symbols from token chain", // Log.trace("Getting symbols from token chain",
tokens.map!stringToken); // tokens.map!stringToken);
// Find the symbol corresponding to the beginning of the chain // Find the symbol corresponding to the beginning of the chain
ACSymbol*[] symbols; ACSymbol*[] symbols;
if (tokens[0] == tok!"." && tokens.length > 1) if (tokens[0] == tok!"." && tokens.length > 1)
{ {
tokens = tokens[1 .. $]; tokens = tokens[1 .. $];
Log.info("Looking for ", stringToken(tokens[0]), " at global scope"); // Log.trace("Looking for ", stringToken(tokens[0]), " at global scope");
symbols = completionScope.getSymbolsAtGlobalScope(stringToken(tokens[0])); symbols = completionScope.getSymbolsAtGlobalScope(stringToken(tokens[0]));
} }
else else
@ -314,11 +314,11 @@ ACSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
" from position ", cursorPosition); " from position ", cursorPosition);
return []; return [];
} }
else // else
{ // {
Log.trace("Found ", symbols[0].name, " at ", symbols[0].location, // Log.trace("Found ", symbols[0].name, " at ", symbols[0].location,
" with type ", symbols[0].type is null ? "null" : symbols[0].type.name); // " with type ", symbols[0].type is null ? "null" : symbols[0].type.name);
} // }
if (shouldSwapWithType(completionType, symbols[0].kind, 0, tokens.length - 1)) if (shouldSwapWithType(completionType, symbols[0].kind, 0, tokens.length - 1))
{ {
@ -385,11 +385,11 @@ ACSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
break loop; break loop;
} }
Log.trace("looking for ", tokens[i].text, " in ", symbols[0].name); // Log.trace("looking for ", tokens[i].text, " in ", symbols[0].name);
symbols = symbols[0].getPartsByName(tokens[i].text); symbols = symbols[0].getPartsByName(tokens[i].text);
if (symbols.length == 0) if (symbols.length == 0)
{ {
Log.trace("Couldn't find it."); // Log.trace("Couldn't find it.");
break loop; break loop;
} }
if (shouldSwapWithType(completionType, symbols[0].kind, i, if (shouldSwapWithType(completionType, symbols[0].kind, i,
@ -504,7 +504,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
if (symbols[0].qualifier == SymbolQualifier.func if (symbols[0].qualifier == SymbolQualifier.func
|| symbols[0].kind == CompletionKind.functionName) || symbols[0].kind == CompletionKind.functionName)
{ {
Log.trace("Completion list for return type of function ", symbols[0].name); // Log.trace("Completion list for return type of function ", symbols[0].name);
symbols = symbols[0].type is null ? [] : [symbols[0].type]; symbols = symbols[0].type is null ? [] : [symbols[0].type];
if (symbols.length == 0) if (symbols.length == 0)
return; return;
@ -525,7 +525,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
} }
else if (completionType == CompletionType.calltips) else if (completionType == CompletionType.calltips)
{ {
Log.trace("Showing call tips for ", symbols[0].name, " of type ", symbols[0].kind); // Log.trace("Showing call tips for ", symbols[0].name, " of type ", symbols[0].kind);
if (symbols[0].kind != CompletionKind.functionName if (symbols[0].kind != CompletionKind.functionName
&& symbols[0].callTip is null) && symbols[0].callTip is null)
{ {
@ -718,7 +718,7 @@ void setImportCompletions(T)(T tokens, ref AutocompleteResponse response)
foreach (importDirectory; ModuleCache.getImportPaths()) foreach (importDirectory; ModuleCache.getImportPaths())
{ {
string p = buildPath(importDirectory, path); string p = buildPath(importDirectory, path);
Log.trace("Checking for ", p); // Log.trace("Checking for ", p);
if (!exists(p)) if (!exists(p))
continue; continue;