Skip to content

Commit

Permalink
Use consistent whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehoban committed Nov 29, 2015
1 parent 1cb4b88 commit 3536dd2
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 74 deletions.
10 changes: 5 additions & 5 deletions src/debugAdapter/common/debugProtocol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ declare module DebugProtocol {
/** Event message for "stopped" event type.
The event indicates that the execution of the debugee has stopped due to a break condition.
This can be caused by by a break point previously set, a stepping action has completed or by executing a debugger statement.
*/
*/
export interface StoppedEvent extends Event {
body: {
/** The reason for the event (such as: 'step', 'breakpoint', 'exception', 'pause') */
Expand Down Expand Up @@ -318,7 +318,7 @@ declare module DebugProtocol {
This means that there is no location information available. */
stackFrames: StackFrame[];
};
}
}

/** Scopes request; value of command field is "scopes".
The request returns the variable scopes for a given stackframe ID.
Expand All @@ -337,7 +337,7 @@ declare module DebugProtocol {
/** The scopes of the stackframe. If the array has length zero, there are no scopes available. */
scopes: Scope[];
};
}
}

/** Variables request; value of command field is "variables".
Retrieves all children for the given variable reference.
Expand Down Expand Up @@ -388,15 +388,15 @@ declare module DebugProtocol {
/** All threads. */
threads: Thread[];
};
}
}

/** Evaluate request; value of command field is "evaluate".
Evaluates the given expression in the context of the top most stack frame.
The expression has access to any variables and arguments that are in scope.
*/
export interface EvaluateRequest extends Request {
arguments: EvaluateArguments;
}
}
/** Arguments for "evaluate" request. */
export interface EvaluateArguments {
/** The expression to evaluate */
Expand Down
4 changes: 2 additions & 2 deletions src/goExtraInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class GoHoverProvider implements HoverProvider {
public provideHover(document: TextDocument, position: Position, token: CancellationToken): Thenable<Hover> {

return new Promise((resolve, reject) => {
let filename = document.fileName;
let filename = document.fileName;
let offset = document.offsetAt(position);

var godef = getBinPath("godef");
Expand Down Expand Up @@ -43,7 +43,7 @@ export class GoHoverProvider implements HoverProvider {
} else {
text = lines[0]
}
let hover = new Hover({ language: 'go', value: text });
let hover = new Hover({ language: 'go', value: text });
return resolve(hover);
} catch (e) {
reject(e);
Expand Down
33 changes: 16 additions & 17 deletions src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,26 @@ export function setupGoPathAndOfferToInstallTools() {
});

function promptForInstall(missing: string[]) {

var item = {
title: "Install",
command() {
title: "Install",
command() {
var channel = vscode.window.createOutputChannel('Go');
channel.show();
missing.forEach(tool => {
missing.forEach(tool => {
cp.exec("go get -u -v " + tool, { env: process.env }, (err, stdout, stderr) => {
channel.append(stdout.toString())
channel.append(stderr.toString())
if (err) {
channel.append('exec error: ' + err)
}
})
});
}
};
channel.append(stdout.toString());
channel.append(stderr.toString());
if (err) {
channel.append('exec error: ' + err);
}
});
});
}
};
vscode.window.showInformationMessage("Some Go analysis tools are missing from your GOPATH. Would you like to install them?", item).then(selection => {
if (selection) {
selection.command();
}
});
if (selection) {
selection.command();
}
});
}
}
4 changes: 2 additions & 2 deletions src/goMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function activate(ctx: vscode.ExtensionContext): void {
vscode.window.showInformationMessage("Current GOPATH:" + gopath);
}));

vscode.languages.setLanguageConfiguration(GO_MODE.language, {
vscode.languages.setLanguageConfiguration(GO_MODE.language, {
indentationRules: {
// ^(.*\*/)?\s*\}.*$
decreaseIndentPattern: /^(.*\*\/)?\s*\}.*$/,
Expand Down Expand Up @@ -79,7 +79,7 @@ export function activate(ctx: vscode.ExtensionContext): void {
{ open: '\'', close: '\'', notIn: ['string', 'comment'] }
]
}
});
});

