Skip to content

Commit e186bb3

Browse files
committed
Correcting documentation to better match JSDoc's style.
1 parent fc6faeb commit e186bb3

14 files changed

Lines changed: 75 additions & 76 deletions

File tree

src/vs/base/common/arrays.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function tail<T>(array: T[], n: number = 0): T {
1515

1616
/**
1717
* Iterates the provided array and allows to remove
18-
* element while iterating.
18+
* elements while iterating.
1919
*/
2020
export function forEach<T>(array: T[], callback: (element: T, remove: Function) => void): void {
2121
for (var i = 0, len = array.length; i < len; i++) {
@@ -76,7 +76,7 @@ export function binarySearch(array: any[], key: any, comparator: (op1: any, op2:
7676
/**
7777
* Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false
7878
* are located before all elements where p(x) is true.
79-
* Returns the least x for which p(x) is true or array.length if no element fullfills the given function
79+
* @returns the least x for which p(x) is true or array.length if no element fullfills the given function.
8080
*/
8181
export function findFirst<T>(array: T[], p: (x: T) => boolean): number {
8282
var low = 0, high = array.length;
@@ -118,7 +118,7 @@ export function merge<T>(arrays: T[][], hashFn?: (element: T) => string): T[] {
118118
}
119119

120120
/**
121-
* Returns a new array with all undefined or null values removed. The original array is not modified at all.
121+
* @returns a new array with all undefined or null values removed. The original array is not modified at all.
122122
*/
123123
export function coalesce<T>(array: T[]): T[] {
124124
if (!array) {
@@ -129,7 +129,7 @@ export function coalesce<T>(array: T[]): T[] {
129129
}
130130

131131
/**
132-
* Returns true if the given item is contained in the array
132+
* @returns true if the given item is contained in the array.
133133
*/
134134
export function contains<T>(array: T[], item: T): boolean {
135135
return array.indexOf(item) >= 0;
@@ -154,7 +154,7 @@ export function move(array: any[], from: number, to: number): void {
154154
}
155155

156156
/**
157-
* @returns false if the provided object is an array
157+
* @returns {{false}} if the provided object is an array
158158
* and not empty.
159159
*/
160160
export function isFalsyOrEmpty(obj: any): boolean {

src/vs/base/common/async.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export class RunOnceScheduler {
477477
}
478478

479479
/**
480-
* Cancel current scheduled runner (if any)
480+
* Cancel current scheduled runner (if any).
481481
*/
482482
public cancel(): void {
483483
if (this.timeoutToken !== -1) {

src/vs/base/common/collections.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function createNumberDictionary<V>():INumberDictionary<V> {
3535
* @param what The key.
3636
* @param from A native JavaScript object that stores items.
3737
* @param alternate A default value this is return in case an item with
38-
* the key isn't found
38+
* the key isn't found.
3939
*/
4040
export function lookup<T>(from:IStringDictionary<T>, what:string, alternate?:T):T;
4141
export function lookup<T>(from:INumberDictionary<T>, what:number, alternate?:T):T;

src/vs/base/common/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface ErrorListenerUnbind {
2222
(): void;
2323
}
2424

25-
// avoid circular dependency on EventEmitter by implementing a subset of the interface
25+
// Avoid circular dependency on EventEmitter by implementing a subset of the interface.
2626
export class ErrorHandler {
2727
private unexpectedErrorHandler: (e: any) => void;
2828
private listeners: ErrorListenerCallback[];
@@ -255,6 +255,7 @@ function _exceptionToErrorMessage(exception: any, verbose: boolean): string {
255255
/**
256256
* Tries to generate a human readable error message out of the error. If the verbose parameter
257257
* is set to true, the error message will include stacktrace details if provided.
258+
* @returns A string containing the error message.
258259
*/
259260
export function toErrorMessage(error: any = null, verbose: boolean = false): string {
260261
if (!error) {

src/vs/base/common/filters.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface IMatch {
1919
// Combined filters
2020

2121
/**
22-
* Returns a filter which combines the provided set
22+
* @returns A filter which combines the provided set
2323
* of filters with an or. The *first* filters that
2424
* matches defined the return value of the returned
2525
* filter.
@@ -37,7 +37,7 @@ export function or(...filter:IFilter[]):IFilter {
3737
}
3838

3939
/**
40-
* Returns a filter which combines the provided set
40+
* @returns A filter which combines the provided set
4141
* of filters with an and. The combines matches are
4242
* returned if *all* filters match.
4343
*/

src/vs/base/common/keyCodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import Platform = require('vs/base/common/platform');
1111
/**
1212
* Virtual Key Codes, the value does not hold any inherent meaning.
1313
* Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
14-
* But these are "more general", as they should work across browsers & OS`s
14+
* But these are "more general", as they should work across browsers & OS`s.
1515
*/
1616
export enum KeyCode {
1717
/**
18-
* Placed first to cover the 0 value of the enum
18+
* Placed first to cover the 0 value of the enum.
1919
*/
2020
Unknown,
2121

src/vs/base/common/network.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export class URL extends URI implements objects.IEqualable {
289289
/**
290290
* Creates a new URL from the provided value
291291
* by decoding it first.
292-
* @param value A encoded url value.
292+
* @param value An encoded url value.
293293
*/
294294
public static fromEncoded(value:string):URL {
295295
return new URL(decodeURIComponent(value));
@@ -354,7 +354,7 @@ export class URL extends URI implements objects.IEqualable {
354354
}
355355

356356
/**
357-
* Strip out the hash part of the URL
357+
* Strips out the hash part of the URL.
358358
* http://www.test.com:8000/this/that/theother.html?query=foo for http://www.test.com:8000/this/that/theother.html?query=foo#hash
359359
*/
360360
public toUnique():string {

src/vs/base/common/objects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as Types from 'vs/base/common/types';
99
/**
1010
* Equalable objects can compute a
1111
* hash-code and can also tell if they
12-
* are equal to other objects
12+
* are equal to other objects.
1313
*/
1414
export interface IEqualable {
1515
hashCode(): number;

src/vs/base/common/paths.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function dirnames(path: string): { next: () => { done: boolean; value: st
9797
}
9898

9999
/**
100-
* Returns the directory name of a path.
100+
* @returns the directory name of a path.
101101
*/
102102
export function dirname(path: string): string {
103103
var idx = ~path.lastIndexOf('/') || ~path.lastIndexOf('\\');
@@ -111,7 +111,7 @@ export function dirname(path: string): string {
111111
}
112112

113113
/**
114-
* Returns the base name of a path.
114+
* @returns the base name of a path.
115115
*/
116116
export function basename(path: string): string {
117117
var idx = ~path.lastIndexOf('/') || ~path.lastIndexOf('\\');
@@ -125,7 +125,7 @@ export function basename(path: string): string {
125125
}
126126

127127
/**
128-
* Returns {{.far}} from boo.far or the empty string.
128+
* @returns {{.far}} from boo.far or the empty string.
129129
*/
130130
export function extname(path: string): string {
131131
path = basename(path);

src/vs/base/common/processes.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ValidationStatus, ValidationState, ILogger, Parser, ISystemVariables }
1515

1616

1717
/**
18-
* Options to be passed to the external program or shell
18+
* Options to be passed to the external program or shell.
1919
*/
2020
export interface CommandOptions {
2121
/**
@@ -33,25 +33,25 @@ export interface CommandOptions {
3333

3434
export interface Executable {
3535
/**
36-
* The command to be executed. Can be an external program or a shell
37-
* command.
38-
*/
36+
* The command to be executed. Can be an external program or a shell
37+
* command.
38+
*/
3939
command: string;
4040

4141
/**
42-
* Specifies whether the command is a shell command and therefore must
43-
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
44-
*/
42+
* Specifies whether the command is a shell command and therefore must
43+
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
44+
*/
4545
isShellCommand: boolean;
4646

4747
/**
48-
* The arguments passed to the command.
49-
*/
48+
* The arguments passed to the command.
49+
*/
5050
args: string[];
5151

5252
/**
53-
* The command options used when the command is executed. Can be omitted.
54-
*/
53+
* The command options used when the command is executed. Can be omitted.
54+
*/
5555
options?: CommandOptions;
5656
}
5757

@@ -90,68 +90,68 @@ export interface TerminateResponse {
9090

9191
export namespace Config {
9292
/**
93-
* Options to be passed to the external program or shell
94-
*/
93+
* Options to be passed to the external program or shell
94+
*/
9595
export interface CommandOptions {
9696
/**
97-
* The current working directory of the executed program or shell.
98-
* If omitted VSCode's current workspace root is used.
99-
*/
97+
* The current working directory of the executed program or shell.
98+
* If omitted VSCode's current workspace root is used.
99+
*/
100100
cwd?: string;
101101

102102
/**
103-
* The additional environment of the executed program or shell. If omitted
104-
* the parent process' environment is used.
105-
*/
103+
* The additional environment of the executed program or shell. If omitted
104+
* the parent process' environment is used.
105+
*/
106106
env?: IStringDictionary<string>;
107107

108108
/**
109-
* Index signature
110-
*/
109+
* Index signature
110+
*/
111111
[key:string]: string | string[] | IStringDictionary<string>;
112112
}
113113

114114
export interface BaseExecutable {
115115
/**
116-
* The command to be executed. Can be an external program or a shell
117-
* command.
118-
*/
116+
* The command to be executed. Can be an external program or a shell
117+
* command.
118+
*/
119119
command?: string;
120120

121121
/**
122-
* Specifies whether the command is a shell command and therefore must
123-
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
124-
*
125-
* Defaults to false if omitted.
126-
*/
122+
* Specifies whether the command is a shell command and therefore must
123+
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
124+
*
125+
* Defaults to false if omitted.
126+
*/
127127
isShellCommand?: boolean;
128128

129129
/**
130-
* The arguments passed to the command. Can be omitted.
131-
*/
130+
* The arguments passed to the command. Can be omitted.
131+
*/
132132
args?: string[];
133133

134134
/**
135-
* The command options used when the command is executed. Can be omitted.
136-
*/
135+
* The command options used when the command is executed. Can be omitted.
136+
*/
137137
options?: CommandOptions;
138138
}
139139

140140
export interface Executable extends BaseExecutable {
141141

142142
/**
143-
* Windows specific executable configuration
144-
*/
143+
* Windows specific executable configuration
144+
*/
145145
windows?: BaseExecutable;
146146

147147
/**
148-
* Mac specific executable configuration
149-
*/
148+
* Mac specific executable configuration
149+
*/
150150
osx?: BaseExecutable;
151151

152152
/**
153-
* Linux specific executable configuration
154-
*/
153+
* Linux specific executable configuration
154+
*/
155155
linux?: BaseExecutable;
156156

157157
}

0 commit comments

Comments
 (0)