mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Update names.
This commit is contained in:
parent
b49e07c2fa
commit
7769b4cd19
@ -241,7 +241,7 @@ module Harness.LanguageService {
|
||||
class ClassifierShimProxy implements ts.Classifier {
|
||||
constructor(private shim: ts.ClassifierShim) {
|
||||
}
|
||||
getLexicalClassifications2(text: string, lexState: ts.EndOfLineState, classifyKeywordsInGenerics?: boolean): ts.Classifications {
|
||||
getEncodedLexicalClassifications(text: string, lexState: ts.EndOfLineState, classifyKeywordsInGenerics?: boolean): ts.Classifications {
|
||||
throw new Error("NYI");
|
||||
}
|
||||
getClassificationsForLine(text: string, lexState: ts.EndOfLineState, classifyKeywordsInGenerics?: boolean): ts.ClassificationResult {
|
||||
@ -309,11 +309,11 @@ module Harness.LanguageService {
|
||||
getSemanticClassifications(fileName: string, span: ts.TextSpan): ts.ClassifiedSpan[] {
|
||||
return unwrapJSONCallResult(this.shim.getSemanticClassifications(fileName, span.start, span.length));
|
||||
}
|
||||
getSyntacticClassifications2(fileName: string, span: ts.TextSpan): ts.Classifications {
|
||||
return unwrapJSONCallResult(this.shim.getSyntacticClassifications2(fileName, span.start, span.length));
|
||||
getEncodedSyntacticClassifications(fileName: string, span: ts.TextSpan): ts.Classifications {
|
||||
return unwrapJSONCallResult(this.shim.getEncodedSyntacticClassifications(fileName, span.start, span.length));
|
||||
}
|
||||
getSemanticClassifications2(fileName: string, span: ts.TextSpan): ts.Classifications {
|
||||
return unwrapJSONCallResult(this.shim.getSemanticClassifications2(fileName, span.start, span.length));
|
||||
getEncodedSemanticClassifications(fileName: string, span: ts.TextSpan): ts.Classifications {
|
||||
return unwrapJSONCallResult(this.shim.getEncodedSemanticClassifications(fileName, span.start, span.length));
|
||||
}
|
||||
getCompletionsAtPosition(fileName: string, position: number): ts.CompletionInfo {
|
||||
return unwrapJSONCallResult(this.shim.getCompletionsAtPosition(fileName, position));
|
||||
|
||||
@ -533,11 +533,11 @@ module ts.server {
|
||||
throw new Error("Not Implemented Yet.");
|
||||
}
|
||||
|
||||
getSyntacticClassifications2(fileName: string, span: TextSpan): Classifications {
|
||||
getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications {
|
||||
throw new Error("Not Implemented Yet.");
|
||||
}
|
||||
|
||||
getSemanticClassifications2(fileName: string, span: TextSpan): Classifications {
|
||||
getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications {
|
||||
throw new Error("Not Implemented Yet.");
|
||||
}
|
||||
|
||||
|
||||
@ -973,18 +973,18 @@ module ts {
|
||||
getCompilerOptionsDiagnostics(): Diagnostic[];
|
||||
|
||||
/**
|
||||
* @deprecated Use getSyntacticClassifications2 instead.
|
||||
* @deprecated Use getEncodedSyntacticClassifications instead.
|
||||
*/
|
||||
getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
|
||||
|
||||
/**
|
||||
* @deprecated Use getSemanticClassifications2 instead.
|
||||
* @deprecated Use getEncodedSemanticClassifications instead.
|
||||
*/
|
||||
getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[];
|
||||
|
||||
// Encoded as triples of [start, length, ClassificationType].
|
||||
getSyntacticClassifications2(fileName: string, span: TextSpan): Classifications;
|
||||
getSemanticClassifications2(fileName: string, span: TextSpan): Classifications;
|
||||
getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
|
||||
getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications;
|
||||
|
||||
getCompletionsAtPosition(fileName: string, position: number): CompletionInfo;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails;
|
||||
@ -1330,7 +1330,7 @@ module ts {
|
||||
* @deprecated Use getLexicalClassifications instead.
|
||||
*/
|
||||
getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult;
|
||||
getLexicalClassifications2(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
|
||||
getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5847,10 +5847,10 @@ module ts {
|
||||
}
|
||||
|
||||
function getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]{
|
||||
return convertClassifications(getSemanticClassifications2(fileName, span));
|
||||
return convertClassifications(getEncodedSemanticClassifications(fileName, span));
|
||||
}
|
||||
|
||||
function getSemanticClassifications2(fileName: string, span: TextSpan): Classifications {
|
||||
function getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications {
|
||||
synchronizeHostData();
|
||||
|
||||
let sourceFile = getValidSourceFile(fileName);
|
||||
@ -5963,10 +5963,10 @@ module ts {
|
||||
}
|
||||
|
||||
function getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]{
|
||||
return convertClassifications(getSyntacticClassifications2(fileName, span));
|
||||
return convertClassifications(getEncodedSyntacticClassifications(fileName, span));
|
||||
}
|
||||
|
||||
function getSyntacticClassifications2(fileName: string, span: TextSpan): Classifications {
|
||||
function getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications {
|
||||
// doesn't use compiler - no need to synchronize with host
|
||||
let sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
|
||||
|
||||
@ -6489,8 +6489,8 @@ module ts {
|
||||
getCompilerOptionsDiagnostics,
|
||||
getSyntacticClassifications,
|
||||
getSemanticClassifications,
|
||||
getSyntacticClassifications2,
|
||||
getSemanticClassifications2,
|
||||
getEncodedSyntacticClassifications,
|
||||
getEncodedSemanticClassifications,
|
||||
getCompletionsAtPosition,
|
||||
getCompletionEntryDetails,
|
||||
getSignatureHelpItems,
|
||||
@ -6686,12 +6686,12 @@ module ts {
|
||||
}
|
||||
|
||||
function getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult {
|
||||
return convertClassifications(getLexicalClassifications2(text, lexState, syntacticClassifierAbsent), text);
|
||||
return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text);
|
||||
}
|
||||
|
||||
// If there is a syntactic classifier ('syntacticClassifierAbsent' is false),
|
||||
// we will be more conservative in order to avoid conflicting with the syntactic classifier.
|
||||
function getLexicalClassifications2(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications {
|
||||
function getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications {
|
||||
let offset = 0;
|
||||
let token = SyntaxKind.Unknown;
|
||||
let lastNonTriviaToken = SyntaxKind.Unknown;
|
||||
@ -7022,7 +7022,7 @@ module ts {
|
||||
|
||||
return {
|
||||
getClassificationsForLine,
|
||||
getLexicalClassifications2
|
||||
getEncodedLexicalClassifications
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -99,8 +99,8 @@ module ts {
|
||||
|
||||
getSyntacticClassifications(fileName: string, start: number, length: number): string;
|
||||
getSemanticClassifications(fileName: string, start: number, length: number): string;
|
||||
getSyntacticClassifications2(fileName: string, start: number, length: number): string;
|
||||
getSemanticClassifications2(fileName: string, start: number, length: number): string;
|
||||
getEncodedSyntacticClassifications(fileName: string, start: number, length: number): string;
|
||||
getEncodedSemanticClassifications(fileName: string, start: number, length: number): string;
|
||||
|
||||
getCompletionsAtPosition(fileName: string, position: number): string;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string): string;
|
||||
@ -191,7 +191,7 @@ module ts {
|
||||
}
|
||||
|
||||
export interface ClassifierShim extends Shim {
|
||||
getLexicalClassifications2(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string;
|
||||
getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string;
|
||||
getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string;
|
||||
}
|
||||
|
||||
@ -469,23 +469,23 @@ module ts {
|
||||
});
|
||||
}
|
||||
|
||||
public getSyntacticClassifications2(fileName: string, start: number, length: number): string {
|
||||
public getEncodedSyntacticClassifications(fileName: string, start: number, length: number): string {
|
||||
return this.forwardJSONCall(
|
||||
"getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")",
|
||||
"getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")",
|
||||
() => {
|
||||
// directly serialize the spans out to a string. This is much faster to decode
|
||||
// on the managed side versus a full JSON array.
|
||||
return convertClassifications(this.languageService.getSyntacticClassifications2(fileName, createTextSpan(start, length)));
|
||||
return convertClassifications(this.languageService.getEncodedSyntacticClassifications(fileName, createTextSpan(start, length)));
|
||||
});
|
||||
}
|
||||
|
||||
public getSemanticClassifications2(fileName: string, start: number, length: number): string {
|
||||
public getEncodedSemanticClassifications(fileName: string, start: number, length: number): string {
|
||||
return this.forwardJSONCall(
|
||||
"getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")",
|
||||
"getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")",
|
||||
() => {
|
||||
// directly serialize the spans out to a string. This is much faster to decode
|
||||
// on the managed side versus a full JSON array.
|
||||
return convertClassifications(this.languageService.getSemanticClassifications2(fileName, createTextSpan(start, length)));
|
||||
return convertClassifications(this.languageService.getEncodedSemanticClassifications(fileName, createTextSpan(start, length)));
|
||||
});
|
||||
}
|
||||
|
||||
@ -780,9 +780,9 @@ module ts {
|
||||
this.classifier = createClassifier();
|
||||
}
|
||||
|
||||
public getLexicalClassifications2(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string {
|
||||
return forwardJSONCall(this.logger, "getLexicalClassifications2",
|
||||
() => convertClassifications(this.classifier.getLexicalClassifications2(text, lexState, syntacticClassifierAbsent)),
|
||||
public getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string {
|
||||
return forwardJSONCall(this.logger, "getEncodedLexicalClassifications",
|
||||
() => convertClassifications(this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)),
|
||||
/*noPerfLogging:*/ true);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user