Skip to content

Commit 693e4e2

Browse files
committed
Switch comments to jsdoc
1 parent 6781641 commit 693e4e2

File tree

2 files changed

+102
-68
lines changed

2 files changed

+102
-68
lines changed

src/services/services.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ module ts {
15281528
isAnyFunction(node.parent) && (<FunctionDeclaration>node.parent).name === node;
15291529
}
15301530

1531-
/// Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 }
1531+
/** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */
15321532
function isNameOfPropertyAssignment(node: Node): boolean {
15331533
return (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral) &&
15341534
node.parent.kind === SyntaxKind.PropertyAssignment && (<PropertyDeclaration>node.parent).name === node;
@@ -1747,9 +1747,11 @@ module ts {
17471747
fullTypeCheckChecker_doNotAccessDirectly = undefined;
17481748
}
17491749

1750-
/// Clean up any semantic caches that are not needed.
1751-
/// The host can call this method if it wants to jettison unused memory.
1752-
/// We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches.
1750+
/**
1751+
* Clean up any semantic caches that are not needed.
1752+
* The host can call this method if it wants to jettison unused memory.
1753+
* We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches.
1754+
*/
17531755
function cleanupSemanticCache(): void {
17541756
if (program) {
17551757
typeInfoResolver = program.getTypeChecker(/*fullTypeCheckMode*/ false);
@@ -1773,8 +1775,10 @@ module ts {
17731775
return program.getDiagnostics(getSourceFile(filename).getSourceFile());
17741776
}
17751777

1776-
// getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors
1777-
// If '-d' enabled, report both semantic and emitter errors
1778+
/**
1779+
* getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors
1780+
* If '-d' enabled, report both semantic and emitter errors
1781+
*/
17781782
function getSemanticDiagnostics(filename: string) {
17791783
synchronizeHostData();
17801784

src/services/shims.ts

Lines changed: 92 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,29 @@ 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+
/** Get's 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+
/** Get's the length of this script snapshot. */
2929
getLength(): number;
3030

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

35-
// Returns a JSON encoded value of the type:
36-
// { span: { start: number; length: number }; newLength: number }
37-
//
38-
// Or null value if there was no change.
34+
/**
35+
* Returns a JSON encoded value of the type:
36+
* { span: { start: number; length: number }; newLength: number }
37+
*
38+
* Or null value if there was no change.
39+
*/
3940
getChangeRange(oldSnapshot: ScriptSnapshotShim): string;
4041
}
4142

42-
//
43-
// Public interface of the host of a language service shim instance.
44-
//
43+
/** Public interface of the host of a language service shim instance.*/
4544
export interface LanguageServiceShimHost extends Logger {
4645
getCompilationSettings(): string;
4746

48-
// Returns a JSON encoded value of the type:
49-
// string[]
47+
/** Returns a JSON encoded value of the type: string[] */
5048
getScriptFileNames(): string;
5149
getScriptVersion(fileName: string): string;
5250
getScriptIsOpen(fileName: string): boolean;
@@ -57,9 +55,7 @@ module ts {
5755
getDefaultLibFilename(): string;
5856
}
5957

60-
//
61-
// Public interface of of a language service instance shim.
62-
//
58+
/** Public interface of a language service instance shim. */
6359
export interface ShimFactory {
6460
registerShim(shim: Shim): void;
6561
unregisterShim(shim: Shim): void;
@@ -96,38 +92,54 @@ module ts {
9692
getSignatureHelpItems(fileName: string, position: number): string;
9793
getSignatureHelpCurrentArgumentState(fileName: string, position: number, applicableSpanStart: number): string;
9894

99-
// Returns a JSON encoded value of the type:
100-
// { canRename: boolean, localizedErrorMessage: string, displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: { start; length } }
95+
/**
96+
* Returns a JSON encoded value of the type:
97+
* { canRename: boolean, localizedErrorMessage: string, displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: { start; length } }
98+
*/
10199
getRenameInfo(fileName: string, position: number): string;
102100

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

109-
// Returns a JSON encoded value of the type:
110-
// { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
109+
/**
110+
* Returns a JSON encoded value of the type:
111+
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
112+
*/
111113
getReferencesAtPosition(fileName: string, position: number): string;
112114

113-
// Returns a JSON encoded value of the type:
114-
// { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
115+
/**
116+
* Returns a JSON encoded value of the type:
117+
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
118+
*/
115119
getOccurrencesAtPosition(fileName: string, position: number): string;
116120

117-
// Returns a JSON encoded value of the type:
118-
// { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
121+
/**
122+
* Returns a JSON encoded value of the type:
123+
* { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[]
124+
*/
119125
getImplementorsAtPosition(fileName: string, position: number): string;
120-
121-
// Returns a JSON encoded value of the type:
122-
// { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = [];
126+
127+
/**
128+
* Returns a JSON encoded value of the type:
129+
* { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = [];
130+
*/
123131
getNavigateToItems(searchValue: string): string;
124132

125-
// Returns a JSON encoded value of the type:
126-
// { text: string; kind: string; kindModifiers: string; bolded: boolean; grayed: boolean; indent: number; spans: { start: number; length: number; }[]; childItems: <recursive use of this type>[] } [] = [];
133+
/**
134+
* Returns a JSON encoded value of the type:
135+
* { text: string; kind: string; kindModifiers: string; bolded: boolean; grayed: boolean; indent: number; spans: { start: number; length: number; }[]; childItems: <recursive use of this type>[] } [] = [];
136+
*/
127137
getNavigationBarItems(fileName: string): string;
128138

129-
// Returns a JSON encoded value of the type:
130-
// { textSpan: { start: number, length: number }; hintSpan: { start: number, length: number }; bannerText: string; autoCollapse: boolean } [] = [];
139+
/**
140+
* Returns a JSON encoded value of the type:
141+
* { textSpan: { start: number, length: number }; hintSpan: { start: number, length: number }; bannerText: string; autoCollapse: boolean } [] = [];
142+
*/
131143
getOutliningSpans(fileName: string): string;
132144

133145
getTodoComments(fileName: string, todoCommentDescriptors: string): string;
@@ -435,9 +447,12 @@ module ts {
435447
return forwardJSONCall(this.logger, actionDescription, action);
436448
}
437449

438-
// DISPOSE
439-
// Ensure (almost) deterministic release of internal Javascript resources when
440-
// some external native objects holds onto us (e.g. Com/Interop).
450+
/// DISPOSE
451+
452+
/**
453+
* Ensure (almost) deterministic release of internal Javascript resources when
454+
* some external native objects holds onto us (e.g. Com/Interop).
455+
*/
441456
public dispose(dummy: any): void {
442457
this.logger.log("dispose()");
443458
this.languageService.dispose();
@@ -454,8 +469,11 @@ module ts {
454469
super.dispose(dummy);
455470
}
456471

457-
// REFRESH
458-
// Update the list of scripts known to the compiler
472+
/// REFRESH
473+
474+
/**
475+
* Update the list of scripts known to the compiler
476+
*/
459477
public refresh(throwOnError: boolean): void {
460478
this.forwardJSONCall(
461479
"refresh(" + throwOnError + ")",
@@ -540,8 +558,11 @@ module ts {
540558
}
541559

542560
/// QUICKINFO
543-
/// Computes a string representation of the type at the requested position
544-
/// in the active file.
561+
562+
/**
563+
* Computes a string representation of the type at the requested position
564+
* in the active file.
565+
*/
545566
public getQuickInfoAtPosition(fileName: string, position: number): string {
546567
return this.forwardJSONCall(
547568
"getQuickInfoAtPosition('" + fileName + "', " + position + ")",
@@ -562,8 +583,11 @@ module ts {
562583
}
563584

564585
/// NAMEORDOTTEDNAMESPAN
565-
/// Computes span information of the name or dotted name at the requested position
566-
// in the active file.
586+
587+
/**
588+
* Computes span information of the name or dotted name at the requested position
589+
* in the active file.
590+
*/
567591
public getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string {
568592
return this.forwardJSONCall(
569593
"getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")",
@@ -573,8 +597,10 @@ module ts {
573597
});
574598
}
575599

576-
/// STATEMENTSPAN
577-
/// Computes span information of statement at the requested position in the active file.
600+
/**
601+
* STATEMENTSPAN
602+
* Computes span information of statement at the requested position in the active file.
603+
*/
578604
public getBreakpointStatementAtPosition(fileName: string, position: number): string {
579605
return this.forwardJSONCall(
580606
"getBreakpointStatementAtPosition('" + fileName + "', " + position + ")",
@@ -606,8 +632,11 @@ module ts {
606632

607633

608634
/// GOTO DEFINITION
609-
/// Computes the definition location and file for the symbol
610-
/// at the requested position.
635+
636+
/**
637+
* Computes the definition location and file for the symbol
638+
* at the requested position.
639+
*/
611640
public getDefinitionAtPosition(fileName: string, position: number): string {
612641
return this.forwardJSONCall(
613642
"getDefinitionAtPosition('" + fileName + "', " + position + ")",
@@ -645,9 +674,12 @@ module ts {
645674
}
646675

647676
/// GET REFERENCES
648-
/// Return references to a symbol at the requested position.
649-
/// References are separated by "\n".
650-
/// Each reference is a "fileindex min lim" sub-string.
677+
678+
/**
679+
* Return references to a symbol at the requested position.
680+
* References are separated by "\n".
681+
* Each reference is a "fileindex min lim" sub-string.
682+
*/
651683
public getReferencesAtPosition(fileName: string, position: number): string {
652684
return this.forwardJSONCall(
653685
"getReferencesAtPosition('" + fileName + "', " + position + ")",
@@ -675,9 +707,12 @@ module ts {
675707

676708

677709
/// COMPLETION LISTS
678-
/// Get a string based representation of the completions
679-
/// to provide at the given source position and providing a member completion
680-
/// list if requested.
710+
711+
/**
712+
* Get a string based representation of the completions
713+
* to provide at the given source position and providing a member completion
714+
* list if requested.
715+
*/
681716
public getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean) {
682717
return this.forwardJSONCall(
683718
"getCompletionsAtPosition('" + fileName + "', " + position + ", " + isMemberCompletion + ")",
@@ -687,7 +722,7 @@ module ts {
687722
});
688723
}
689724

690-
/// Get a string based representation of a completion list entry details
725+
/** Get a string based representation of a completion list entry details */
691726
public getCompletionEntryDetails(fileName: string, position: number, entryName: string) {
692727
return this.forwardJSONCall(
693728
"getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")",
@@ -728,7 +763,8 @@ module ts {
728763
}
729764

730765
/// NAVIGATE TO
731-
/// Return a list of symbols that are interesting to navigate to
766+
767+
/** Return a list of symbols that are interesting to navigate to */
732768
public getNavigateToItems(searchValue: string): string {
733769
return this.forwardJSONCall(
734770
"getNavigateToItems('" + searchValue + "')",
@@ -807,9 +843,6 @@ module ts {
807843
return forwardJSONCall(this.logger, actionDescription, action);
808844
}
809845

810-
///
811-
/// getPreProcessedFileInfo
812-
///
813846
public getPreProcessedFileInfo(fileName: string, sourceText: TypeScript.IScriptSnapshot): string {
814847
return this.forwardJSONCall(
815848
"getPreProcessedFileInfo('" + fileName + "')",
@@ -819,9 +852,6 @@ module ts {
819852
});
820853
}
821854

822-
///
823-
/// getDefaultCompilationSettings
824-
///
825855
public getDefaultCompilationSettings(): string {
826856
return this.forwardJSONCall(
827857
"getDefaultCompilationSettings()",

0 commit comments

Comments
 (0)