if(vscode.window.activeTextEditor) {
let goConfig = vscode.workspace.getConfiguration('go');
Expand Down
4 changes: 2 additions & 2 deletions src/goSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {
var results = <[number, GoCodeSuggestion[]]>JSON.parse(stdout.toString());
var suggestions = results[1].map(suggest => {
var item = new vscode.CompletionItem(suggest.name);
item.kind = vscodeKindFromGoCodeClass(suggest.class);
item.detail = suggest.type;
item.kind = vscodeKindFromGoCodeClass(suggest.class);
item.detail = suggest.type;
return item;
})
resolve(suggestions);
Expand Down
6 changes: 3 additions & 3 deletions test/go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ suite("Go Extension Tests", () => {

let uri = vscode.Uri.file(fixture);
vscode.workspace.openTextDocument(uri).then((textDocument) => {
provider.provideHover(textDocument, position, null).then(value => {
assert.equal(value.contents.length, 1);
assert.equal('main func()', (<{ language: string; value: string }> value.contents[0]).value, 'hover text does not match');
provider.provideHover(textDocument, position, null).then(value => {
assert.equal(value.contents.length, 1);
assert.equal('main func()', (<{ language: string; value: string }>value.contents[0]).value, 'hover text does not match');
done();
});
}, (err) => {
Expand Down
84 changes: 42 additions & 42 deletions typings/diff-match-patch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,49 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module "diff-match-patch" {
type Diff = [number, string];
export class Patch {
diffs: Diff[];
start1: number;
start2: number;
length1: number;
length2: number;
}

export class diff_match_patch {
static new (): diff_match_patch;
type Diff = [number, string];
export class Patch {
diffs: Diff[];
start1: number;
start2: number;
length1: number;
length2: number;
}

Diff_Timeout: number;
Diff_EditCost: number;
Match_Threshold: number;
Match_Distance: number;
Patch_DeleteThreshold: number;
Patch_Margin: number;
Match_MaxBits: number;
export class diff_match_patch {
static new (): diff_match_patch;

diff_main(text1: string, text2: string, opt_checklines?: boolean, opt_deadline?: number): Diff[];
diff_commonPrefix(text1: string, text2: string): number;
diff_commonSuffix(text1: string, text2: string): number;
diff_cleanupSemantic(diffs: Diff[]): void;
diff_cleanupSemanticLossless(diffs: Diff[]): void;
diff_cleanupEfficiency(diffs: Diff[]): void;
diff_cleanupMerge(diffs: Diff[]): void;
diff_xIndex(diffs: Diff[], loc: number): number;
diff_prettyHtml(diffs: Diff[]): string;
diff_text1(diffs: Diff[]): string;
diff_text2(diffs: Diff[]): string;
diff_levenshtein(diffs: Diff[]): number;
diff_toDelta(diffs: Diff[]): string;
diff_fromDelta(text1: string, delta: string): Diff[];

patch_make(text1, text2: string): Patch[];
patch_deepCopy(patches: Patch[]): Patch[];
patch_apply(patches: Patch[], text: string): [string, boolean[]];
patch_fromText(text: string): Patch[];
patch_toText(patches: Patch[]): string;
}
Diff_Timeout: number;
Diff_EditCost: number;
Match_Threshold: number;
Match_Distance: number;
Patch_DeleteThreshold: number;
Patch_Margin: number;
Match_MaxBits: number;

export var DIFF_DELETE: number;
export var DIFF_INSERT: number;
export var DIFF_EQUAL: number;
diff_main(text1: string, text2: string, opt_checklines?: boolean, opt_deadline?: number): Diff[];
diff_commonPrefix(text1: string, text2: string): number;
diff_commonSuffix(text1: string, text2: string): number;
diff_cleanupSemantic(diffs: Diff[]): void;
diff_cleanupSemanticLossless(diffs: Diff[]): void;
diff_cleanupEfficiency(diffs: Diff[]): void;
diff_cleanupMerge(diffs: Diff[]): void;
diff_xIndex(diffs: Diff[], loc: number): number;
diff_prettyHtml(diffs: Diff[]): string;
diff_text1(diffs: Diff[]): string;
diff_text2(diffs: Diff[]): string;
diff_levenshtein(diffs: Diff[]): number;
diff_toDelta(diffs: Diff[]): string;
diff_fromDelta(text1: string, delta: string): Diff[];

patch_make(text1, text2: string): Patch[];
patch_deepCopy(patches: Patch[]): Patch[];
patch_apply(patches: Patch[], text: string): [string, boolean[]];
patch_fromText(text: string): Patch[];
patch_toText(patches: Patch[]): string;
}

export var DIFF_DELETE: number;
export var DIFF_INSERT: number;
export var DIFF_EQUAL: number;
}
2 changes: 1 addition & 1 deletion typings/fs-extra/fs-extra.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ declare module "fs-extra" {
export function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
export function exists(path: string, callback?: (exists: boolean) => void ): void;
export function existsSync(path: string): boolean;
export function ensureDir(path: string, cb: (err: Error) => void): void;
export function ensureDir(path: string, cb: (err: Error) => void): void;

export interface OpenOptions {
encoding?: string;
Expand Down

0 comments on commit 3536dd2

Please sign in to comment.