Skip to content

Commit 435c977

Browse files
committed
Respond to code review remarks
1 parent e20bec5 commit 435c977

File tree

2 files changed

+34
-28
lines changed

2 files changed

+34
-28
lines changed

src/services/shims.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ var debugObjectHost = (<any>this);
2222

2323
module ts {
2424
export interface ScriptSnapshotShim {
25-
/** Get's a portion of the script snapshot specified by [start, end). */
25+
/** Gets a portion of the script snapshot specified by [start, end). */
2626
getText(start: number, end: number): string;
2727

28-
/** Get's the length of this script snapshot. */
28+
/** Gets the length of this script snapshot. */
2929
getLength(): number;
3030

31-
/** This call returns the JSON encoded array of the type: number[] */
31+
/** This call returns the JSON-encoded array of the type: number[] */
3232
getLineStartPositions(): string;
3333

3434
/**
35-
* Returns a JSON encoded value of the type:
35+
* Returns a JSON-encoded value of the type:
3636
* { span: { start: number; length: number }; newLength: number }
3737
*
38-
* Or null value if there was no change.
38+
* Or undefined value if there was no change.
3939
*/
4040
getChangeRange(oldSnapshot: ScriptSnapshotShim): string;
4141
}
@@ -44,7 +44,7 @@ module ts {
4444
export interface LanguageServiceShimHost extends Logger {
4545
getCompilationSettings(): string;
4646

47-
/** Returns a JSON encoded value of the type: string[] */
47+
/** Returns a JSON-encoded value of the type: string[] */
4848
getScriptFileNames(): string;
4949
getScriptVersion(fileName: string): string;
5050
getScriptIsOpen(fileName: string): boolean;
@@ -93,51 +93,51 @@ module ts {
9393
getSignatureHelpCurrentArgumentState(fileName: string, position: number, applicableSpanStart: number): string;
9494

9595
/**
96-
* Returns a JSON encoded value of the type:
96+
* Returns a JSON-encoded value of the type:
9797
* { canRename: boolean, localizedErrorMessage: string, displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: { start; length } }
9898
*/
9999
getRenameInfo(fileName: string, position: number): string;
100100

101101
/**
102-
* Returns a JSON encoded value of the type:
102+
* Returns a JSON-encoded value of the type:
103103
* { fileName: string; textSpan: { start: number; length: number}; kind: string; name: string; containerKind: string; containerName: string }
104104
*
105-
* Or null value if no definition can be found.
105+
* Or undefined value if no definition can be found.
106106
*/
107107
getDefinitionAtPosition(fileName: string, position: number): string;
108108

109109
/**
110-
* Returns a JSON encoded value of the type:
110+
* Returns a JSON-encoded value of the type:
111111
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
112112
*/
113113
getReferencesAtPosition(fileName: string, position: number): string;
114114

115115
/**
116-
* Returns a JSON encoded value of the type:
116+
* Returns a JSON-encoded value of the type:
117117
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
118118
*/
119119
getOccurrencesAtPosition(fileName: string, position: number): string;
120120

121121
/**
122-
* Returns a JSON encoded value of the type:
122+
* Returns a JSON-encoded value of the type:
123123
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
124124
*/
125125
getImplementorsAtPosition(fileName: string, position: number): string;
126126

127127
/**
128-
* Returns a JSON encoded value of the type:
128+
* Returns a JSON-encoded value of the type:
129129
* { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = [];
130130
*/
131131
getNavigateToItems(searchValue: string): string;
132132

133133
/**
134-
* Returns a JSON encoded value of the type:
134+
* Returns a JSON-encoded value of the type:
135135
* { text: string; kind: string; kindModifiers: string; bolded: boolean; grayed: boolean; indent: number; spans: { start: number; length: number; }[]; childItems: <recursive use of this type>[] } [] = [];
136136
*/
137137
getNavigationBarItems(fileName: string): string;
138138

139139
/**
140-
* Returns a JSON encoded value of the type:
140+
* Returns a JSON-encoded value of the type:
141141
* { textSpan: { start: number, length: number }; hintSpan: { start: number, length: number }; bannerText: string; autoCollapse: boolean } [] = [];
142142
*/
143143
getOutliningSpans(fileName: string): string;

src/services/text/scriptSnapshot.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
///<reference path='references.ts' />
22

33
module TypeScript {
4-
// Represents an immutable snapshot of a script at a specified time. Once acquired, the
5-
// snapshot is observably immutable. i.e. the same calls with the same parameters will return
6-
// the same values.
4+
/**
5+
* Represents an immutable snapshot of a script at a specified time.Once acquired, the
6+
* snapshot is observably immutable. i.e. the same calls with the same parameters will return
7+
* the same values.
8+
*/
79
export interface IScriptSnapshot {
8-
// Get's a portion of the script snapshot specified by [start, end).
10+
/** Gets a portion of the script snapshot specified by [start, end). */
911
getText(start: number, end: number): string;
1012

11-
// Get's the length of this script snapshot.
13+
/** Gets the length of this script snapshot. */
1214
getLength(): number;
1315

14-
// This call returns the array containing the start position of every line.
15-
// i.e."[0, 10, 55]". TODO: consider making this optional. The language service could
16-
// always determine this (albeit in a more expensive manner).
16+
/**
17+
* This call returns the array containing the start position of every line.
18+
* i.e."[0, 10, 55]". TODO: consider making this optional. The language service could
19+
* always determine this (albeit in a more expensive manner).
20+
*/
1721
getLineStartPositions(): number[];
1822

19-
// Gets the TextChangeRange that describe how the text changed between this text and
20-
// an older version. This informatoin is used by the incremental parser to determine
21-
// what sections of the script need to be reparsed. 'null' can be returned if the
22-
// change range cannot be determined. However, in that case, incremental parsing will
23-
// not happen and the entire document will be reparsed.
23+
/**
24+
* Gets the TextChangeRange that describe how the text changed between this text and
25+
* an older version. This information is used by the incremental parser to determine
26+
* what sections of the script need to be re-parsed. 'null' can be returned if the
27+
* change range cannot be determined. However, in that case, incremental parsing will
28+
* not happen and the entire document will be re - parsed.
29+
*/
2430
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
2531
}
2632

0 commit comments

Comments
 (0)