mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
spelling fixes for src
Fixes: * actual * algorithm * analyze * applies * collapse * contrast * definition * diagnostic * different * displayed * display * documentation * finite * function * highlight * initialize * intentional * interface * invariants * items * keystroke * language * literal * original * output * position * receive * recorder * response * sequence * simplicity * statement Changing a \ to a /
This commit is contained in:
@@ -262,8 +262,8 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
// different order with 'pull' operations, and thus can produce slightly differing
|
||||
// output.
|
||||
//
|
||||
// For example, with a full type check, we may see a type outputed as: number | string
|
||||
// But with a pull type check, we may see it as: string | number
|
||||
// For example, with a full type check, we may see a type displayed as: number | string
|
||||
// But with a pull type check, we may see it as: string | number
|
||||
//
|
||||
// These types are equivalent, but depend on what order the compiler observed
|
||||
// certain parts of the program.
|
||||
|
||||
Vendored
+2
-2
@@ -1073,7 +1073,7 @@ declare module "crypto" {
|
||||
update(data: any): void;
|
||||
sign(private_key: string, output_format: string): string;
|
||||
}
|
||||
export function createVerify(algorith: string): Verify;
|
||||
export function createVerify(algorithm: string): Verify;
|
||||
interface Verify {
|
||||
update(data: any): void;
|
||||
verify(object: string, signature: string, signature_format?: string): boolean;
|
||||
@@ -1237,7 +1237,7 @@ declare module "assert" {
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export var throws: {
|
||||
|
||||
@@ -231,13 +231,13 @@ namespace FourSlash {
|
||||
private getLanguageServiceAdapter(testType: FourSlashTestType, cancellationToken: TestCancellationToken, compilationOptions: ts.CompilerOptions): Harness.LanguageService.LanguageServiceAdapter {
|
||||
switch (testType) {
|
||||
case FourSlashTestType.Native:
|
||||
return new Harness.LanguageService.NativeLanugageServiceAdapter(cancellationToken, compilationOptions);
|
||||
return new Harness.LanguageService.NativeLanguageServiceAdapter(cancellationToken, compilationOptions);
|
||||
case FourSlashTestType.Shims:
|
||||
return new Harness.LanguageService.ShimLanugageServiceAdapter(/*preprocessToResolve*/ false, cancellationToken, compilationOptions);
|
||||
return new Harness.LanguageService.ShimLanguageServiceAdapter(/*preprocessToResolve*/ false, cancellationToken, compilationOptions);
|
||||
case FourSlashTestType.ShimsWithPreprocess:
|
||||
return new Harness.LanguageService.ShimLanugageServiceAdapter(/*preprocessToResolve*/ true, cancellationToken, compilationOptions);
|
||||
return new Harness.LanguageService.ShimLanguageServiceAdapter(/*preprocessToResolve*/ true, cancellationToken, compilationOptions);
|
||||
case FourSlashTestType.Server:
|
||||
return new Harness.LanguageService.ServerLanugageServiceAdapter(cancellationToken, compilationOptions);
|
||||
return new Harness.LanguageService.ServerLanguageServiceAdapter(cancellationToken, compilationOptions);
|
||||
default:
|
||||
throw new Error("Unknown FourSlash test type: ");
|
||||
}
|
||||
@@ -1279,7 +1279,7 @@ namespace FourSlash {
|
||||
const edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions);
|
||||
if (edits.length) {
|
||||
offset += this.applyEdits(this.activeFile.fileName, edits, /*isFormattingEdit*/ true);
|
||||
// this.checkPostEditInletiants();
|
||||
// this.checkPostEditInvariants();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1370,7 +1370,7 @@ namespace FourSlash {
|
||||
const edits = this.languageService.getFormattingEditsAfterKeystroke(this.activeFile.fileName, offset, ch, this.formatCodeOptions);
|
||||
if (edits.length) {
|
||||
offset += this.applyEdits(this.activeFile.fileName, edits, /*isFormattingEdit*/ true);
|
||||
// this.checkPostEditInletiants();
|
||||
// this.checkPostEditInvariants();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2771,12 +2771,12 @@ namespace FourSlashInterface {
|
||||
|
||||
// Verifies the member list contains the specified symbol. The
|
||||
// member list is brought up if necessary
|
||||
public memberListContains(symbol: string, text?: string, documenation?: string, kind?: string) {
|
||||
public memberListContains(symbol: string, text?: string, documentation?: string, kind?: string) {
|
||||
if (this.negative) {
|
||||
this.state.verifyMemberListDoesNotContain(symbol);
|
||||
}
|
||||
else {
|
||||
this.state.verifyMemberListContains(symbol, text, documenation, kind);
|
||||
this.state.verifyMemberListContains(symbol, text, documentation, kind);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1330,7 +1330,7 @@ namespace Harness {
|
||||
|
||||
public getSourceMapRecord() {
|
||||
if (this.sourceMapData) {
|
||||
return Harness.SourceMapRecoder.getSourceMapRecord(this.sourceMapData, this.program, this.files);
|
||||
return Harness.SourceMapRecorder.getSourceMapRecord(this.sourceMapData, this.program, this.files);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace Harness.LanguageService {
|
||||
error(s: string): void { }
|
||||
}
|
||||
|
||||
export class NativeLanugageServiceAdapter implements LanguageServiceAdapter {
|
||||
export class NativeLanguageServiceAdapter implements LanguageServiceAdapter {
|
||||
private host: NativeLanguageServiceHost;
|
||||
constructor(cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
|
||||
this.host = new NativeLanguageServiceHost(cancellationToken, options);
|
||||
@@ -429,7 +429,7 @@ namespace Harness.LanguageService {
|
||||
dispose(): void { this.shim.dispose({}); }
|
||||
}
|
||||
|
||||
export class ShimLanugageServiceAdapter implements LanguageServiceAdapter {
|
||||
export class ShimLanguageServiceAdapter implements LanguageServiceAdapter {
|
||||
private host: ShimLanguageServiceHost;
|
||||
private factory: ts.TypeScriptServicesFactory;
|
||||
constructor(preprocessToResolve: boolean, cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
|
||||
@@ -611,7 +611,7 @@ namespace Harness.LanguageService {
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerLanugageServiceAdapter implements LanguageServiceAdapter {
|
||||
export class ServerLanguageServiceAdapter implements LanguageServiceAdapter {
|
||||
private host: SessionClientHost;
|
||||
private client: ts.server.SessionClient;
|
||||
constructor(cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace Playback {
|
||||
};
|
||||
wrapper.startReplayFromData = log => {
|
||||
replayLog = log;
|
||||
// Remove non-found files from the log (shouldn't really need them, but we still record them for diganostic purposes)
|
||||
// Remove non-found files from the log (shouldn't really need them, but we still record them for diagnostic purposes)
|
||||
replayLog.filesRead = replayLog.filesRead.filter(f => f.result.contents !== undefined);
|
||||
};
|
||||
|
||||
|
||||
@@ -370,14 +370,14 @@ class ProjectRunner extends RunnerBase {
|
||||
}
|
||||
|
||||
const outputDtsFileName = emitOutputFilePathWithoutExtension + ".d.ts";
|
||||
const file = findOutpuDtsFile(outputDtsFileName);
|
||||
const file = findOutputDtsFile(outputDtsFileName);
|
||||
if (file) {
|
||||
allInputFiles.unshift(file);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const outputDtsFileName = ts.removeFileExtension(compilerOptions.outFile || compilerOptions.out) + ".d.ts";
|
||||
const outputDtsFile = findOutpuDtsFile(outputDtsFileName);
|
||||
const outputDtsFile = findOutputDtsFile(outputDtsFileName);
|
||||
if (!ts.contains(allInputFiles, outputDtsFile)) {
|
||||
allInputFiles.unshift(outputDtsFile);
|
||||
}
|
||||
@@ -387,7 +387,7 @@ class ProjectRunner extends RunnerBase {
|
||||
// Dont allow config files since we are compiling existing source options
|
||||
return compileProjectFiles(compilerResult.moduleKind, getInputFiles, getSourceFileText, writeFile, compilerResult.compilerOptions);
|
||||
|
||||
function findOutpuDtsFile(fileName: string) {
|
||||
function findOutputDtsFile(fileName: string) {
|
||||
return ts.forEach(compilerResult.outputFiles, outputFile => outputFile.emittedFileName === fileName ? outputFile : undefined);
|
||||
}
|
||||
function getInputFiles() {
|
||||
@@ -484,7 +484,7 @@ class ProjectRunner extends RunnerBase {
|
||||
it("SourceMapRecord for (" + moduleNameToString(moduleKind) + "): " + testCaseFileName, () => {
|
||||
if (compilerResult.sourceMapData) {
|
||||
Harness.Baseline.runBaseline("SourceMapRecord for (" + moduleNameToString(compilerResult.moduleKind) + "): " + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + testCaseJustName + ".sourcemap.txt", () => {
|
||||
return Harness.SourceMapRecoder.getSourceMapRecord(compilerResult.sourceMapData, compilerResult.program,
|
||||
return Harness.SourceMapRecorder.getSourceMapRecord(compilerResult.sourceMapData, compilerResult.program,
|
||||
ts.filter(compilerResult.outputFiles, outputFile => Harness.Compiler.isJS(outputFile.emittedFileName)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
///<reference path="harness.ts"/>
|
||||
|
||||
namespace Harness.SourceMapRecoder {
|
||||
namespace Harness.SourceMapRecorder {
|
||||
|
||||
interface SourceMapSpanWithDecodeErrors {
|
||||
sourceMapSpan: ts.SourceMapSpan;
|
||||
@@ -202,7 +202,7 @@ namespace Harness.SourceMapRecoder {
|
||||
}
|
||||
|
||||
namespace SourceMapSpanWriter {
|
||||
let sourceMapRecoder: Compiler.WriterAggregator;
|
||||
let sourceMapRecorder: Compiler.WriterAggregator;
|
||||
let sourceMapSources: string[];
|
||||
let sourceMapNames: string[];
|
||||
|
||||
@@ -216,8 +216,8 @@ namespace Harness.SourceMapRecoder {
|
||||
let prevWrittenJsLine: number;
|
||||
let spanMarkerContinues: boolean;
|
||||
|
||||
export function intializeSourceMapSpanWriter(sourceMapRecordWriter: Compiler.WriterAggregator, sourceMapData: ts.SourceMapData, currentJsFile: Compiler.GeneratedFile) {
|
||||
sourceMapRecoder = sourceMapRecordWriter;
|
||||
export function initializeSourceMapSpanWriter(sourceMapRecordWriter: Compiler.WriterAggregator, sourceMapData: ts.SourceMapData, currentJsFile: Compiler.GeneratedFile) {
|
||||
sourceMapRecorder = sourceMapRecordWriter;
|
||||
sourceMapSources = sourceMapData.sourceMapSources;
|
||||
sourceMapNames = sourceMapData.sourceMapNames;
|
||||
|
||||
@@ -231,15 +231,15 @@ namespace Harness.SourceMapRecoder {
|
||||
|
||||
SourceMapDecoder.initializeSourceMapDecoding(sourceMapData);
|
||||
|
||||
sourceMapRecoder.WriteLine("===================================================================");
|
||||
sourceMapRecoder.WriteLine("JsFile: " + sourceMapData.sourceMapFile);
|
||||
sourceMapRecoder.WriteLine("mapUrl: " + sourceMapData.jsSourceMappingURL);
|
||||
sourceMapRecoder.WriteLine("sourceRoot: " + sourceMapData.sourceMapSourceRoot);
|
||||
sourceMapRecoder.WriteLine("sources: " + sourceMapData.sourceMapSources);
|
||||
sourceMapRecorder.WriteLine("===================================================================");
|
||||
sourceMapRecorder.WriteLine("JsFile: " + sourceMapData.sourceMapFile);
|
||||
sourceMapRecorder.WriteLine("mapUrl: " + sourceMapData.jsSourceMappingURL);
|
||||
sourceMapRecorder.WriteLine("sourceRoot: " + sourceMapData.sourceMapSourceRoot);
|
||||
sourceMapRecorder.WriteLine("sources: " + sourceMapData.sourceMapSources);
|
||||
if (sourceMapData.sourceMapSourcesContent) {
|
||||
sourceMapRecoder.WriteLine("sourcesContent: " + JSON.stringify(sourceMapData.sourceMapSourcesContent));
|
||||
sourceMapRecorder.WriteLine("sourcesContent: " + JSON.stringify(sourceMapData.sourceMapSourcesContent));
|
||||
}
|
||||
sourceMapRecoder.WriteLine("===================================================================");
|
||||
sourceMapRecorder.WriteLine("===================================================================");
|
||||
}
|
||||
|
||||
function getSourceMapSpanString(mapEntry: ts.SourceMapSpan, getAbsentNameIndex?: boolean) {
|
||||
@@ -291,10 +291,10 @@ namespace Harness.SourceMapRecoder {
|
||||
recordSourceMapSpan(sourceMapSpan);
|
||||
|
||||
assert.isTrue(spansOnSingleLine.length === 1);
|
||||
sourceMapRecoder.WriteLine("-------------------------------------------------------------------");
|
||||
sourceMapRecoder.WriteLine("emittedFile:" + jsFile.fileName);
|
||||
sourceMapRecoder.WriteLine("sourceFile:" + sourceMapSources[spansOnSingleLine[0].sourceMapSpan.sourceIndex]);
|
||||
sourceMapRecoder.WriteLine("-------------------------------------------------------------------");
|
||||
sourceMapRecorder.WriteLine("-------------------------------------------------------------------");
|
||||
sourceMapRecorder.WriteLine("emittedFile:" + jsFile.fileName);
|
||||
sourceMapRecorder.WriteLine("sourceFile:" + sourceMapSources[spansOnSingleLine[0].sourceMapSpan.sourceIndex]);
|
||||
sourceMapRecorder.WriteLine("-------------------------------------------------------------------");
|
||||
|
||||
tsLineMap = ts.computeLineStarts(newSourceFileCode);
|
||||
tsCode = newSourceFileCode;
|
||||
@@ -306,8 +306,8 @@ namespace Harness.SourceMapRecoder {
|
||||
writeRecordedSpans();
|
||||
|
||||
if (!SourceMapDecoder.hasCompletedDecoding()) {
|
||||
sourceMapRecoder.WriteLine("!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded");
|
||||
sourceMapRecoder.WriteLine("!!!! **** Remaining decoded string: " + SourceMapDecoder.getRemainingDecodeString());
|
||||
sourceMapRecorder.WriteLine("!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded");
|
||||
sourceMapRecorder.WriteLine("!!!! **** Remaining decoded string: " + SourceMapDecoder.getRemainingDecodeString());
|
||||
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace Harness.SourceMapRecoder {
|
||||
|
||||
function writeJsFileLines(endJsLine: number) {
|
||||
for (; prevWrittenJsLine < endJsLine; prevWrittenJsLine++) {
|
||||
sourceMapRecoder.Write(">>>" + getTextOfLine(prevWrittenJsLine, jsLineMap, jsFile.code));
|
||||
sourceMapRecorder.Write(">>>" + getTextOfLine(prevWrittenJsLine, jsLineMap, jsFile.code));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,9 +356,9 @@ namespace Harness.SourceMapRecoder {
|
||||
}
|
||||
|
||||
function writeSourceMapIndent(indentLength: number, indentPrefix: string) {
|
||||
sourceMapRecoder.Write(indentPrefix);
|
||||
sourceMapRecorder.Write(indentPrefix);
|
||||
for (let i = 1; i < indentLength; i++) {
|
||||
sourceMapRecoder.Write(" ");
|
||||
sourceMapRecorder.Write(" ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,12 +369,12 @@ namespace Harness.SourceMapRecoder {
|
||||
writeSourceMapIndent(prevEmittedCol, markerId);
|
||||
|
||||
for (let i = prevEmittedCol; i < endColumn; i++) {
|
||||
sourceMapRecoder.Write("^");
|
||||
sourceMapRecorder.Write("^");
|
||||
}
|
||||
if (endContinues) {
|
||||
sourceMapRecoder.Write("->");
|
||||
sourceMapRecorder.Write("->");
|
||||
}
|
||||
sourceMapRecoder.WriteLine("");
|
||||
sourceMapRecorder.WriteLine("");
|
||||
spanMarkerContinues = endContinues;
|
||||
}
|
||||
|
||||
@@ -390,16 +390,16 @@ namespace Harness.SourceMapRecoder {
|
||||
// If there are decode errors, write
|
||||
for (let i = 0; i < currentSpan.decodeErrors.length; i++) {
|
||||
writeSourceMapIndent(prevEmittedCol, markerIds[index]);
|
||||
sourceMapRecoder.WriteLine(currentSpan.decodeErrors[i]);
|
||||
sourceMapRecorder.WriteLine(currentSpan.decodeErrors[i]);
|
||||
}
|
||||
}
|
||||
|
||||
const tsCodeLineMap = ts.computeLineStarts(sourceText);
|
||||
for (let i = 0; i < tsCodeLineMap.length; i++) {
|
||||
writeSourceMapIndent(prevEmittedCol, i === 0 ? markerIds[index] : " >");
|
||||
sourceMapRecoder.Write(getTextOfLine(i, tsCodeLineMap, sourceText));
|
||||
sourceMapRecorder.Write(getTextOfLine(i, tsCodeLineMap, sourceText));
|
||||
if (i === tsCodeLineMap.length - 1) {
|
||||
sourceMapRecoder.WriteLine("");
|
||||
sourceMapRecorder.WriteLine("");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ namespace Harness.SourceMapRecoder {
|
||||
}
|
||||
|
||||
function writeSpanDetails(currentSpan: SourceMapSpanWithDecodeErrors, index: number) {
|
||||
sourceMapRecoder.WriteLine(markerIds[index] + getSourceMapSpanString(currentSpan.sourceMapSpan));
|
||||
sourceMapRecorder.WriteLine(markerIds[index] + getSourceMapSpanString(currentSpan.sourceMapSpan));
|
||||
}
|
||||
|
||||
if (spansOnSingleLine.length) {
|
||||
@@ -431,19 +431,19 @@ namespace Harness.SourceMapRecoder {
|
||||
// Emit column number etc
|
||||
iterateSpans(writeSpanDetails);
|
||||
|
||||
sourceMapRecoder.WriteLine("---");
|
||||
sourceMapRecorder.WriteLine("---");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getSourceMapRecord(sourceMapDataList: ts.SourceMapData[], program: ts.Program, jsFiles: Compiler.GeneratedFile[]) {
|
||||
const sourceMapRecoder = new Compiler.WriterAggregator();
|
||||
const sourceMapRecorder = new Compiler.WriterAggregator();
|
||||
|
||||
for (let i = 0; i < sourceMapDataList.length; i++) {
|
||||
const sourceMapData = sourceMapDataList[i];
|
||||
let prevSourceFile: ts.SourceFile;
|
||||
|
||||
SourceMapSpanWriter.intializeSourceMapSpanWriter(sourceMapRecoder, sourceMapData, jsFiles[i]);
|
||||
SourceMapSpanWriter.initializeSourceMapSpanWriter(sourceMapRecorder, sourceMapData, jsFiles[i]);
|
||||
for (let j = 0; j < sourceMapData.sourceMapDecodedMappings.length; j++) {
|
||||
const decodedSourceMapping = sourceMapData.sourceMapDecodedMappings[j];
|
||||
const currentSourceFile = program.getSourceFile(sourceMapData.inputSourceFileNames[decodedSourceMapping.sourceIndex]);
|
||||
@@ -457,7 +457,7 @@ namespace Harness.SourceMapRecoder {
|
||||
}
|
||||
SourceMapSpanWriter.close(); // If the last spans werent emitted, emit them
|
||||
}
|
||||
sourceMapRecoder.Close();
|
||||
return sourceMapRecoder.lines.join("\r\n");
|
||||
sourceMapRecorder.Close();
|
||||
return sourceMapRecorder.lines.join("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
-5
@@ -194,7 +194,7 @@ declare var ANGLE_instanced_arrays: {
|
||||
VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
|
||||
}
|
||||
|
||||
interface AnalyserNode extends AudioNode {
|
||||
interface AnalyzerNode extends AudioNode {
|
||||
fftSize: number;
|
||||
frequencyBinCount: number;
|
||||
maxDecibels: number;
|
||||
@@ -206,9 +206,9 @@ interface AnalyserNode extends AudioNode {
|
||||
getFloatTimeDomainData(array: Float32Array): void;
|
||||
}
|
||||
|
||||
declare var AnalyserNode: {
|
||||
prototype: AnalyserNode;
|
||||
new(): AnalyserNode;
|
||||
declare var AnalyzerNode: {
|
||||
prototype: AnalyzerNode;
|
||||
new(): AnalyzerNode;
|
||||
}
|
||||
|
||||
interface AnimationEvent extends Event {
|
||||
@@ -322,7 +322,7 @@ interface AudioContext extends EventTarget {
|
||||
listener: AudioListener;
|
||||
sampleRate: number;
|
||||
state: string;
|
||||
createAnalyser(): AnalyserNode;
|
||||
createAnalyzer(): AnalyzerNode;
|
||||
createBiquadFilter(): BiquadFilterNode;
|
||||
createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;
|
||||
createBufferSource(): AudioBufferSourceNode;
|
||||
|
||||
Vendored
+1
-1
@@ -222,7 +222,7 @@ interface NumberConstructor {
|
||||
|
||||
/**
|
||||
* Returns true if passed value is finite.
|
||||
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
|
||||
* Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a
|
||||
* number. Only finite values of the type number, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace ts.server {
|
||||
|
||||
private processResponse<T extends protocol.Response>(request: protocol.Request): T {
|
||||
var lastMessage = this.messages.shift();
|
||||
Debug.assert(!!lastMessage, "Did not recieve any responses.");
|
||||
Debug.assert(!!lastMessage, "Did not receive any responses.");
|
||||
|
||||
// Read the content length
|
||||
var contentLengthPrefix = "Content-Length: ";
|
||||
@@ -108,7 +108,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
// verify the sequence numbers
|
||||
Debug.assert(response.request_seq === request.seq, "Malformed response: response sequance number did not match request sequence number.");
|
||||
Debug.assert(response.request_seq === request.seq, "Malformed response: response sequence number did not match request sequence number.");
|
||||
|
||||
// unmarshal errors
|
||||
if (!response.success) {
|
||||
|
||||
Vendored
+5
-5
@@ -444,7 +444,7 @@ declare namespace ts.server.protocol {
|
||||
/** Defines space handling after a comma delimiter. Default value is true. */
|
||||
insertSpaceAfterCommaDelimiter?: boolean;
|
||||
|
||||
/** Defines space handling after a semicolon in a for statemen. Default value is true */
|
||||
/** Defines space handling after a semicolon in a for statement. Default value is true */
|
||||
insertSpaceAfterSemicolonInForStatements?: boolean;
|
||||
|
||||
/** Defines space handling after a binary operator. Default value is true. */
|
||||
@@ -835,7 +835,7 @@ declare namespace ts.server.protocol {
|
||||
prefixDisplayParts: SymbolDisplayPart[];
|
||||
|
||||
/**
|
||||
* The suffix disaply parts.
|
||||
* The suffix display parts.
|
||||
*/
|
||||
suffixDisplayParts: SymbolDisplayPart[];
|
||||
|
||||
@@ -903,7 +903,7 @@ declare namespace ts.server.protocol {
|
||||
}
|
||||
|
||||
/**
|
||||
* Repsonse object for a SignatureHelpRequest.
|
||||
* Response object for a SignatureHelpRequest.
|
||||
*/
|
||||
export interface SignatureHelpResponse extends Response {
|
||||
body?: SignatureHelpItems;
|
||||
@@ -970,7 +970,7 @@ declare namespace ts.server.protocol {
|
||||
*/
|
||||
export interface Diagnostic {
|
||||
/**
|
||||
* Starting file location at which text appies.
|
||||
* Starting file location at which text applies.
|
||||
*/
|
||||
start: Location;
|
||||
|
||||
@@ -1179,7 +1179,7 @@ declare namespace ts.server.protocol {
|
||||
}
|
||||
|
||||
/**
|
||||
* NavBar itesm request; value of command field is "navbar".
|
||||
* NavBar items request; value of command field is "navbar".
|
||||
* Return response giving the list of navigation bar entries
|
||||
* extracted from the requested file.
|
||||
*/
|
||||
|
||||
@@ -603,7 +603,7 @@ namespace ts.server {
|
||||
// Check whether we should auto-indent. This will be when
|
||||
// the position is on a line containing only whitespace.
|
||||
// This should leave the edits returned from
|
||||
// getFormattingEditsAfterKeytroke either empty or pertaining
|
||||
// getFormattingEditsAfterKeystroke either empty or pertaining
|
||||
// only to the previous line. If all this is true, then
|
||||
// add edits necessary to properly indent the current line.
|
||||
if ((key == "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) {
|
||||
|
||||
@@ -490,17 +490,17 @@ namespace ts.BreakpointResolver {
|
||||
return spanInNode(block.statements[0]);
|
||||
}
|
||||
|
||||
function spanInInitializerOfForLike(forLikeStaement: ForStatement | ForOfStatement | ForInStatement): TextSpan {
|
||||
if (forLikeStaement.initializer.kind === SyntaxKind.VariableDeclarationList) {
|
||||
function spanInInitializerOfForLike(forLikeStatement: ForStatement | ForOfStatement | ForInStatement): TextSpan {
|
||||
if (forLikeStatement.initializer.kind === SyntaxKind.VariableDeclarationList) {
|
||||
// declaration list, set breakpoint in first declaration
|
||||
let variableDeclarationList = <VariableDeclarationList>forLikeStaement.initializer;
|
||||
let variableDeclarationList = <VariableDeclarationList>forLikeStatement.initializer;
|
||||
if (variableDeclarationList.declarations.length > 0) {
|
||||
return spanInNode(variableDeclarationList.declarations[0]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Expression - set breakpoint in it
|
||||
return spanInNode(forLikeStaement.initializer);
|
||||
return spanInNode(forLikeStatement.initializer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ namespace ts.formatting {
|
||||
return enclosingNode.pos;
|
||||
}
|
||||
|
||||
// preceding token ends after the start of original range (i.e when originaRange.pos falls in the middle of literal)
|
||||
// preceding token ends after the start of original range (i.e when originalRange.pos falls in the middle of literal)
|
||||
// start from the beginning of enclosingNode to handle the entire 'originalRange'
|
||||
if (precedingToken.end >= originalRange.pos) {
|
||||
return enclosingNode.pos;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace ts.formatting {
|
||||
// readTokenInfo was called before with the same expected scan action.
|
||||
// No need to re-scan text, return existing 'lastTokenInfo'
|
||||
// it is ok to call fixTokenKind here since it does not affect
|
||||
// what portion of text is consumed. In opposize rescanning can change it,
|
||||
// what portion of text is consumed. In contrast rescanning can change it,
|
||||
// i.e. for '>=' when originally scanner eats just one character
|
||||
// and rescanning forces it to consume more.
|
||||
return fixTokenKind(lastTokenInfo, n);
|
||||
|
||||
@@ -561,13 +561,13 @@ namespace ts.formatting {
|
||||
//// Ex:
|
||||
//// if (1)
|
||||
//// { ... }
|
||||
//// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we don't format.
|
||||
//// * ) and { are on different lines. We only need to format if the block is multiline context. So in this case we don't format.
|
||||
////
|
||||
//// Ex:
|
||||
//// if (1)
|
||||
//// { ...
|
||||
//// }
|
||||
//// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we format.
|
||||
//// * ) and { are on different lines. We only need to format if the block is multiline context. So in this case we format.
|
||||
|
||||
return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context);
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ namespace ts.NavigationBar {
|
||||
return createEnumItem(<EnumDeclaration>node);
|
||||
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
return createIterfaceItem(<InterfaceDeclaration>node);
|
||||
return createInterfaceItem(<InterfaceDeclaration>node);
|
||||
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
return createModuleItem(<ModuleDeclaration>node);
|
||||
@@ -493,7 +493,7 @@ namespace ts.NavigationBar {
|
||||
getIndent(node));
|
||||
}
|
||||
|
||||
function createIterfaceItem(node: InterfaceDeclaration): ts.NavigationBarItem {
|
||||
function createInterfaceItem(node: InterfaceDeclaration): ts.NavigationBarItem {
|
||||
let childItems = getItemsWorker(sortNodes(removeDynamicallyNamedProperties(node)), createChildItem);
|
||||
return getNavigationBarItem(
|
||||
node.name.text,
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace ts.OutliningElementsCollector {
|
||||
const closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
|
||||
// Check if the block is standalone, or 'attached' to some parent statement.
|
||||
// If the latter, we want to collaps the block, but consider its hint span
|
||||
// If the latter, we want to collapse the block, but consider its hint span
|
||||
// to be the entire span of the parent.
|
||||
if (parent.kind === SyntaxKind.DoStatement ||
|
||||
parent.kind === SyntaxKind.ForInStatement ||
|
||||
|
||||
@@ -754,7 +754,7 @@ namespace ts {
|
||||
`getDocumentHighlights('${fileName}', ${position})`,
|
||||
() => {
|
||||
const results = this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
|
||||
// workaround for VS document higlighting issue - keep only items from the initial file
|
||||
// workaround for VS document highlighting issue - keep only items from the initial file
|
||||
const normalizedName = normalizeSlashes(fileName).toLowerCase();
|
||||
return filter(results, r => normalizeSlashes(r.fileName).toLowerCase() === normalizedName);
|
||||
});
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace ts.SignatureHelp {
|
||||
// case TypeScript.SyntaxKind.GreaterThanGreaterThanGreaterThanToken:
|
||||
// stack++;
|
||||
|
||||
// // Intentaion fall through
|
||||
// // Intentional fall through
|
||||
// case TypeScript.SyntaxKind.GreaterThanToken:
|
||||
// stack++;
|
||||
// break;
|
||||
@@ -76,7 +76,7 @@ namespace ts.SignatureHelp {
|
||||
// break;
|
||||
|
||||
// case TypeScript.SyntaxKind.EqualsGreaterThanToken:
|
||||
// // This can be a function type or a constructor type. In either case, we want to skip the function defintion
|
||||
// // This can be a function type or a constructor type. In either case, we want to skip the function definition
|
||||
// token = previousToken(token, /*includeSkippedTokens*/ true);
|
||||
|
||||
// if (token && token.kind() === TypeScript.SyntaxKind.CloseParenToken) {
|
||||
@@ -99,7 +99,7 @@ namespace ts.SignatureHelp {
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// // This is not a funtion type. exit the main loop
|
||||
// // This is not a function type. exit the main loop
|
||||
// break whileLoop;
|
||||
// }
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace ts {
|
||||
|
||||
case SyntaxKind.CaseClause:
|
||||
case SyntaxKind.DefaultClause:
|
||||
// there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed
|
||||
// there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed
|
||||
return false;
|
||||
|
||||
case SyntaxKind.ForStatement:
|
||||
@@ -265,7 +265,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
/* Gets the token whose text has range [start, end) and position >= start
|
||||
* and (position < end or (position === end && token is keyword or identifier or numeric\string litera))
|
||||
* and (position < end or (position === end && token is keyword or identifier or numeric/string literal))
|
||||
*/
|
||||
export function getTouchingPropertyName(sourceFile: SourceFile, position: number): Node {
|
||||
return getTouchingToken(sourceFile, position, n => isPropertyName(n.kind));
|
||||
|
||||
@@ -9,10 +9,10 @@ interface ClassificationEntry {
|
||||
|
||||
describe('Colorization', function () {
|
||||
// Use the shim adapter to ensure test coverage of the shim layer for the classifier
|
||||
var languageServiceAdapter = new Harness.LanguageService.ShimLanugageServiceAdapter(/*preprocessToResolve*/ false);
|
||||
var languageServiceAdapter = new Harness.LanguageService.ShimLanguageServiceAdapter(/*preprocessToResolve*/ false);
|
||||
var classifier = languageServiceAdapter.getClassifier();
|
||||
|
||||
function getEntryAtPosistion(result: ts.ClassificationResult, position: number) {
|
||||
function getEntryAtPosition(result: ts.ClassificationResult, position: number) {
|
||||
var entryPosition = 0;
|
||||
for (var i = 0, n = result.entries.length; i < n; i++) {
|
||||
var entry = result.entries[i];
|
||||
@@ -55,7 +55,7 @@ describe('Colorization', function () {
|
||||
var actualEntryPosition = expectedEntry.position !== undefined ? expectedEntry.position : text.indexOf(expectedEntry.value);
|
||||
assert(actualEntryPosition >= 0, "token: '" + expectedEntry.value + "' does not exit in text: '" + text + "'.");
|
||||
|
||||
var actualEntry = getEntryAtPosistion(result, actualEntryPosition);
|
||||
var actualEntry = getEntryAtPosition(result, actualEntryPosition);
|
||||
|
||||
assert(actualEntry, "Could not find classification entry for '" + expectedEntry.value + "' at position: " + actualEntryPosition);
|
||||
assert.equal(actualEntry.classification, expectedEntry.classification, "Classification class does not match expected. Expected: " + ts.TokenClass[expectedEntry.classification] + ", Actual: " + ts.TokenClass[actualEntry.classification]);
|
||||
|
||||
Reference in New Issue
Block a user