Renames and comments as requested by feedback.

This commit is contained in:
steveluc
2015-03-09 01:23:03 -07:00
parent 360e47880e
commit 04320e415e
4 changed files with 13 additions and 7 deletions

View File

@@ -528,7 +528,7 @@ module Harness.LanguageService {
return this.host.log(message);
}
enabled() {
loggingEnabled() {
return true;
}

View File

@@ -6,7 +6,7 @@ module ts.server {
export interface Logger {
close(): void;
isVerbose(): boolean;
enabled(): boolean;
loggingEnabled(): boolean;
perftrc(s: string): void;
info(s: string): void;
startGroup(): void;

View File

@@ -51,12 +51,12 @@ module ts.server {
this.firstInGroup = true;
}
enabled() {
loggingEnabled() {
return !!this.logFilename;
}
isVerbose() {
return this.enabled() && (this.level == "verbose");
return this.loggingEnabled() && (this.level == "verbose");
}
@@ -196,7 +196,7 @@ module ts.server {
detailLevel?: string;
}
function parseLogEnv(logEnvStr: string): LogOptions {
function parseLoggingEnvironmentString(logEnvStr: string): LogOptions {
var logEnv: LogOptions = {};
var args = logEnvStr.split(' ');
for (var i = 0, len = args.length; i < (len - 1); i += 2) {
@@ -222,7 +222,7 @@ module ts.server {
var detailLevel = "normal";
var logEnvStr = process.env["TSS_LOG"];
if (logEnvStr) {
var logEnv = parseLogEnv(logEnvStr);
var logEnv = parseLoggingEnvironmentString(logEnvStr);
if (logEnv.file) {
fileName = logEnv.file;
}

View File

@@ -464,7 +464,13 @@ module ts.server {
var compilerService = project.compilerService;
var position = compilerService.host.lineColToPosition(file, line, col);
var edits = compilerService.languageService.getFormattingEditsAfterKeystroke(file, position, key,
compilerService.formatCodeOptions);
compilerService.formatCodeOptions);
// Check whether we should auto-indent. This will be when
// the position is on a line containing only whitespace.
// This should leave the edits returned from
// getFormattingEditsAfterKeytroke either empty or pertaining
// only to the previous line. If all this is true, then
// add edits necessary to properly indent the current line.
if ((key == "\n") && ((!edits) || (edits.length == 0) || allEditsBeforePos(edits, position))) {
var scriptInfo = compilerService.host.getScriptInfo(file);
if (scriptInfo) {