From 132cd276d14e25461379068d61225fef9f09e55d Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 18:25:29 -0700 Subject: [PATCH 01/14] consistentlly compute the length of an unterminated multiline comment --- src/compiler/scanner.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 00966b12f2a..1db2f361f17 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -676,9 +676,8 @@ module ts { if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) { pos += 2; - var safeLength = len - 1; // For lookahead. var commentClosed = false; - while (pos < safeLength) { + while (pos < len) { var ch = text.charCodeAt(pos); if (ch === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) { @@ -694,7 +693,6 @@ module ts { } if (!commentClosed) { - pos++; error(Diagnostics.Asterisk_Slash_expected); } From 019994004cb912d45902ba4e403c8f821a2d77b3 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 18:28:14 -0700 Subject: [PATCH 02/14] wire classifier to use new compiler implementation --- src/compiler/types.ts | 4 +- src/services/services.ts | 227 ++++++++++++++++++++++++--------------- 2 files changed, 146 insertions(+), 85 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 5cb80687d80..33414c75e3d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -217,7 +217,9 @@ module ts { FirstKeyword = BreakKeyword, LastKeyword = StringKeyword, FirstFutureReservedWord = ImplementsKeyword, - LastFutureReservedWord = YieldKeyword + LastFutureReservedWord = YieldKeyword, + FirstPunctuation= OpenBraceToken, + LastPunctuation = CaretEqualsToken } export enum NodeFlags { diff --git a/src/services/services.ts b/src/services/services.ts index be05a48cee9..b11d8a91ec8 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2207,33 +2207,16 @@ module ts { } /// Classifier - export function createClassifier(host: Logger): Classifier { - var scanner: TypeScript.Scanner.IScanner; - var lastDiagnosticKey: string = null; - var noRegexTable: boolean[]; - var reportDiagnostic = (position: number, fullWidth: number, key: string, args: any[]) => { - lastDiagnosticKey = key; - }; - - if (!noRegexTable) { - noRegexTable = []; - noRegexTable[TypeScript.SyntaxKind.IdentifierName] = true; - noRegexTable[TypeScript.SyntaxKind.StringLiteral] = true; - noRegexTable[TypeScript.SyntaxKind.NumericLiteral] = true; - noRegexTable[TypeScript.SyntaxKind.RegularExpressionLiteral] = true; - noRegexTable[TypeScript.SyntaxKind.ThisKeyword] = true; - noRegexTable[TypeScript.SyntaxKind.PlusPlusToken] = true; - noRegexTable[TypeScript.SyntaxKind.MinusMinusToken] = true; - noRegexTable[TypeScript.SyntaxKind.CloseParenToken] = true; - noRegexTable[TypeScript.SyntaxKind.CloseBracketToken] = true; - noRegexTable[TypeScript.SyntaxKind.CloseBraceToken] = true; - noRegexTable[TypeScript.SyntaxKind.TrueKeyword] = true; - noRegexTable[TypeScript.SyntaxKind.FalseKeyword] = true; - } + var scanner: Scanner; + var noRegexTable: boolean[]; + if (!noRegexTable) { noRegexTable = []; noRegexTable[SyntaxKind.Identifier] = true; noRegexTable[SyntaxKind.StringLiteral] = true; noRegexTable[SyntaxKind.NumericLiteral] = true; noRegexTable[SyntaxKind.RegularExpressionLiteral] = true; noRegexTable[SyntaxKind.ThisKeyword] = true; noRegexTable[SyntaxKind.PlusPlusToken] = true; noRegexTable[SyntaxKind.MinusMinusToken] = true; noRegexTable[SyntaxKind.CloseParenToken] = true; noRegexTable[SyntaxKind.CloseBracketToken] = true; noRegexTable[SyntaxKind.CloseBraceToken] = true; noRegexTable[SyntaxKind.TrueKeyword] = true; noRegexTable[SyntaxKind.FalseKeyword] = true; } function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { var offset = 0; + var lastTokenOrCommentEnd = 0; + var inMultiLineComment = false; + if (lexState !== EndOfLineState.Start) { // If we're in a string literal, then prepend: "\ // (and a newline). That way when we lex we'll think we're still in a string literal. @@ -2258,94 +2241,170 @@ module ts { entries: [] }; - var simpleText = TypeScript.SimpleText.fromString(text); - scanner = TypeScript.Scanner.createScanner(ScriptTarget.ES5, simpleText, reportDiagnostic); + scanner = createScanner(ScriptTarget.ES5, text, onError, processComment); - var lastTokenKind = TypeScript.SyntaxKind.None; - var token: TypeScript.ISyntaxToken = null; + var lastToken = SyntaxKind.Unknown; + var token = SyntaxKind.Unknown; do { - lastDiagnosticKey = null; + inMultiLineComment = false; - token = scanner.scan(!noRegexTable[lastTokenKind]); - lastTokenKind = token.kind(); + token = scanner.scan(); - processToken(text, simpleText, offset, token, result); - } - while (token.kind() !== TypeScript.SyntaxKind.EndOfFileToken); - - lastDiagnosticKey = null; - return result; - } - - function processToken(text: string, simpleText: TypeScript.ISimpleText, offset: number, token: TypeScript.ISyntaxToken, result: ClassificationResult): void { - processTriviaList(text, offset, token.leadingTrivia(simpleText), result); - addResult(text, offset, result, TypeScript.width(token), token.kind()); - processTriviaList(text, offset, token.trailingTrivia(simpleText), result); - - if (TypeScript.fullEnd(token) >= text.length) { - // We're at the end. - if (lastDiagnosticKey === TypeScript.DiagnosticCode.AsteriskSlash_expected) { - result.finalLexState = EndOfLineState.InMultiLineCommentTrivia; - return; + if ((token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) && !noRegexTable[lastToken]) { + if (scanner.reScanSlashToken() === SyntaxKind.RegularExpressionLiteral) { + token = SyntaxKind.RegularExpressionLiteral; + } } - if (token.kind() === TypeScript.SyntaxKind.StringLiteral) { - var tokenText = token.text(); - if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === TypeScript.CharacterCodes.backslash) { - var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === TypeScript.CharacterCodes.doubleQuote - ? EndOfLineState.InDoubleQuoteStringLiteral - : EndOfLineState.InSingleQuoteStringLiteral; + lastToken = token; + + processToken(); + } + while (token !== SyntaxKind.EndOfFileToken); + + return result; + + + function onError(message: DiagnosticMessage): void { + inMultiLineComment = message.key === Diagnostics.Asterisk_Slash_expected.key; + } + + function processComment(start: number, end: number) { + // add Leading white spaces + addLeadingWhiteSpace(start, end); + + // add the comment + addResult(end - start, TokenClass.Comment); + } + + function processToken(): void { + var start = scanner.getTokenPos(); + var end = scanner.getTextPos(); + + // add Leading white spaces + addLeadingWhiteSpace(start, end); + + // add the token + addResult(end - start, classFromKind(token)); + + if (end >= text.length) { + // We're at the end. + if (inMultiLineComment) { + result.finalLexState = EndOfLineState.InMultiLineCommentTrivia; return; } + + if (token === SyntaxKind.StringLiteral) { + var tokenText = scanner.getTokenText(); + if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === CharacterCodes.backslash) { + var quoteChar = tokenText.charCodeAt(0); + result.finalLexState = quoteChar === CharacterCodes.doubleQuote + ? EndOfLineState.InDoubleQuoteStringLiteral + : EndOfLineState.InSingleQuoteStringLiteral; + return; + } + } } } - } - function processTriviaList(text: string, offset: number, triviaList: TypeScript.ISyntaxTriviaList, result: ClassificationResult): void { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - addResult(text, offset, result, trivia.fullWidth(), trivia.kind()); - } - } - - function addResult(text: string, offset: number, result: ClassificationResult, length: number, kind: TypeScript.SyntaxKind): void { - if (length > 0) { - // If this is the first classification we're adding to the list, then remove any - // offset we have if we were continuing a construct from the previous line. - if (result.entries.length === 0) { - length -= offset; + function addLeadingWhiteSpace(start: number, end: number): void { + if (start > lastTokenOrCommentEnd) { + addResult(start - lastTokenOrCommentEnd, TokenClass.Whitespace); } - result.entries.push({ length: length, classification: classFromKind(kind) }); + // Remeber the end of the last token + lastTokenOrCommentEnd = end; + } + + function addResult(length: number, classification: TokenClass): void { + if (length > 0) { + // If this is the first classification we're adding to the list, then remove any + // offset we have if we were continuing a construct from the previous line. + if (result.entries.length === 0) { + length -= offset; + } + + result.entries.push({ length: length, classification: classification }); + } } } - function classFromKind(kind: TypeScript.SyntaxKind) { - if (TypeScript.SyntaxFacts.isAnyKeyword(kind)) { + function isBinaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { + switch (tokenKind) { + case SyntaxKind.AsteriskToken: + case SyntaxKind.SlashToken: + case SyntaxKind.PercentToken: + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.LessThanLessThanToken: + case SyntaxKind.GreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.GreaterThanToken: + case SyntaxKind.LessThanEqualsToken: + case SyntaxKind.GreaterThanEqualsToken: + case SyntaxKind.InstanceOfKeyword: + case SyntaxKind.InKeyword: + case SyntaxKind.EqualsEqualsToken: + case SyntaxKind.ExclamationEqualsToken: + case SyntaxKind.EqualsEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsEqualsToken: + case SyntaxKind.AmpersandToken: + case SyntaxKind.CaretToken: + case SyntaxKind.BarToken: + case SyntaxKind.AmpersandAmpersandToken: + case SyntaxKind.BarBarToken: + case SyntaxKind.BarEqualsToken: + case SyntaxKind.AmpersandEqualsToken: + case SyntaxKind.CaretEqualsToken: + case SyntaxKind.LessThanLessThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case SyntaxKind.PlusEqualsToken: + case SyntaxKind.MinusEqualsToken: + case SyntaxKind.AsteriskEqualsToken: + case SyntaxKind.SlashEqualsToken: + case SyntaxKind.PercentEqualsToken: + case SyntaxKind.EqualsToken: + case SyntaxKind.CommaToken: + return true; + default: return false; + } + } + + function isPrefixUnaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { + switch (tokenKind) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + return true; + default: + return false; + } + } + + function classFromKind(kind: SyntaxKind) { + if (kind >= SyntaxKind.FirstKeyword && kind <= SyntaxKind.LastKeyword) { return TokenClass.Keyword; } - else if (TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(kind) || - TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken(kind)) { + else if (isBinaryExpressionOperatorToken(kind) || isPrefixUnaryExpressionOperatorToken(kind)) { return TokenClass.Operator; } - else if (TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { + else if (kind >= SyntaxKind.FirstPunctuation && kind <= SyntaxKind.LastPunctuation) { return TokenClass.Punctuation; } switch (kind) { - case TypeScript.SyntaxKind.WhitespaceTrivia: - return TokenClass.Whitespace; - case TypeScript.SyntaxKind.MultiLineCommentTrivia: - case TypeScript.SyntaxKind.SingleLineCommentTrivia: - return TokenClass.Comment; - case TypeScript.SyntaxKind.NumericLiteral: + case SyntaxKind.NumericLiteral: return TokenClass.NumberLiteral; - case TypeScript.SyntaxKind.StringLiteral: + case SyntaxKind.StringLiteral: return TokenClass.StringLiteral; - case TypeScript.SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.RegularExpressionLiteral: return TokenClass.RegExpLiteral; - case TypeScript.SyntaxKind.IdentifierName: + case SyntaxKind.Identifier: default: return TokenClass.Identifier; } From e515ca96974616feea84ae312dd0f6e58a60273e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 22:20:32 -0700 Subject: [PATCH 03/14] remove unused property --- src/harness/harnessLanguageService.ts | 9 ++------- src/services/services.ts | 5 ++++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 65f02582d63..09799f023e3 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -167,7 +167,6 @@ module Harness.LanguageService { } export class TypeScriptLS implements ts.LanguageServiceShimHost { private ls: ts.LanguageServiceShim = null; - public newLS: ts.LanguageService; private fileNameToScript: ts.Map = {}; @@ -268,12 +267,8 @@ module Harness.LanguageService { * To access the non-shim (i.e. actual) language service, use the "ls.languageService" property. */ public getLanguageService(): ts.LanguageServiceShim { - var ls = new TypeScript.Services.TypeScriptServicesFactory().createLanguageServiceShim(this); - this.ls = ls; - var hostAdapter = new LanguageServiceShimHostAdapter(this); - - this.newLS = ts.createLanguageService(hostAdapter, NonCachingDocumentRegistry.Instance); - return ls; + this.ls = new TypeScript.Services.TypeScriptServicesFactory().createLanguageServiceShim(this); + return this.ls; } /** Parse file given its source text */ diff --git a/src/services/services.ts b/src/services/services.ts index b11d8a91ec8..19845f86483 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2210,8 +2210,11 @@ module ts { export function createClassifier(host: Logger): Classifier { var scanner: Scanner; var noRegexTable: boolean[]; + /// We do not have a full parser support to know when we should parse a regex or not + /// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where + /// we have a series of divide operator. this list allows us to be more accurate by ruling out + /// locations where a regexp cannot exist. if (!noRegexTable) { noRegexTable = []; noRegexTable[SyntaxKind.Identifier] = true; noRegexTable[SyntaxKind.StringLiteral] = true; noRegexTable[SyntaxKind.NumericLiteral] = true; noRegexTable[SyntaxKind.RegularExpressionLiteral] = true; noRegexTable[SyntaxKind.ThisKeyword] = true; noRegexTable[SyntaxKind.PlusPlusToken] = true; noRegexTable[SyntaxKind.MinusMinusToken] = true; noRegexTable[SyntaxKind.CloseParenToken] = true; noRegexTable[SyntaxKind.CloseBracketToken] = true; noRegexTable[SyntaxKind.CloseBraceToken] = true; noRegexTable[SyntaxKind.TrueKeyword] = true; noRegexTable[SyntaxKind.FalseKeyword] = true; } - function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { var offset = 0; var lastTokenOrCommentEnd = 0; From 3fcd33ec32911f3970eada615a74b8962111384f Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 22:21:12 -0700 Subject: [PATCH 04/14] Enable clorizer unit tests --- src/harness/harnessLanguageService.ts | 5 + src/harness/runner.ts | 3 + src/harness/unittestrunner.ts | 10 +- .../cases/unittests/services/colorization.ts | 194 +++++++++--------- 4 files changed, 110 insertions(+), 102 deletions(-) diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 09799f023e3..9f08d809a7b 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -271,6 +271,11 @@ module Harness.LanguageService { return this.ls; } + /** Return a new instance of the classifier service shim */ + public getClassifier(): ts.ClassifierShim { + return new TypeScript.Services.TypeScriptServicesFactory().createClassifierShim(this); + } + /** Parse file given its source text */ public parseSourceText(fileName: string, sourceText: TypeScript.IScriptSnapshot): TypeScript.SourceUnitSyntax { return TypeScript.Parser.parse(fileName, TypeScript.SimpleText.fromScriptSnapshot(sourceText), ts.ScriptTarget.ES5, TypeScript.isDTSFile(fileName)).sourceUnit(); diff --git a/src/harness/runner.ts b/src/harness/runner.ts index 4e3cdc8815c..7ea996b24e6 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -99,6 +99,9 @@ if (runners.length === 0) { //// language services runners.push(new FourslashRunner()); //runners.push(new GeneratedFourslashRunner()); + + // unittests + runners.push(new UnitTestRunner(UnittestTestType.Services)); } sys.newLine = '\r\n'; diff --git a/src/harness/unittestrunner.ts b/src/harness/unittestrunner.ts index e08b835ac62..7b9019788e6 100644 --- a/src/harness/unittestrunner.ts +++ b/src/harness/unittestrunner.ts @@ -8,7 +8,7 @@ enum UnittestTestType { } class UnitTestRunner extends RunnerBase { - constructor(public testType?: UnittestTestType) { + constructor(public testType: UnittestTestType) { super(); } @@ -20,6 +20,9 @@ class UnitTestRunner extends RunnerBase { case UnittestTestType.LanguageService: this.tests = this.enumerateFiles('tests/cases/unittests/ls'); break; + case UnittestTestType.Services: + this.tests = this.enumerateFiles('tests/cases/unittests/services', /colorization.ts/); + break; default: if (this.tests.length === 0) { throw new Error('Unsupported test cases: ' + this.testType); @@ -38,7 +41,7 @@ class UnitTestRunner extends RunnerBase { }); harnessCompiler.addInputFiles(toBeAdded); harnessCompiler.setCompilerOptions({ noResolve: true }); - + var stdout = new Harness.Compiler.EmitterIOHost(); var emitDiagnostics = harnessCompiler.emitAll(stdout); var results = stdout.toArray(); @@ -59,7 +62,8 @@ class UnitTestRunner extends RunnerBase { before: before, after: after, Harness: Harness, - IO: Harness.IO + IO: Harness.IO, + ts:ts // FourSlash: FourSlash }; } diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index d1997139b89..157c31fbec7 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -1,198 +1,194 @@ -/// - -interface Classification { +interface Classification { length: number; - class2: TypeScript.TokenClass; + class: ts.TokenClass; } interface ClassiferResult { tuples: Classification[]; - finalLexState: TypeScript.LexState; + finalEndOfLineState: ts.EndOfLineState; } var TokenClassNames = {}; -TokenClassNames[TypeScript.TokenClass.Punctuation] = "Punctuation"; -TokenClassNames[TypeScript.TokenClass.Keyword] = "Keyword"; -TokenClassNames[TypeScript.TokenClass.Operator] = "Operator"; -TokenClassNames[TypeScript.TokenClass.Comment] = "Comment"; -TokenClassNames[TypeScript.TokenClass.Whitespace] = "Whitespace"; -TokenClassNames[TypeScript.TokenClass.Identifier] = "Identifier"; -TokenClassNames[TypeScript.TokenClass.NumberLiteral] = "NumberLiteral"; -TokenClassNames[TypeScript.TokenClass.StringLiteral] = "StringLiteral"; -TokenClassNames[TypeScript.TokenClass.RegExpLiteral] = "RegExpLiteral"; +TokenClassNames[ts.TokenClass.Punctuation] = "Punctuation"; +TokenClassNames[ts.TokenClass.Keyword] = "Keyword"; +TokenClassNames[ts.TokenClass.Operator] = "Operator"; +TokenClassNames[ts.TokenClass.Comment] = "Comment"; +TokenClassNames[ts.TokenClass.Whitespace] = "Whitespace"; +TokenClassNames[ts.TokenClass.Identifier] = "Identifier"; +TokenClassNames[ts.TokenClass.NumberLiteral] = "NumberLiteral"; +TokenClassNames[ts.TokenClass.StringLiteral] = "StringLiteral"; +TokenClassNames[ts.TokenClass.RegExpLiteral] = "RegExpLiteral"; -describe('Colorization', function() { - var mytypescriptLS = new Harness.TypeScriptLS(); - var myls = mytypescriptLS.getLanguageService(); - - var myclassifier = new Services.ClassifierShim(myls.host); - - function getClassifications(code: string, initialLexState?: TypeScript.LexState = TypeScript.LexState.Start): ClassiferResult { - var classResult = myclassifier.getClassificationsForLine(code, initialLexState).split('\n'); +describe('Colorization', function () { + var mytypescriptLS = new Harness.LanguageService.TypeScriptLS(); + var myclassifier = mytypescriptLS.getClassifier(); + + function getClassifications(code: string, initialEndOfLineState: ts.EndOfLineState = ts.EndOfLineState.Start): ClassiferResult { + var classResult = myclassifier.getClassificationsForLine(code, initialEndOfLineState).split('\n'); var tuples: Classification[] = []; var i = 0; for (; i < classResult.length - 1; i += 2) { tuples[i / 2] = { length: parseInt(classResult[i]), - class2: parseInt(classResult[i + 1]) + class: parseInt(classResult[i + 1]) }; } - var finalLexState = classResult[classResult.length - 1]; + var finalEndOfLineState = classResult[classResult.length - 1]; return { tuples: tuples, - finalLexState: parseInt(finalLexState) + finalEndOfLineState: parseInt(finalEndOfLineState) }; } function verifyClassification(classification: Classification, expectedLength: number, expectedClass: number) { - assert.notNull(classification); - assert.is(classification.length === expectedLength, "Classification length does not match expected. Expected: " + expectedLength + ", Actual: " + classification.length); - assert.is(classification.class2 === expectedClass, "Classification class does not match expected. Expected: " + TokenClassNames[expectedClass] + ", Actual: " + TokenClassNames[classification.class2]); + assert.isNotNull(classification); + assert.equal(classification.length, expectedLength, "Classification length does not match expected. Expected: " + expectedLength + ", Actual: " + classification.length); + assert.equal(classification.class, expectedClass, "Classification class does not match expected. Expected: " + TokenClassNames[expectedClass] + ", Actual: " + TokenClassNames[classification.class]); } - - describe("test cases for colorization", function() { + + describe("test cases for colorization", function () { var results = getClassifications('var x:string = "foo"; //Hello'); - it("checks for a keyword", function() { - verifyClassification(results.tuples[0], 3, TypeScript.TokenClass.Keyword); + it("checks for a keyword", function () { + verifyClassification(results.tuples[0], 3, ts.TokenClass.Keyword); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[1], 4, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); }); - it("checks for a identifier", function() { - verifyClassification(results.tuples[2], 5, TypeScript.TokenClass.Identifier); + it("checks for a identifier", function () { + verifyClassification(results.tuples[2], 1, ts.TokenClass.Identifier); }); - it("checks for an punctuation", function() { - verifyClassification(results.tuples[3], 6, TypeScript.TokenClass.Punctuation); - }); - - it("checks for a operator", function() { - verifyClassification(results.tuples[6], 14, TypeScript.TokenClass.Operator); + it("checks for an punctuation", function () { + verifyClassification(results.tuples[3], 1, ts.TokenClass.Punctuation); }); - it("checks for a string literal", function() { - verifyClassification(results.tuples[8], 20, TypeScript.TokenClass.StringLiteral); + it("checks for a operator", function () { + verifyClassification(results.tuples[6], 1, ts.TokenClass.Operator); }); - it("checks for a comment", function() { - verifyClassification(results.tuples[11], 29, TypeScript.TokenClass.Comment); + it("checks for a string literal", function () { + verifyClassification(results.tuples[8], 5, ts.TokenClass.StringLiteral); + }); + + it("checks for a comment", function () { + verifyClassification(results.tuples[11], 7, ts.TokenClass.Comment); }); }); - describe("test comment colorization after a divide operator", function() { + describe("test comment colorization after a divide operator", function () { var results = getClassifications('1 / 1 // comment'); - it("checks for a number literal", function() { - verifyClassification(results.tuples[0], 1, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[0], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[1], 2, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); }); - it("checks for a operator", function() { - verifyClassification(results.tuples[2], 3, TypeScript.TokenClass.Operator); + it("checks for a operator", function () { + verifyClassification(results.tuples[2], 1, ts.TokenClass.Operator); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[3], 4, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[3], 1, ts.TokenClass.Whitespace); }); - it("checks for a number literal", function() { - verifyClassification(results.tuples[4], 5, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[4], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[5], 6, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[5], 1, ts.TokenClass.Whitespace); }); - it("checks for a comment", function() { - verifyClassification(results.tuples[6], 16, TypeScript.TokenClass.Comment); + it("checks for a comment", function () { + verifyClassification(results.tuples[6], 10, ts.TokenClass.Comment); }); }); - describe("test literal colorization after a divide operator", function() { + describe("test literal colorization after a divide operator", function () { var results = getClassifications('1 / 2, 1 / 2'); - it("checks for a number literal", function() { - verifyClassification(results.tuples[0], 1, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[0], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[1], 2, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); }); - it("checks for a operator", function() { - verifyClassification(results.tuples[2], 3, TypeScript.TokenClass.Operator); + it("checks for a operator", function () { + verifyClassification(results.tuples[2], 1, ts.TokenClass.Operator); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[3], 4, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[3], 1, ts.TokenClass.Whitespace); }); - it("checks for a number literal", function() { - verifyClassification(results.tuples[4], 5, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[4], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a operator", function() { - verifyClassification(results.tuples[5], 6, TypeScript.TokenClass.Operator); + it("checks for a operator", function () { + verifyClassification(results.tuples[5], 1, ts.TokenClass.Operator); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[6], 7, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[6], 1, ts.TokenClass.Whitespace); }); - it("checks for a number literal", function() { - verifyClassification(results.tuples[7], 8, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[7], 1, ts.TokenClass.NumberLiteral); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[8], 9, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[8], 1, ts.TokenClass.Whitespace); }); - it("checks for a operator", function() { - verifyClassification(results.tuples[9], 10, TypeScript.TokenClass.Operator); + it("checks for a operator", function () { + verifyClassification(results.tuples[9], 1, ts.TokenClass.Operator); }); - it("checks for a whitespace", function() { - verifyClassification(results.tuples[10], 11, TypeScript.TokenClass.Whitespace); + it("checks for a whitespace", function () { + verifyClassification(results.tuples[10], 1, ts.TokenClass.Whitespace); }); - it("checks for a number literal", function() { - verifyClassification(results.tuples[11], 12, TypeScript.TokenClass.NumberLiteral); + it("checks for a number literal", function () { + verifyClassification(results.tuples[11], 1, ts.TokenClass.NumberLiteral); }); }); - describe("test cases for colorizing multi-line string", function() { - it("classifies first line correctelly", function() { - var results = getClassifications("'line1\\\n", TypeScript.LexState.Start); + describe("test cases for colorizing multi-line string", function () { + it("classifies first line correctelly", function () { + var results = getClassifications("'line1\\", ts.EndOfLineState.Start); assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 8, TypeScript.TokenClass.StringLiteral); - assert.equal(results.finalLexState, TypeScript.LexState.InMultilineSingleQuoteString); + verifyClassification(results.tuples[0], 7, ts.TokenClass.StringLiteral); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InSingleQuoteStringLiteral); }); - it("classifies second line correctelly", function() { - var results = getClassifications("\\\n", TypeScript.LexState.InMultilineSingleQuoteString); + it("classifies second line correctelly", function () { + var results = getClassifications("\\", ts.EndOfLineState.InDoubleQuoteStringLiteral); assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 2, TypeScript.TokenClass.StringLiteral); - assert.equal(results.finalLexState, TypeScript.LexState.InMultilineSingleQuoteString); + verifyClassification(results.tuples[0], 1, ts.TokenClass.StringLiteral); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InDoubleQuoteStringLiteral); }); - it("classifies third line correctelly", function() { - var results = getClassifications("'", TypeScript.LexState.InMultilineSingleQuoteString); + it("classifies third line correctelly", function () { + var results = getClassifications("'", ts.EndOfLineState.InSingleQuoteStringLiteral); assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 1, TypeScript.TokenClass.StringLiteral); - assert.equal(results.finalLexState, TypeScript.LexState.Start); + verifyClassification(results.tuples[0], 1, ts.TokenClass.StringLiteral); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); }); }); }); \ No newline at end of file From 05d2e75e7cb4ff20581ec66dba66b3fe8742b6ae Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 22:27:03 -0700 Subject: [PATCH 05/14] delete unused tests --- .../unittests/compiler/callSignatureTests.ts | 27 - .../unittests/compiler/classOverloads.ts | 128 --- .../compiler/constructSignatureTests.ts | 26 - .../unittests/compiler/declarationTests.ts | 52 - .../compiler/functionSignaturesTests.ts | 25 - tests/cases/unittests/compiler/identifiers.ts | 13 - tests/cases/unittests/compiler/moduleAlias.ts | 14 - tests/cases/unittests/compiler/pathing.ts | 50 - .../compiler/propertySignatureTests.ts | 19 - tests/cases/unittests/services/_project.ts | 4 - .../services/baselines/baseline-accept.ts | 20 - .../services/baselines/baseline-create.ts | 66 -- .../inputs/getCompletionsAtPosition1.ts | 23 - .../baselines/inputs/optionsParser.ts | 215 ----- ...ompletionsAtPosition1.str-completions.json | 2 - ...ompletionsAtPosition1.str-definitions.json | 2 - ...getCompletionsAtPosition1.str-members.json | 2 - ...CompletionsAtPosition1.str-signatures.json | 2 - .../getCompletionsAtPosition1.str-types.json | 2 - .../optionsParser.str-completions.json | 1 - .../optionsParser.str-definitions.json | 1 - .../reference/optionsParser.str-members.json | 1 - .../optionsParser.str-signatures.json | 2 - .../reference/optionsParser.str-types.json | 1 - tests/cases/unittests/services/dumpAST.ts | 3 - .../services/dumpAST/baseline-create.ts | 9 - .../services/getCompletionsAtPosition.ts | 220 ----- .../getCompletionsAtPositionAfterEdits.ts | 55 -- .../getCompletionsAtPositionObjectLiterals.ts | 100 -- .../getDefinitionPositionAtPosition.ts | 193 ---- ...itionPositionAtPositionPartialInterface.ts | 29 - .../services/getImplementorsAtPosition.ts | 73 -- .../services/getReferencesAtPosition.ts | 188 ---- .../services/getReferencesAtPosition2.ts | 235 ----- .../services/getScriptLexicalStructure.ts | 904 ------------------ .../services/getSignatureAtPosition.ts | 493 ---------- .../unittests/services/incrementalParser.ts | 103 -- .../unittests/services/overridesCollector.ts | 82 -- .../testCode/getBraceMatchingAtPosition.ts | 27 - .../testCode/getCompletionsAtPosition1.ts | 23 - .../testCode/getCompletionsAtPosition10.ts | 5 - .../testCode/getCompletionsAtPosition2.ts | 12 - .../testCode/getCompletionsAtPosition3.ts | 2 - .../testCode/getCompletionsAtPosition4.ts | 4 - .../testCode/getCompletionsAtPosition5.ts | 3 - .../testCode/getCompletionsAtPosition6.ts | 1 - .../testCode/getCompletionsAtPosition7.ts | 1 - .../testCode/getCompletionsAtPosition8.ts | 1 - .../testCode/getCompletionsAtPosition9.ts | 10 - .../getCompletionsAtPositionAfterEdits.ts | 8 - .../getCompletionsAtPositionBugFixes.ts | 16 - .../getCompletionsAtPositionObjectLiterals.ts | 33 - .../testCode/getDefinitionsAtPosition.ts | 91 -- .../testCode/getDefinitionsAtPosition2.ts | 6 - .../testCode/getDefinitionsAtPosition3.ts | 5 - ...tDefinitionsAtPositionPartialInterface1.ts | 5 - ...tDefinitionsAtPositionPartialInterface2.ts | 9 - .../testCode/getImplementorsAtPosition.ts | 57 -- .../testCode/getReferencesAtPositionTest.ts | 117 --- .../testCode/getReferencesAtPositionTest2.ts | 59 -- .../testCode/getReferencesAtPositionTest3.ts | 70 -- .../testCode/getReferencesAtPositionTest4.ts | 28 - .../testCode/getScriptLexicalStructure.ts | 112 --- .../testCode/getSignatureAtPositionTest.ts | 85 -- .../testCode/getSignatureAtPositionTestEOF.ts | 5 - .../testCode/getSmartIndentAtLineNumber.ts | 132 --- .../testCode/getSmartIndentAtLineNumber2.ts | 8 - .../testCode/getSmartIndentAtLineNumber3.ts | 6 - .../services/testCode/incrementalParser.ts | 24 - .../services/testCode/incrementalParser2.ts | 5 - .../services/testCode/overridesCollector.ts | 57 -- .../testCode/references/classLocal.ts | 19 - .../testCode/references/classParameter.ts | 18 - .../services/testCode/references/comment.ts | 4 - .../testCode/references/functionOverloads.ts | 6 - .../testCode/references/functionParameter.ts | 7 - .../services/testCode/references/globals.ts | 23 - .../testCode/references/illegalAssignment1.ts | 2 - .../testCode/references/illegalAssignment2.ts | 4 - .../services/testCode/references/noContext.ts | 20 - .../testCode/references/referenceToClass.ts | 17 - .../services/testCode/references/static.ts | 28 - 82 files changed, 4560 deletions(-) delete mode 100644 tests/cases/unittests/compiler/callSignatureTests.ts delete mode 100644 tests/cases/unittests/compiler/classOverloads.ts delete mode 100644 tests/cases/unittests/compiler/constructSignatureTests.ts delete mode 100644 tests/cases/unittests/compiler/declarationTests.ts delete mode 100644 tests/cases/unittests/compiler/functionSignaturesTests.ts delete mode 100644 tests/cases/unittests/compiler/identifiers.ts delete mode 100644 tests/cases/unittests/compiler/moduleAlias.ts delete mode 100644 tests/cases/unittests/compiler/pathing.ts delete mode 100644 tests/cases/unittests/compiler/propertySignatureTests.ts delete mode 100644 tests/cases/unittests/services/_project.ts delete mode 100644 tests/cases/unittests/services/baselines/baseline-accept.ts delete mode 100644 tests/cases/unittests/services/baselines/baseline-create.ts delete mode 100644 tests/cases/unittests/services/baselines/inputs/getCompletionsAtPosition1.ts delete mode 100644 tests/cases/unittests/services/baselines/inputs/optionsParser.ts delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-completions.json delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-definitions.json delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-members.json delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-signatures.json delete mode 100644 tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-types.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-completions.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-definitions.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-members.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-signatures.json delete mode 100644 tests/cases/unittests/services/baselines/reference/optionsParser.str-types.json delete mode 100644 tests/cases/unittests/services/dumpAST.ts delete mode 100644 tests/cases/unittests/services/dumpAST/baseline-create.ts delete mode 100644 tests/cases/unittests/services/getCompletionsAtPosition.ts delete mode 100644 tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts delete mode 100644 tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts delete mode 100644 tests/cases/unittests/services/getDefinitionPositionAtPosition.ts delete mode 100644 tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts delete mode 100644 tests/cases/unittests/services/getImplementorsAtPosition.ts delete mode 100644 tests/cases/unittests/services/getReferencesAtPosition.ts delete mode 100644 tests/cases/unittests/services/getReferencesAtPosition2.ts delete mode 100644 tests/cases/unittests/services/getScriptLexicalStructure.ts delete mode 100644 tests/cases/unittests/services/getSignatureAtPosition.ts delete mode 100644 tests/cases/unittests/services/incrementalParser.ts delete mode 100644 tests/cases/unittests/services/overridesCollector.ts delete mode 100644 tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts delete mode 100644 tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts delete mode 100644 tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts delete mode 100644 tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts delete mode 100644 tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts delete mode 100644 tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts delete mode 100644 tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts delete mode 100644 tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts delete mode 100644 tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts delete mode 100644 tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts delete mode 100644 tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts delete mode 100644 tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts delete mode 100644 tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts delete mode 100644 tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts delete mode 100644 tests/cases/unittests/services/testCode/incrementalParser.ts delete mode 100644 tests/cases/unittests/services/testCode/incrementalParser2.ts delete mode 100644 tests/cases/unittests/services/testCode/overridesCollector.ts delete mode 100644 tests/cases/unittests/services/testCode/references/classLocal.ts delete mode 100644 tests/cases/unittests/services/testCode/references/classParameter.ts delete mode 100644 tests/cases/unittests/services/testCode/references/comment.ts delete mode 100644 tests/cases/unittests/services/testCode/references/functionOverloads.ts delete mode 100644 tests/cases/unittests/services/testCode/references/functionParameter.ts delete mode 100644 tests/cases/unittests/services/testCode/references/globals.ts delete mode 100644 tests/cases/unittests/services/testCode/references/illegalAssignment1.ts delete mode 100644 tests/cases/unittests/services/testCode/references/illegalAssignment2.ts delete mode 100644 tests/cases/unittests/services/testCode/references/noContext.ts delete mode 100644 tests/cases/unittests/services/testCode/references/referenceToClass.ts delete mode 100644 tests/cases/unittests/services/testCode/references/static.ts diff --git a/tests/cases/unittests/compiler/callSignatureTests.ts b/tests/cases/unittests/compiler/callSignatureTests.ts deleted file mode 100644 index 7b921d244eb..00000000000 --- a/tests/cases/unittests/compiler/callSignatureTests.ts +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\callSignatureTests.ts', function () { - it("If a signature omits a return type annotation, any type is assumed", function () { - var code = 'var foo: {();};'; - code += 'var test = foo();' - code += 'test.bar = 2;' - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("A call signature can have the void return type", function () { - var code = 'var foo: {():void;};'; - code += 'var test = foo();' - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("A call signature can't have the same overload", function () { - var code = 'var foo: { (): string; (): string; };'; - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/compiler/classOverloads.ts b/tests/cases/unittests/compiler/classOverloads.ts deleted file mode 100644 index a1d00f8bd8e..00000000000 --- a/tests/cases/unittests/compiler/classOverloads.ts +++ /dev/null @@ -1,128 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\classOverloads.ts', function () { - it("Everytype is a subtype of itself", function () { - var code = 'class foo { public bar: number; }'; - code += 'class bar extends foo { public bar: number; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("All types except the Void type are subtypes of the Any type", function () { - var code = 'class foo { public bar: any; }'; - code += 'class bar extends foo { public bar: number; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("All types are subtypes of the Any type - 2", function () { - var code = 'class baz { public bar(): any { return 1; } }'; - code += 'class foo extends baz { public bar(): void {} }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("The Undefined type is a subtype of all types except the Void type", function () { - var code = 'class baz { public bar(): any { return 1 } }'; - code += 'class foo extends baz { public bar(){ return undefined} }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("The Undefined type is a subtype of all types except the Void type - 2", function () { - var code = 'class baz { public bar(): void { } }'; - code += 'class foo extends baz { public bar(){ return undefined} }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("The Null type is a subtype of all types, except the Undefined and Void types", function () { - var code = 'class baz { public bar:any; }'; - code += 'class foo extends baz { public bar = null; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("The Null type is a subtype of all types, except the Undefined and Void types - 3", function () { - var code = 'class baz { public bar():void { } }'; - code += 'class foo extends baz { public bar() { return null; } }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - describe('An object type S is a subtype of an object type T', function () { - it("A property in T is matched by a property in S", function () { - var code = 'class baz { public bar: { a: string; }; }'; - code += 'class foo extends baz { public bar: { a: number; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - it("A property in T is matched by a property in S - 2", function () { - var code = 'class baz { public bar: { a: string; }; }'; - code += 'class foo extends baz { public bar: { a: string; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("A property in T is matched by a property in S - 3", function () { - var code = 'class baz { public bar: { a: string; }; }'; - code += 'class foo extends baz { public bar: { b: string; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature", function () { - var code = 'class baz { public bar: { (); }; }'; - code += 'class foo extends baz { public bar: { (); } ;}'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature - 2", function () { - var code = 'class baz { public bar: { [idx:number]: any; }; }'; - code += 'class foo extends baz { public bar: { (); }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature - 3", function () { - var code = 'class baz { public bar: { (a: string); }; }'; - code += 'class foo extends baz { public bar: { (); }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature - 4", function () { - var code = 'class baz { public bar: { (a:string); }; }'; - code += 'class foo extends baz { public bar: { (a:string,b:string); }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - it("A call, construct or index signature in T is matched by a call, construct or index signature - 5", function () { - var code = 'class baz { public bar: { ():void; }; }'; - code += 'class foo extends baz { public bar: { ():void; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - - it("A call, construct or index signature in T is matched by a call, construct or index signature - 6", function () { - var code = 'class baz { public bar: { (); }; }'; - code += 'class foo extends baz { public bar: { ():void; }; }'; - Harness.Compiler.compileString(code, 'subtypes', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - }); -}); - diff --git a/tests/cases/unittests/compiler/constructSignatureTests.ts b/tests/cases/unittests/compiler/constructSignatureTests.ts deleted file mode 100644 index d4fe15dbe5e..00000000000 --- a/tests/cases/unittests/compiler/constructSignatureTests.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// -/// - -describe('Compiling tests\\compiler\\constructSignatureTests.ts', function () { - it("If a signature omits a return type annotation, any type is assumed", function () { - var code = 'var foo: {new ();};'; - code += 'var test = new foo();' - code += 'test.bar = 2;' - Harness.Compiler.compileString(code, 'construct signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); - it("A call signature can have the void return type", function () { - var code = 'var foo: {new ():void;};'; - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 1); - }); - }); - - it("A construct signature can't have the same overload", function () { - var code = 'var foo: { new (): string; new (): string; };'; - Harness.Compiler.compileString(code, 'call signatures', function (result) { - assert.equal(result.errors.length, 0); - }); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/compiler/declarationTests.ts b/tests/cases/unittests/compiler/declarationTests.ts deleted file mode 100644 index 6685a63b590..00000000000 --- a/tests/cases/unittests/compiler/declarationTests.ts +++ /dev/null @@ -1,52 +0,0 @@ -/// -/// - -//@tags 1.1 Declarations - -describe('Compiling unittests\\compiler\\declarationTests.ts', function() { - it("Each internal module’s export declaration spaces are shared with other internal modules that have the same root module and the " + - "same qualified name starting from that root module", function() { - var code = 'module baz{export var foo;}'; - code += 'module baz{export var bar;}' - code += 'baz.foo = baz.bar;' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - it("Each object type literal has a declaration space for its members", function() { - var code = 'var foo:{a:number;};'; - code += 'foo.a = 2;' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - it("Each class declaration has a declaration space for members and a declaration space for statics", function() { - var code = 'class foo {'; - code += ' static bar;' - code += ' public bar;' - code += '}' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - it("Each function declaration (including member function declarations and static function declarations) has a declaration space for " + - "statics and a declaration space for locals (parameters, variables, and functions).", function() { - var code = 'function foo() {'; - code += ' static bar;' - code += ' var bar;' - code += '}' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 1); - }); - }); - it("Modules contain separate declaration spaces for variables and types.", function() { - var code = 'module M {'; - code += ' class bar {};' - code += ' var bar;' - code += '}' - Harness.Compiler.compileString(code, 'declarations', function(result) { - assert.equal(result.errors.length, 1); - }); - }); -}); - diff --git a/tests/cases/unittests/compiler/functionSignaturesTests.ts b/tests/cases/unittests/compiler/functionSignaturesTests.ts deleted file mode 100644 index 5dd62dbb359..00000000000 --- a/tests/cases/unittests/compiler/functionSignaturesTests.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\functionSignatureTests.ts', function() { - it('Check overload with different return types.', function(){ - var code = 'var foo: { bar(): string; bar(): number; };\n'; - code += 'var bar: { bar: { (): string; (): number; }; };'; - code += 'foo = bar;'; - Harness.Compiler.compileString(code, 'function signatures', function(result) { - assert.equal(result.errors.length, 0); - }); - }) - - describe('Function Type Literals', function() { - it('Basic sanity check', function() { - var code = 'var foo: { (): string; };'; - code += 'var bar: () => string;'; - code += 'foo = bar;'; - Harness.Compiler.compileString(code, 'function type literal', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - }); -}); - diff --git a/tests/cases/unittests/compiler/identifiers.ts b/tests/cases/unittests/compiler/identifiers.ts deleted file mode 100644 index 175d9c9c77d..00000000000 --- a/tests/cases/unittests/compiler/identifiers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -/// - -describe('Compiling tests\\compiler\\identifiers.ts', function() { - it("Everytype is a subtype of itself", function() { - var code = 'class foo { public bar: number; }'; - code += 'class bar extends foo { public bar: number; }'; - Harness.Compiler.compileString(code, 'subtypes', function(result) { - assert.equal(result.errors.length, 0); - }); - }); -}); - diff --git a/tests/cases/unittests/compiler/moduleAlias.ts b/tests/cases/unittests/compiler/moduleAlias.ts deleted file mode 100644 index a1281549559..00000000000 --- a/tests/cases/unittests/compiler/moduleAlias.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\moduleAlias.ts', function() { - describe('Internal module alias test', function() { - it("basic test", function() { - var code = "module A.B.C { import XYZ = X.Y.Z; export function ping(x: number) { if (x > 0) XYZ.pong(x-1);}};"; - code += "module X.Y.Z { import ABC = A.B.C; export function pong(x: number) { if (x > 0) ABC.ping(x-1);}};"; - Harness.Compiler.compileString(code, 'module alias', function(result) { - assert.equal(result.errors.length, 0); - }); - }); - }); -}); diff --git a/tests/cases/unittests/compiler/pathing.ts b/tests/cases/unittests/compiler/pathing.ts deleted file mode 100644 index 05a33494af2..00000000000 --- a/tests/cases/unittests/compiler/pathing.ts +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// - -describe('Verifying pathing functions', function () { - it("Normalizes Mac paths", function () { - var result = TypeScript.normalizePath("/Users/Me/somefile.ts"); - var expected = "/Users/Me/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes relative Mac paths", function () { - var result = TypeScript.normalizePath("/Users/./Me/../somefile.ts"); - var expected = "/Users/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes Windows paths", function () { - var result = TypeScript.normalizePath("C:\\Users\\Me\\somefile.ts"); - var expected = "C:/Users/Me/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes relative Windows paths", function () { - var result = TypeScript.normalizePath("C:\\Users\\.\\Me\\..\\somefile.ts"); - var expected = "C:/Users/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes . and ..", function () { - var result = TypeScript.normalizePath("..\\Users\\.\\Me\\..\\somefile.ts"); - var expected = "../Users/somefile.ts"; - assert.equal(result, expected); - }); - it("Normalizes UNC paths", function () { - var result = TypeScript.normalizePath("\\\\server\\share\\someFile.ts"); - var expected = "file://server/share/someFile.ts"; - assert.equal(result, expected); - }); - it("Normalizes relative UNC paths with IP addresses", function () { - var result = TypeScript.normalizePath("\\\\127.0.0.1\\share\\..\\elsewhere\\someFile.ts"); - var expected = "file://127.0.0.1/elsewhere/someFile.ts"; - assert.equal(result, expected); - }); - it("Normalizes HTTP paths", function () { - var result = TypeScript.normalizePath("http://www.server.com/share/someFile.ts"); - var expected = "http://www.server.com/share/someFile.ts"; - assert.equal(result, expected); - }); - it("Normalizes relative HTTP paths", function () { - var result = TypeScript.normalizePath("http://www.server.com/share/../someFile.ts"); - var expected = "http://www.server.com/someFile.ts"; - assert.equal(result, expected); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/compiler/propertySignatureTests.ts b/tests/cases/unittests/compiler/propertySignatureTests.ts deleted file mode 100644 index 98e87d5be36..00000000000 --- a/tests/cases/unittests/compiler/propertySignatureTests.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// -/// - -describe('Compiling unittests\\compiler\\propertySignatureTests.ts', function() { - it('The Identifier of a property signature must be unique within its containing type. ', function(){ - var code = 'var foo: { a:string; a: string; };'; - Harness.Compiler.compileString(code, 'property signatures', function(result) { - assert.equal(result.errors.length, 1); - //assert.compilerWarning(result, 1, 9, 'Duplicate identifier a'); - }); - }); - - it('If a property signature omits a TypeAnnotation, the Any type is assumed.', function(){ - var code = 'var foo: { a; }; foo.a = 2; foo.a = "0";'; - Harness.Compiler.compileString(code, 'property signatures', function(result) { - assert.equal(result.errors.length, 0); - }); - }) -}); \ No newline at end of file diff --git a/tests/cases/unittests/services/_project.ts b/tests/cases/unittests/services/_project.ts deleted file mode 100644 index e95a8a082ec..00000000000 --- a/tests/cases/unittests/services/_project.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -/// -/// -/// diff --git a/tests/cases/unittests/services/baselines/baseline-accept.ts b/tests/cases/unittests/services/baselines/baseline-accept.ts deleted file mode 100644 index fcd0f5c021a..00000000000 --- a/tests/cases/unittests/services/baselines/baseline-accept.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// -/// -declare var JSON: any; - -describe('Accepting local files as new reference...', function() { - var localPath = 'tests/services/baselines/local'; - var outputPath = 'tests/services/baselines/reference'; - - // Get a list of all the files in the baseline/inputs folder - var files = IO.dir(localPath); - - // Copy them to the output folder - for (var i = 0; i < files.length; i++) { - var filename = files[i].substr(files[i].lastIndexOf('\\')); - if(filename.indexOf('.html') === -1) { - var referenceData = IO.readFile(files[i]); - IO.writeFile(outputPath + '/' + filename, referenceData); - } - } -}); diff --git a/tests/cases/unittests/services/baselines/baseline-create.ts b/tests/cases/unittests/services/baselines/baseline-create.ts deleted file mode 100644 index f4bb89649a5..00000000000 --- a/tests/cases/unittests/services/baselines/baseline-create.ts +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// -/// - -describe('Baseline files match (intellisense data)', function() { - var inputPath = 'tests/services/baselines/inputs'; - var outputPath = 'tests/services/baselines/local'; - var referencePath = 'tests/services/baselines/reference'; - - var i; - - // Might need to create this - IO.createDirectory(outputPath); - - // Delete any old reports from the local path - var localFiles = IO.dir(outputPath); - for (i = 0; i < localFiles.length; i++) { - var localFilename = localFiles[i]; - if(localFilename.indexOf('.html') > 0) { - IO.deleteFile(localFilename); - } - } - - // Get a list of all the files in the baseline/inputs folder - var files = IO.dir(inputPath); - - var template = IO.readFile('tests/services/baselines/diff-template.html'); - - // For each file, get data: - // a) Completion - // b) Type signature - // c) etc... - for (i = 0; i < files.length; i++) { - var filename = files[i].substr(files[i].lastIndexOf('\\')); - var scriptText = IO.readFile(files[i]).trim(); - - var outputAndCheck = function(nameSuffix: string, process: any) { - describe(nameSuffix + ' data for ' + filename + ' matches the baseline', function() { - var data = process(scriptText); - var stringified = JSON.stringify(data).trim(); - - var baseFilename = filename + '-' + nameSuffix + '.json'; - IO.writeFile(outputPath + '/' + baseFilename, stringified); - - var referenceFilename = referencePath + '/' + baseFilename; - var reference = IO.fileExists(referenceFilename) ? IO.readFile(referenceFilename) : '[{file: "(no file)"}]'; - reference = reference.trim(); - - if (reference != stringified) { - // Emit a report file in 'local' - var errorReportFile = outputPath + filename + '-' + nameSuffix + '-diff.html'; - IO.writeFile(errorReportFile, - template.replace('/**REFERENCE**/', reference).replace('/**ACTUAL**/', stringified)); - throw new Error('Data does not match reference. Refer to diff report ' + errorReportFile); - } - }); - }; - - // Write that data out to a JSON file in the 'local' folder - outputAndCheck('signatures', getIntellisenseSignatureRegions); - outputAndCheck('completions', getIntellisenseCompletionListRegions); - outputAndCheck('definitions', getIntellisenseDefinitionRegions); - outputAndCheck('types', getIntellisenseTypeRegions); - outputAndCheck('members', getIntellisenseMemberListRegions); - } -}); diff --git a/tests/cases/unittests/services/baselines/inputs/getCompletionsAtPosition1.ts b/tests/cases/unittests/services/baselines/inputs/getCompletionsAtPosition1.ts deleted file mode 100644 index 837c5dbf6fd..00000000000 --- a/tests/cases/unittests/services/baselines/inputs/getCompletionsAtPosition1.ts +++ /dev/null @@ -1,23 +0,0 @@ -module Foo { var testing = ""; test } - -class C1 { - public pubMeth() {this.} // test on 'this.' - private privMeth() {} - public pubProp; - private privProp; -} - -var f = new C1(); -f. // test on F. -module M { - export class C { public pub; private priv; } - export var V = 0; -} - - -var c = new M.C(); - -c. // test on c. - -//Test for comment -//c. \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/inputs/optionsParser.ts b/tests/cases/unittests/services/baselines/inputs/optionsParser.ts deleted file mode 100644 index 5d81a651971..00000000000 --- a/tests/cases/unittests/services/baselines/inputs/optionsParser.ts +++ /dev/null @@ -1,215 +0,0 @@ -interface IOptions { - name: string; - flag: boolean; - short: string; - usage: string; - set: (s: string) => void; - type: string; -} - -class OptionsParser { - private DEFAULT_SHORT_FLAG = "-"; - private DEFAULT_LONG_FLAG = "--"; - - constructor (private host: IIO) { } - - // Find the option record for the given string. Returns null if not found. - private findOption(arg: string) { - - for (var i = 0; i < this.options.length; i++) { - - if (arg === this.options[i].short || arg === this.options[i].name) { - return this.options[i]; - } - } - - return null; - } - - public unnamed: string[] = []; - - public options: IOptions[] = []; - - public printUsage() { - IO.printLine("Syntax: tsc [options] [file ..]"); - IO.printLine(""); - IO.printLine("Examples: tsc hello.ts"); - IO.printLine(" tsc --out foo.js foo.ts"); - IO.printLine(" tsc @args.txt"); - IO.printLine(""); - IO.printLine("Options:"); - - var output = []; - var maxLength = 0; - - this.options = this.options.sort(function(a, b) { - var aName = a.name.toLowerCase(); - var bName = b.name.toLowerCase(); - - if (aName > bName) { - return 1; - } else if (aName < bName) { - return -1; - } else { - return 0; - } - }); - - // Build up output array - for (var i = 0; i < this.options.length; i++) { - var option = this.options[i]; - - if (!option.usage) - break; - - var usageString = " "; - var type = option.type ? " " + option.type.toUpperCase() : ""; - - if (option.short) { - usageString += this.DEFAULT_SHORT_FLAG + option.short + type + ", "; - } - - usageString += this.DEFAULT_LONG_FLAG + option.name + type; - - output.push([usageString, option.usage]); - - if (usageString.length > maxLength) { - maxLength = usageString.length; - } - } - - output.push([" @", "Insert command line options and files from a file."]); - - // Print padded output - for (var i = 0; i < output.length; i++) { - IO.printLine(output[i][0] + (new Array(maxLength - output[i][0].length + 3)).join(" ") + output[i][1]); - } - } - - public option(name: string, config: IOptions); - public option(name: string, config: IOptions, short: string) { - if (!config) { - config = short; - short = null; - } - - config.name = name; - config.short = short; - config.flag = false; - - this.options.push(config); - } - - public flag(name: string, config: IOptions); - public flag(name: string, config: IOptions, short: string) { - if (!config) { - config = short; - short = null; - } - - config.name = name; - config.short = short; - config.flag = true - - this.options.push(config); - } - - - - // Parse an arguments string - public parseString(argString: string) { - var position = 0; - var tokens = argString.match(/\s+|"|[^\s"]+/g); - - function peek() { - return tokens[position]; - } - - function consume() { - return tokens[position++]; - } - - function consumeQuotedString() { - var value = ''; - consume(); // skip opening quote. - - var token = peek(); - - while (token && token !== '"') { - consume(); - - value += token; - - token = peek(); - } - - consume(); // skip ending quote; - - return value; - } - - var args: string[] = []; - var currentArg = ''; - - while (position < tokens.length) { - var token = peek(); - - if (token === '"') { - currentArg += consumeQuotedString(); - } else if (token.match(/\s/)) { - if (currentArg.length > 0) { - args.push(currentArg); - currentArg = ''; - } - - consume(); - } else { - consume(); - currentArg += token; - } - } - - if (currentArg.length > 0) { - args.push(currentArg); - } - - this.parse(args); - } - - // Parse arguments as they come from the platform: split into arguments. - public parse(args: string[]) { - var position = 0; - - function consume() { - return args[position++]; - } - - while (position < args.length) { - var current = consume(); - var match = current.match(/^(--?|\/|@)(.*)/); - var value = null; - - if (match) { - if (match[1] === '@') { - this.parseString(IO.readFile(match[2])); - } else { - var arg = match[2]; - var option = this.findOption(arg); - - if (option === null) { - IO.printLine("Unknown option " + arg); - IO.printLine(""); - this.printUsage(); - } else { - if (!option.flag) - value = consume(); - - option.set(value); - } - } - } else { - this.unnamed.push(current); - } - } - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-completions.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-completions.json deleted file mode 100644 index 8a473b3c2e2..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-completions.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":7,"end":11,"data":"(empty)"},{"start":11,"end":21,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\ntesting\tstring\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":21,"end":29,"data":"(empty)"},{"start":29,"end":31,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\ntesting\tstring\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":31,"end":34,"data":"(empty)"},{"start":34,"end":46,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\ntesting\tstring\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":46,"end":49,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":49,"end":55,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":55,"end":58,"data":"(empty)"},{"start":58,"end":71,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":71,"end":79,"data":"(empty)"},{"start":79,"end":118,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":118,"end":127,"data":"(empty)"},{"start":127,"end":141,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":141,"end":149,"data":"(empty)"},{"start":149,"end":164,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":164,"end":173,"data":"(empty)"},{"start":173,"end":181,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\narguments\tany\nc\tM.C\nf\tC1\nprivMeth\t() => void\nprivProp\tnumber\nprototype\tC1\npubMeth\t() => void\npubProp\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":181,"end":188,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":188,"end":190,"data":"(empty)"},{"start":190,"end":207,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":207,"end":220,"data":"(empty)"},{"start":220,"end":221,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":221,"end":228,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\nc\tC\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":228,"end":230,"data":"(empty)"},{"start":230,"end":237,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\nc\tC\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":237,"end":250,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\narguments\tany\nc\tC\nf\tC1\npriv\tnumber\nprototype\tC\npub\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":250,"end":252,"data":"(empty)"},{"start":252,"end":261,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\narguments\tany\nc\tC\nf\tC1\npriv\tnumber\nprototype\tC\npub\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":261,"end":265,"data":"(empty)"},{"start":265,"end":278,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\narguments\tany\nc\tC\nf\tC1\npriv\tnumber\nprototype\tC\npub\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":278,"end":283,"data":"(empty)"},{"start":283,"end":290,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\narguments\tany\nc\tC\nf\tC1\npriv\tnumber\nprototype\tC\npub\tnumber\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":290,"end":306,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\nc\tC\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":306,"end":308,"data":"(empty)"},{"start":308,"end":316,"data":"C\tnew() => C\nC1\tnew() => C1\nFoo\tFoo\nM\tM\nV\tnumber\nc\tC\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":316,"end":325,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":325,"end":327,"data":"(empty)"},{"start":327,"end":347,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":347,"end":360,"data":"(empty)"},{"start":360,"end":364,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"},{"start":364,"end":382,"data":"(empty)"},{"start":382,"end":384,"data":"C1\tnew() => C1\nFoo\tFoo\nM\tM\nc\tM.C\nf\tC1\n(present standard item) any\tany\n(present standard item) bool\tbool\n(present standard item) null\tnull\n(present standard item) number\tnumber\n(present standard item) string\tstring\n(present standard item) undefined\tundefined\n(present standard item) void\tvoid"}] - diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-definitions.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-definitions.json deleted file mode 100644 index 34eaa83d1d1..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-definitions.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":17,"end":31,"data":"0\t17\t34\t\ttesting\t\tFoo"},{"start":33,"end":34,"data":"0\t17\t34\t\ttesting\t\tFoo"},{"start":49,"end":60,"data":"0\t55\t180\t\tC1\t\t__GLO"},{"start":71,"end":79,"data":"0\t64\t88\t\tpubMeth\t\tC1"},{"start":82,"end":87,"data":"0\t55\t180\t\tC1\t\t__GLO"},{"start":118,"end":127,"data":"0\t110\t131\t\tprivMeth\t\tC1"},{"start":134,"end":151,"data":"0\t134\t153\t\tpubProp\t\tC1"},{"start":152,"end":153,"data":"0\t134\t153\t\tpubProp\t\tC1"},{"start":156,"end":175,"data":"0\t156\t177\t\tprivProp\t\tC1"},{"start":176,"end":177,"data":"0\t156\t177\t\tprivProp\t\tC1"},{"start":184,"end":192,"data":"0\t184\t201\t\tf\t\t__GLO"},{"start":192,"end":200,"data":"0\t55\t180\t\tC1\t\t__GLO"},{"start":200,"end":201,"data":"0\t184\t201\t\tf\t\t__GLO"},{"start":203,"end":206,"data":"0\t184\t201\t\tf\t\t__GLO"},{"start":221,"end":230,"data":"0\t221\t315\t\tM\t\t__GLO"},{"start":237,"end":252,"data":"0\t250\t289\t\tC\t\tM"},{"start":254,"end":267,"data":"0\t254\t269\t\tpub\t\tM.C"},{"start":268,"end":269,"data":"0\t254\t269\t\tpub\t\tM.C"},{"start":270,"end":285,"data":"0\t270\t287\t\tpriv\t\tM.C"},{"start":286,"end":287,"data":"0\t270\t287\t\tpriv\t\tM.C"},{"start":295,"end":310,"data":"0\t295\t312\t\tV\t\tM"},{"start":311,"end":312,"data":"0\t295\t312\t\tV\t\tM"},{"start":321,"end":329,"data":"0\t321\t339\t\tc\t\t__GLO"},{"start":329,"end":333,"data":"0\t250\t289\t\tC\t\tM"},{"start":333,"end":335,"data":"0\t221\t315\t\tM\t\t__GLO"},{"start":335,"end":338,"data":"0\t250\t289\t\tC\t\tM"},{"start":338,"end":339,"data":"0\t321\t339\t\tc\t\t__GLO"},{"start":343,"end":346,"data":"0\t321\t339\t\tc\t\t__GLO"}] - diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-members.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-members.json deleted file mode 100644 index 8c5c53ffe2b..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-members.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":87,"end":88,"data":"pubMeth\t() => void\npubProp\tnumber\nprivMeth\t() => void\nprivProp\tnumber\n"},{"start":205,"end":206,"data":"pubMeth\t() => void\npubProp\tnumber\n"},{"start":335,"end":336,"data":"C\tnew() => M.C\nV\tnumber\n"},{"start":345,"end":346,"data":"pub\tnumber\n"}] - diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-signatures.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-signatures.json deleted file mode 100644 index 1ae96554115..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-signatures.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":192,"end":200,"data":"C1(): C1\n"},{"start":329,"end":338,"data":"C(): C\n"}] - diff --git a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-types.json b/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-types.json deleted file mode 100644 index c1edf8cf695..00000000000 --- a/tests/cases/unittests/services/baselines/reference/getCompletionsAtPosition1.str-types.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":17,"end":34,"data":"string"},{"start":34,"end":39,"data":"Foo"},{"start":39,"end":43,"data":"any"},{"start":43,"end":45,"data":"Foo"},{"start":49,"end":64,"data":"new() => C1"},{"start":64,"end":82,"data":"() => void"},{"start":82,"end":87,"data":"C1"},{"start":87,"end":88,"data":"() => void"},{"start":88,"end":89,"data":"new() => C1"},{"start":108,"end":110,"data":"new() => C1"},{"start":110,"end":131,"data":"() => void"},{"start":131,"end":134,"data":"new() => C1"},{"start":134,"end":153,"data":"number"},{"start":153,"end":156,"data":"new() => C1"},{"start":156,"end":177,"data":"number"},{"start":177,"end":180,"data":"new() => C1"},{"start":184,"end":196,"data":"C1"},{"start":196,"end":198,"data":"new() => C1"},{"start":198,"end":201,"data":"C1"},{"start":203,"end":205,"data":"C1"},{"start":221,"end":237,"data":"M"},{"start":237,"end":254,"data":"new() => C"},{"start":254,"end":269,"data":"number"},{"start":269,"end":270,"data":"new() => C"},{"start":270,"end":287,"data":"number"},{"start":287,"end":289,"data":"new() => C"},{"start":289,"end":295,"data":"M"},{"start":295,"end":312,"data":"number"},{"start":312,"end":315,"data":"M"},{"start":321,"end":333,"data":"M.C"},{"start":333,"end":334,"data":"M"},{"start":334,"end":336,"data":"new() => M.C"},{"start":336,"end":339,"data":"M.C"},{"start":343,"end":345,"data":"M.C"}] - diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-completions.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-completions.json deleted file mode 100644 index a3343a7405f..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-completions.json +++ /dev/null @@ -1 +0,0 @@ -[{"start":10,"end":19,"data":"(empty)"},{"start":19,"end":26,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":26,"end":31,"data":"(empty)"},{"start":31,"end":45,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":45,"end":50,"data":"(empty)"},{"start":50,"end":62,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":62,"end":68,"data":"(empty)"},{"start":68,"end":82,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":82,"end":88,"data":"(empty)"},{"start":88,"end":102,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":102,"end":106,"data":"(empty)"},{"start":106,"end":108,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":108,"end":110,"data":"(empty)"},{"start":110,"end":133,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":133,"end":138,"data":"(empty)"},{"start":138,"end":150,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nflag bool\nname string\nset (s: string) => void\nshort string\ntype string\nusage string\n(standard items)"},{"start":150,"end":159,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":159,"end":173,"data":"(empty)"},{"start":173,"end":180,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":180,"end":186,"data":"(empty)"},{"start":186,"end":188,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":188,"end":207,"data":"(empty)"},{"start":207,"end":209,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":209,"end":213,"data":"(empty)"},{"start":213,"end":219,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":219,"end":225,"data":"(empty)"},{"start":225,"end":227,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":227,"end":245,"data":"(empty)"},{"start":245,"end":247,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":247,"end":252,"data":"(empty)"},{"start":252,"end":260,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":260,"end":296,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nhost any\n(standard items)"},{"start":296,"end":304,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":304,"end":378,"data":"(empty)"},{"start":378,"end":383,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":383,"end":391,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg string\narguments any\ni number\n(standard items)"},{"start":391,"end":406,"data":"(empty)"},{"start":406,"end":437,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg string\narguments any\ni number\n(standard items)"},{"start":437,"end":439,"data":"(empty)"},{"start":439,"end":658,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg string\narguments any\ni number\n(standard items)"},{"start":658,"end":665,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":665,"end":670,"data":"(empty)"},{"start":670,"end":672,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":672,"end":680,"data":"(empty)"},{"start":680,"end":703,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":703,"end":708,"data":"(empty)"},{"start":708,"end":710,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":710,"end":718,"data":"(empty)"},{"start":718,"end":743,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":743,"end":750,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":750,"end":761,"data":"(empty)"},{"start":761,"end":787,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":787,"end":827,"data":"(empty)"},{"start":827,"end":851,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":851,"end":854,"data":"(empty)"},{"start":854,"end":878,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":878,"end":908,"data":"(empty)"},{"start":908,"end":932,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":932,"end":973,"data":"(empty)"},{"start":973,"end":997,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":997,"end":1027,"data":"(empty)"},{"start":1027,"end":1051,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1051,"end":1054,"data":"(empty)"},{"start":1054,"end":1078,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1078,"end":1089,"data":"(empty)"},{"start":1089,"end":1106,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1106,"end":1113,"data":"(empty)"},{"start":1113,"end":1132,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1132,"end":1142,"data":"(empty)"},{"start":1142,"end":1191,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1191,"end":1225,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\na any\naName any\narguments any\nb any\nbName any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1225,"end":1231,"data":"(empty)"},{"start":1231,"end":1272,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\na any\naName any\narguments any\nb any\nbName any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1272,"end":1278,"data":"(empty)"},{"start":1278,"end":1509,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\na any\naName any\narguments any\nb any\nbName any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1509,"end":1523,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1523,"end":1547,"data":"(empty)"},{"start":1547,"end":1565,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1565,"end":1567,"data":"(empty)"},{"start":1567,"end":1621,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1621,"end":1628,"data":"(empty)"},{"start":1628,"end":1724,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1724,"end":1736,"data":"(empty)"},{"start":1736,"end":1738,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1738,"end":1743,"data":"(empty)"},{"start":1743,"end":1761,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1761,"end":1766,"data":"(empty)"},{"start":1766,"end":1782,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1782,"end":1786,"data":"(empty)"},{"start":1786,"end":1816,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1816,"end":1819,"data":"(empty)"},{"start":1819,"end":1935,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":1935,"end":1940,"data":"(empty)"},{"start":1940,"end":2240,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2240,"end":2252,"data":"(empty)"},{"start":2252,"end":2253,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2253,"end":2306,"data":"(empty)"},{"start":2306,"end":2321,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2321,"end":2343,"data":"(empty)"},{"start":2343,"end":2361,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2361,"end":2363,"data":"(empty)"},{"start":2363,"end":2489,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2489,"end":2493,"data":"(empty)"},{"start":2493,"end":2529,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\ni number\nmaxLength number\noption IOptions\noutput any[]\ntype string\nusageString string\n(standard items)"},{"start":2529,"end":2536,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":2536,"end":2543,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2543,"end":2555,"data":"(empty)"},{"start":2555,"end":2564,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2564,"end":2571,"data":"(empty)"},{"start":2571,"end":2583,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2583,"end":2588,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":2588,"end":2595,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2595,"end":2607,"data":"(empty)"},{"start":2607,"end":2616,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2616,"end":2623,"data":"(empty)"},{"start":2623,"end":2634,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2634,"end":2640,"data":"(empty)"},{"start":2640,"end":2884,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2884,"end":2891,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":2891,"end":2898,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2898,"end":2908,"data":"(empty)"},{"start":2908,"end":2917,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2917,"end":2924,"data":"(empty)"},{"start":2924,"end":2936,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2936,"end":2941,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":2941,"end":2948,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2948,"end":2958,"data":"(empty)"},{"start":2958,"end":2967,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2967,"end":2974,"data":"(empty)"},{"start":2974,"end":2985,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":2985,"end":2991,"data":"(empty)"},{"start":2991,"end":3233,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narguments any\nconfig IOptions\nname string\nshort string\n(standard items)"},{"start":3233,"end":3245,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":3245,"end":3273,"data":"(empty)"},{"start":3273,"end":3278,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":3278,"end":3285,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3285,"end":3307,"data":"(empty)"},{"start":3307,"end":3331,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3331,"end":3340,"data":"(empty)"},{"start":3340,"end":3358,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3358,"end":3365,"data":"(empty)"},{"start":3365,"end":3397,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3397,"end":3400,"data":"(empty)"},{"start":3400,"end":3422,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3422,"end":3427,"data":"(empty)"},{"start":3427,"end":3500,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3500,"end":3508,"data":"(empty)"},{"start":3508,"end":3574,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3574,"end":3583,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3583,"end":3603,"data":"(empty)"},{"start":3603,"end":3624,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3624,"end":3630,"data":"(empty)"},{"start":3630,"end":3632,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3632,"end":3635,"data":"(empty)"},{"start":3635,"end":3661,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3661,"end":3683,"data":"(empty)"},{"start":3683,"end":3702,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3702,"end":3708,"data":"(empty)"},{"start":3708,"end":3759,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3759,"end":3763,"data":"(empty)"},{"start":3763,"end":3906,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3906,"end":3927,"data":"(empty)"},{"start":3927,"end":3967,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\nvalue string\n(standard items)"},{"start":3967,"end":3982,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":3982,"end":3987,"data":"(empty)"},{"start":3987,"end":4016,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4016,"end":4027,"data":"(empty)"},{"start":4027,"end":4029,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4029,"end":4032,"data":"(empty)"},{"start":4032,"end":4096,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4096,"end":4102,"data":"(empty)"},{"start":4102,"end":4141,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4141,"end":4145,"data":"(empty)"},{"start":4145,"end":4241,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4241,"end":4243,"data":"(empty)"},{"start":4243,"end":4371,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4371,"end":4374,"data":"(empty)"},{"start":4374,"end":4661,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\nargString string\nargs string[]\narguments any\nconsume () => any\nconsumeQuotedString() => string\ncurrentArg string\npeek () => any\nposition number\ntoken any\ntokens any\n(standard items)"},{"start":4661,"end":4669,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":4669,"end":4741,"data":"(empty)"},{"start":4741,"end":4746,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\n(standard items)"},{"start":4746,"end":4753,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4753,"end":4764,"data":"(empty)"},{"start":4764,"end":4790,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4790,"end":4799,"data":"(empty)"},{"start":4799,"end":4824,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4824,"end":4832,"data":"(empty)"},{"start":4832,"end":4946,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4946,"end":4954,"data":"(empty)"},{"start":4954,"end":4984,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":4984,"end":4990,"data":"(empty)"},{"start":4990,"end":5022,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5022,"end":5024,"data":"(empty)"},{"start":5024,"end":5043,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5043,"end":5049,"data":"(empty)"},{"start":5049,"end":5119,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5119,"end":5123,"data":"(empty)"},{"start":5123,"end":5239,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5239,"end":5243,"data":"(empty)"},{"start":5243,"end":5280,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5280,"end":5287,"data":"(empty)"},{"start":5287,"end":5395,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5395,"end":5413,"data":"(empty)"},{"start":5413,"end":5459,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"},{"start":5459,"end":5462,"data":"(empty)"},{"start":5462,"end":5817,"data":"IOptions IOptions\nOptionsParser new(host: any) => OptionsParser\narg any\nargs string[]\narguments any\nconsume () => string\ncurrent string\nmatch any\noption IOptions\nposition number\nvalue any\n(standard items)"}] \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-definitions.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-definitions.json deleted file mode 100644 index d421be0f800..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-definitions.json +++ /dev/null @@ -1 +0,0 @@ -[{"start":26,"end":32,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":45,"end":51,"data":"0\t45\t56\t\tflag\t\tIOptions"},{"start":62,"end":69,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":82,"end":89,"data":"0\t82\t96\t\tusage\t\tIOptions"},{"start":102,"end":107,"data":"0\t102\t127\t\tset\t\tIOptions"},{"start":108,"end":111,"data":"0\t108\t117\t\ts\t\t"},{"start":133,"end":139,"data":"0\t133\t146\t\ttype\t\tIOptions"},{"start":153,"end":173,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":180,"end":209,"data":"0\t180\t212\t\tDEFAULT_SHORT_FLAG\t\tOptionsParser"},{"start":219,"end":247,"data":"0\t219\t251\t\tDEFAULT_LONG_FLAG\t\tOptionsParser"},{"start":260,"end":272,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":273,"end":287,"data":"0\t273\t290\t\thost\t\tOptionsParser"},{"start":291,"end":292,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":383,"end":391,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":391,"end":402,"data":"0\t383\t657\t\tfindOption\t\tOptionsParser"},{"start":402,"end":407,"data":"0\t402\t413\t\targ\t\tOptionsParser.findOption"},{"start":414,"end":415,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":433,"end":441,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":444,"end":446,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":448,"end":452,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":452,"end":461,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":469,"end":471,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":495,"end":499,"data":"0\t402\t413\t\targ\t\tOptionsParser.findOption"},{"start":503,"end":507,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":507,"end":516,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":516,"end":518,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":518,"end":525,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":528,"end":532,"data":"0\t402\t413\t\targ\t\tOptionsParser.findOption"},{"start":536,"end":540,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":540,"end":549,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":549,"end":551,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":551,"end":557,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":577,"end":584,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":584,"end":588,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":588,"end":597,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":597,"end":599,"data":"0\t433\t442\t\ti\t\tOptionsParser.findOption"},{"start":599,"end":600,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":665,"end":681,"data":"0\t665\t694\t\tunnamed\t\tOptionsParser"},{"start":689,"end":692,"data":"0\t665\t694\t\tunnamed\t\tOptionsParser"},{"start":703,"end":719,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":719,"end":729,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":729,"end":732,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":732,"end":734,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":750,"end":761,"data":"0\t743\t2528\t\tprintUsage\t\tOptionsParser"},{"start":1102,"end":1115,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":1117,"end":1118,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":1128,"end":1144,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":1145,"end":1146,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":1158,"end":1162,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1162,"end":1171,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":1173,"end":1177,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1177,"end":1186,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":1200,"end":1202,"data":"0\t1200\t1201\t\ta\t\tOptionsParser.printUsage._anonymous"},{"start":1203,"end":1205,"data":"0\t1203\t1204\t\tb\t\tOptionsParser.printUsage._anonymous"},{"start":1221,"end":1233,"data":"0\t1221\t1254\t\taName\t\tOptionsParser.printUsage._anonymous"},{"start":1233,"end":1235,"data":"0\t1200\t1201\t\ta\t\tOptionsParser.printUsage._anonymous"},{"start":1253,"end":1254,"data":"0\t1221\t1254\t\taName\t\tOptionsParser.printUsage._anonymous"},{"start":1268,"end":1280,"data":"0\t1268\t1301\t\tbName\t\tOptionsParser.printUsage._anonymous"},{"start":1280,"end":1282,"data":"0\t1203\t1204\t\tb\t\tOptionsParser.printUsage._anonymous"},{"start":1300,"end":1301,"data":"0\t1268\t1301\t\tbName\t\tOptionsParser.printUsage._anonymous"},{"start":1321,"end":1327,"data":"0\t1221\t1254\t\taName\t\tOptionsParser.printUsage._anonymous"},{"start":1329,"end":1335,"data":"0\t1268\t1301\t\tbName\t\tOptionsParser.printUsage._anonymous"},{"start":1389,"end":1395,"data":"0\t1221\t1254\t\taName\t\tOptionsParser.printUsage._anonymous"},{"start":1397,"end":1403,"data":"0\t1268\t1301\t\tbName\t\tOptionsParser.printUsage._anonymous"},{"start":1561,"end":1569,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":1572,"end":1574,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":1576,"end":1580,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1580,"end":1589,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":1597,"end":1599,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":1617,"end":1630,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1630,"end":1634,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1634,"end":1643,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":1643,"end":1645,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":1645,"end":1646,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1667,"end":1674,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1674,"end":1680,"data":"0\t82\t96\t\tusage\t\tIOptions"},{"start":1720,"end":1738,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":1742,"end":1743,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":1757,"end":1768,"data":"0\t1757\t1819\t\ttype\t\tOptionsParser.printUsage"},{"start":1768,"end":1775,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1775,"end":1780,"data":"0\t133\t146\t\ttype\t\tIOptions"},{"start":1788,"end":1795,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1795,"end":1800,"data":"0\t133\t146\t\ttype\t\tIOptions"},{"start":1818,"end":1819,"data":"0\t1757\t1819\t\ttype\t\tOptionsParser.printUsage"},{"start":1839,"end":1846,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1846,"end":1852,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":1872,"end":1884,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":1887,"end":1891,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1891,"end":1911,"data":"0\t180\t212\t\tDEFAULT_SHORT_FLAG\t\tOptionsParser"},{"start":1913,"end":1920,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":1920,"end":1926,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":1928,"end":1933,"data":"0\t1757\t1819\t\ttype\t\tOptionsParser.printUsage"},{"start":1971,"end":1983,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":1986,"end":1990,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":1990,"end":2009,"data":"0\t219\t251\t\tDEFAULT_LONG_FLAG\t\tOptionsParser"},{"start":2011,"end":2018,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":2018,"end":2023,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":2025,"end":2030,"data":"0\t1757\t1819\t\ttype\t\tOptionsParser.printUsage"},{"start":2046,"end":2053,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2059,"end":2071,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":2072,"end":2079,"data":"0\t1617\t1646\t\toption\t\tOptionsParser.printUsage"},{"start":2079,"end":2085,"data":"0\t82\t96\t\tusage\t\tIOptions"},{"start":2107,"end":2119,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":2128,"end":2138,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":2158,"end":2168,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":2170,"end":2182,"data":"0\t1720\t1743\t\tusageString\t\tOptionsParser.printUsage"},{"start":2227,"end":2234,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2357,"end":2365,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2368,"end":2370,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2372,"end":2379,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2387,"end":2389,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2420,"end":2427,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2427,"end":2429,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2446,"end":2456,"data":"0\t1128\t1146\t\tmaxLength\t\tOptionsParser.printUsage"},{"start":2458,"end":2465,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2465,"end":2467,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2496,"end":2503,"data":"0\t1102\t1118\t\toutput\t\tOptionsParser.printUsage"},{"start":2503,"end":2505,"data":"0\t1561\t1570\t\ti\t\tOptionsParser.printUsage"},{"start":2543,"end":2550,"data":"0\t2588\t2883\t\toption\t\tOptionsParser"},{"start":2550,"end":2556,"data":"0\t2550\t2562\t\tname\t\t"},{"start":2564,"end":2572,"data":"0\t2564\t2580\t\tconfig\t\t"},{"start":2572,"end":2581,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2595,"end":2602,"data":"0\t2588\t2883\t\toption\t\tOptionsParser"},{"start":2602,"end":2608,"data":"0\t2602\t2614\t\tname\t\tOptionsParser.option"},{"start":2616,"end":2624,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2624,"end":2633,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2634,"end":2641,"data":"0\t2634\t2647\t\tshort\t\tOptionsParser.option"},{"start":2665,"end":2672,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2688,"end":2695,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2697,"end":2698,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2702,"end":2708,"data":"0\t2634\t2647\t\tshort\t\tOptionsParser.option"},{"start":2722,"end":2728,"data":"0\t2634\t2647\t\tshort\t\tOptionsParser.option"},{"start":2758,"end":2765,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2765,"end":2770,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":2772,"end":2777,"data":"0\t2602\t2614\t\tname\t\tOptionsParser.option"},{"start":2787,"end":2794,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2794,"end":2800,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":2802,"end":2808,"data":"0\t2634\t2647\t\tshort\t\tOptionsParser.option"},{"start":2818,"end":2825,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2825,"end":2830,"data":"0\t45\t56\t\tflag\t\tIOptions"},{"start":2850,"end":2854,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":2854,"end":2863,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":2868,"end":2875,"data":"0\t2616\t2632\t\tconfig\t\tOptionsParser.option"},{"start":2898,"end":2903,"data":"0\t2941\t3232\t\tflag\t\tOptionsParser"},{"start":2903,"end":2909,"data":"0\t2903\t2915\t\tname\t\t"},{"start":2917,"end":2925,"data":"0\t2917\t2933\t\tconfig\t\t"},{"start":2925,"end":2934,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2948,"end":2953,"data":"0\t2941\t3232\t\tflag\t\tOptionsParser"},{"start":2953,"end":2959,"data":"0\t2953\t2965\t\tname\t\tOptionsParser.flag"},{"start":2967,"end":2975,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":2975,"end":2984,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":2985,"end":2992,"data":"0\t2985\t2998\t\tshort\t\tOptionsParser.flag"},{"start":3016,"end":3023,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3039,"end":3046,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3048,"end":3049,"data":"0\t0\t149\t\tIOptions\t\t__GLO"},{"start":3053,"end":3059,"data":"0\t2985\t2998\t\tshort\t\tOptionsParser.flag"},{"start":3073,"end":3079,"data":"0\t2985\t2998\t\tshort\t\tOptionsParser.flag"},{"start":3109,"end":3116,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3116,"end":3121,"data":"0\t26\t39\t\tname\t\tIOptions"},{"start":3123,"end":3128,"data":"0\t2953\t2965\t\tname\t\tOptionsParser.flag"},{"start":3138,"end":3145,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3145,"end":3151,"data":"0\t62\t76\t\tshort\t\tIOptions"},{"start":3153,"end":3159,"data":"0\t2985\t2998\t\tshort\t\tOptionsParser.flag"},{"start":3169,"end":3176,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3176,"end":3181,"data":"0\t45\t56\t\tflag\t\tIOptions"},{"start":3199,"end":3203,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":3203,"end":3212,"data":"0\t703\t734\t\toptions\t\tOptionsParser"},{"start":3217,"end":3224,"data":"0\t2967\t2983\t\tconfig\t\tOptionsParser.flag"},{"start":3285,"end":3297,"data":"0\t3278\t4660\t\tparseString\t\tOptionsParser"},{"start":3297,"end":3308,"data":"0\t3297\t3314\t\targString\t\tOptionsParser.parseString"},{"start":3327,"end":3342,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":3343,"end":3344,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":3354,"end":3367,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":3367,"end":3377,"data":"0\t3297\t3314\t\targString\t\tOptionsParser.parseString"},{"start":3400,"end":3401,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":3422,"end":3427,"data":"0\t3413\t3479\t\tpeek\t\tOptionsParser.parseString"},{"start":3451,"end":3458,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":3458,"end":3467,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":3500,"end":3508,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":3532,"end":3539,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":3539,"end":3548,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":3583,"end":3603,"data":"0\t3574\t3966\t\tconsumeQuotedString\t\tOptionsParser.parseString"},{"start":3620,"end":3632,"data":"0\t3620\t3635\t\tvalue\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3634,"end":3635,"data":"0\t3620\t3635\t\tvalue\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3649,"end":3657,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":3698,"end":3710,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3710,"end":3715,"data":"0\t3413\t3479\t\tpeek\t\tOptionsParser.parseString"},{"start":3716,"end":3717,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3740,"end":3746,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3749,"end":3755,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3783,"end":3791,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":3813,"end":3819,"data":"0\t3620\t3635\t\tvalue\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3822,"end":3828,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3848,"end":3854,"data":"0\t3698\t3717\t\ttoken\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3856,"end":3861,"data":"0\t3413\t3479\t\tpeek\t\tOptionsParser.parseString"},{"start":3894,"end":3902,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":3949,"end":3955,"data":"0\t3620\t3635\t\tvalue\t\tOptionsParser.parseString.consumeQuotedString"},{"start":3978,"end":3988,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":3996,"end":3999,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4001,"end":4002,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4012,"end":4029,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4031,"end":4032,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4051,"end":4060,"data":"0\t3327\t3344\t\tposition\t\tOptionsParser.parseString"},{"start":4062,"end":4069,"data":"0\t3354\t3401\t\ttokens\t\tOptionsParser.parseString"},{"start":4092,"end":4104,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4104,"end":4109,"data":"0\t3413\t3479\t\tpeek\t\tOptionsParser.parseString"},{"start":4110,"end":4111,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4131,"end":4137,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4165,"end":4176,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4179,"end":4199,"data":"0\t3574\t3966\t\tconsumeQuotedString\t\tOptionsParser.parseString"},{"start":4226,"end":4232,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4268,"end":4279,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4314,"end":4319,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4324,"end":4335,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4358,"end":4369,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4413,"end":4421,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":4463,"end":4471,"data":"0\t3491\t3562\t\tconsume\t\tOptionsParser.parseString"},{"start":4491,"end":4502,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4505,"end":4511,"data":"0\t4092\t4111\t\ttoken\t\tOptionsParser.parseString"},{"start":4553,"end":4564,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4591,"end":4596,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4601,"end":4612,"data":"0\t4012\t4032\t\tcurrentArg\t\tOptionsParser.parseString"},{"start":4636,"end":4640,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":4640,"end":4647,"data":"0\t4746\t5816\t\tparse\t\tOptionsParser"},{"start":4647,"end":4652,"data":"0\t3978\t4002\t\targs\t\tOptionsParser.parseString"},{"start":4753,"end":4759,"data":"0\t4746\t5816\t\tparse\t\tOptionsParser"},{"start":4759,"end":4765,"data":"0\t4759\t4773\t\targs\t\tOptionsParser.parse"},{"start":4786,"end":4801,"data":"0\t4786\t4803\t\tposition\t\tOptionsParser.parse"},{"start":4802,"end":4803,"data":"0\t4786\t4803\t\tposition\t\tOptionsParser.parse"},{"start":4824,"end":4832,"data":"0\t4815\t4884\t\tconsume\t\tOptionsParser.parse"},{"start":4856,"end":4861,"data":"0\t4759\t4773\t\targs\t\tOptionsParser.parse"},{"start":4861,"end":4870,"data":"0\t4786\t4803\t\tposition\t\tOptionsParser.parse"},{"start":4903,"end":4912,"data":"0\t4786\t4803\t\tposition\t\tOptionsParser.parse"},{"start":4914,"end":4919,"data":"0\t4759\t4773\t\targs\t\tOptionsParser.parse"},{"start":4942,"end":4956,"data":"0\t4942\t4966\t\tcurrent\t\tOptionsParser.parse"},{"start":4956,"end":4964,"data":"0\t4815\t4884\t\tconsume\t\tOptionsParser.parse"},{"start":4965,"end":4966,"data":"0\t4942\t4966\t\tcurrent\t\tOptionsParser.parse"},{"start":4980,"end":4992,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":4992,"end":5000,"data":"0\t4942\t4966\t\tcurrent\t\tOptionsParser.parse"},{"start":5024,"end":5025,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5039,"end":5051,"data":"0\t5039\t5056\t\tvalue\t\tOptionsParser.parse"},{"start":5055,"end":5056,"data":"0\t5039\t5056\t\tvalue\t\tOptionsParser.parse"},{"start":5076,"end":5082,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5106,"end":5112,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5147,"end":5151,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":5151,"end":5164,"data":"0\t3278\t4660\t\tparseString\t\tOptionsParser"},{"start":5176,"end":5182,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5235,"end":5245,"data":"0\t5235\t5254\t\targ\t\tOptionsParser.parse"},{"start":5245,"end":5251,"data":"0\t4980\t5025\t\tmatch\t\tOptionsParser.parse"},{"start":5253,"end":5254,"data":"0\t5235\t5254\t\targ\t\tOptionsParser.parse"},{"start":5276,"end":5289,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5289,"end":5293,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":5293,"end":5305,"data":"0\t383\t657\t\tfindOption\t\tOptionsParser"},{"start":5305,"end":5309,"data":"0\t5235\t5254\t\targ\t\tOptionsParser.parse"},{"start":5309,"end":5310,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5338,"end":5345,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5415,"end":5419,"data":"0\t5235\t5254\t\targ\t\tOptionsParser.parse"},{"start":5489,"end":5493,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":5493,"end":5505,"data":"0\t743\t2528\t\tprintUsage\t\tOptionsParser"},{"start":5568,"end":5575,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5575,"end":5580,"data":"0\t45\t56\t\tflag\t\tIOptions"},{"start":5610,"end":5616,"data":"0\t5039\t5056\t\tvalue\t\tOptionsParser.parse"},{"start":5618,"end":5626,"data":"0\t4815\t4884\t\tconsume\t\tOptionsParser.parse"},{"start":5656,"end":5663,"data":"0\t5276\t5310\t\toption\t\tOptionsParser.parse"},{"start":5663,"end":5667,"data":"0\t102\t127\t\tset\t\tIOptions"},{"start":5667,"end":5673,"data":"0\t5039\t5056\t\tvalue\t\tOptionsParser.parse"},{"start":5756,"end":5760,"data":"0\t260\t295\t\tOptionsParser\t\t__GLO"},{"start":5760,"end":5769,"data":"0\t665\t694\t\tunnamed\t\tOptionsParser"},{"start":5774,"end":5782,"data":"0\t4942\t4966\t\tcurrent\t\tOptionsParser.parse"}] \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-members.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-members.json deleted file mode 100644 index 0788916ce55..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-members.json +++ /dev/null @@ -1 +0,0 @@ -[{"start":453,"end":454,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":508,"end":509,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":519,"end":520,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":541,"end":542,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":552,"end":553,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":589,"end":590,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1163,"end":1164,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1178,"end":1179,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1581,"end":1582,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1635,"end":1636,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1674,"end":1675,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1775,"end":1776,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1795,"end":1796,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1846,"end":1847,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1892,"end":1893,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":1920,"end":1921,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":1991,"end":1992,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":2018,"end":2019,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2079,"end":2080,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2765,"end":2766,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2794,"end":2795,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2825,"end":2826,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":2855,"end":2856,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":3116,"end":3117,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":3145,"end":3146,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":3176,"end":3177,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":3204,"end":3205,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":4641,"end":4642,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":5152,"end":5153,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":5294,"end":5295,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":5494,"end":5495,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"},{"start":5575,"end":5576,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":5663,"end":5664,"data":"name\tstring\nflag\tbool\nshort\tstring\nusage\tstring\nset\t(s: string) => void\ntype\tstring\n"},{"start":5761,"end":5762,"data":"unnamed\tstring[]\noptions\tIOptions[]\nprintUsage\t() => void\noption\t(name: string,config: IOptions): any; \nflag\t(name: string,config: IOptions): any; \nparseString\t(argString: string) => void\nparse\t(args: string[]) => void\nDEFAULT_SHORT_FLAG\tstring\nDEFAULT_LONG_FLAG\tstring\nhost\tany\nfindOption\t(arg: string) => IOptions\n"}] \ No newline at end of file diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-signatures.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-signatures.json deleted file mode 100644 index 4191964256a..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-signatures.json +++ /dev/null @@ -1,2 +0,0 @@ -[{"start":3649,"end":3659,"data":"consume(): any\n"},{"start":3710,"end":3716,"data":"peek(): any\n"},{"start":3783,"end":3793,"data":"consume(): any\n"},{"start":3856,"end":3862,"data":"peek(): any\n"},{"start":3894,"end":3904,"data":"consume(): any\n"},{"start":4104,"end":4110,"data":"peek(): any\n"},{"start":4179,"end":4200,"data":"consumeQuotedString(): string\n"},{"start":4413,"end":4423,"data":"consume(): any\n"},{"start":4463,"end":4473,"data":"consume(): any\n"},{"start":4636,"end":4653,"data":"parse(args: string[]): void\n"},{"start":4956,"end":4965,"data":"consume(): string\n"},{"start":5147,"end":5164,"data":"parseString(argString: string): void\n"},{"start":5185,"end":5187,"data":"parseString(argString: string): void\n"},{"start":5289,"end":5309,"data":"findOption(arg: string): IOptions\n"},{"start":5489,"end":5507,"data":"printUsage(): void\n"},{"start":5618,"end":5627,"data":"consume(): string\n"},{"start":5656,"end":5674,"data":"set(s: string): void\n"}] - diff --git a/tests/cases/unittests/services/baselines/reference/optionsParser.str-types.json b/tests/cases/unittests/services/baselines/reference/optionsParser.str-types.json deleted file mode 100644 index 65995dc49b1..00000000000 --- a/tests/cases/unittests/services/baselines/reference/optionsParser.str-types.json +++ /dev/null @@ -1 +0,0 @@ -[{"start":26,"end":39,"data":"string"},{"start":39,"end":45,"data":"IOptions"},{"start":45,"end":56,"data":"bool"},{"start":56,"end":62,"data":"IOptions"},{"start":62,"end":76,"data":"string"},{"start":76,"end":82,"data":"IOptions"},{"start":82,"end":96,"data":"string"},{"start":96,"end":102,"data":"IOptions"},{"start":102,"end":108,"data":"(s: string) => void"},{"start":108,"end":117,"data":"string"},{"start":117,"end":122,"data":"(s: string) => void"},{"start":122,"end":126,"data":"void"},{"start":126,"end":127,"data":"(s: string) => void"},{"start":127,"end":133,"data":"IOptions"},{"start":133,"end":146,"data":"string"},{"start":146,"end":149,"data":"IOptions"},{"start":153,"end":180,"data":"new(host: any) => OptionsParser"},{"start":180,"end":212,"data":"string"},{"start":212,"end":219,"data":"new(host: any) => OptionsParser"},{"start":219,"end":251,"data":"string"},{"start":251,"end":273,"data":"new(host: any) => OptionsParser"},{"start":273,"end":290,"data":"any"},{"start":290,"end":303,"data":"new(host: any) => OptionsParser"},{"start":378,"end":383,"data":"new(host: any) => OptionsParser"},{"start":383,"end":402,"data":"(arg: string) => IOptions"},{"start":402,"end":413,"data":"string"},{"start":413,"end":428,"data":"(arg: string) => IOptions"},{"start":428,"end":433,"data":"void"},{"start":433,"end":442,"data":"number"},{"start":442,"end":444,"data":"void"},{"start":444,"end":445,"data":"number"},{"start":445,"end":448,"data":"bool"},{"start":448,"end":452,"data":"OptionsParser"},{"start":452,"end":460,"data":"IOptions[]"},{"start":460,"end":467,"data":"any"},{"start":467,"end":469,"data":"void"},{"start":469,"end":472,"data":"number"},{"start":472,"end":495,"data":"void"},{"start":495,"end":498,"data":"string"},{"start":498,"end":503,"data":"bool"},{"start":503,"end":507,"data":"OptionsParser"},{"start":507,"end":515,"data":"IOptions[]"},{"start":515,"end":516,"data":"IOptions"},{"start":516,"end":517,"data":"number"},{"start":517,"end":518,"data":"IOptions"},{"start":518,"end":524,"data":"string"},{"start":524,"end":528,"data":"bool"},{"start":528,"end":531,"data":"string"},{"start":531,"end":536,"data":"bool"},{"start":536,"end":540,"data":"OptionsParser"},{"start":540,"end":548,"data":"IOptions[]"},{"start":548,"end":549,"data":"IOptions"},{"start":549,"end":550,"data":"number"},{"start":550,"end":551,"data":"IOptions"},{"start":551,"end":556,"data":"string"},{"start":556,"end":577,"data":"void"},{"start":577,"end":584,"data":"IOptions"},{"start":584,"end":588,"data":"OptionsParser"},{"start":588,"end":596,"data":"IOptions[]"},{"start":596,"end":597,"data":"IOptions"},{"start":597,"end":598,"data":"number"},{"start":598,"end":600,"data":"IOptions"},{"start":600,"end":626,"data":"void"},{"start":626,"end":638,"data":"(arg: string) => IOptions"},{"start":638,"end":650,"data":"any"},{"start":650,"end":657,"data":"(arg: string) => IOptions"},{"start":657,"end":665,"data":"new(host: any) => OptionsParser"},{"start":665,"end":681,"data":"string[]"},{"start":681,"end":687,"data":"string"},{"start":687,"end":694,"data":"string[]"},{"start":694,"end":703,"data":"new(host: any) => OptionsParser"},{"start":703,"end":719,"data":"IOptions[]"},{"start":719,"end":727,"data":"IOptions"},{"start":727,"end":734,"data":"IOptions[]"},{"start":734,"end":743,"data":"new(host: any) => OptionsParser"},{"start":743,"end":774,"data":"() => void"},{"start":774,"end":787,"data":"any"},{"start":787,"end":826,"data":"string"},{"start":826,"end":828,"data":"any"},{"start":828,"end":838,"data":"() => void"},{"start":838,"end":851,"data":"any"},{"start":851,"end":853,"data":"string"},{"start":853,"end":855,"data":"any"},{"start":855,"end":865,"data":"() => void"},{"start":865,"end":878,"data":"any"},{"start":878,"end":907,"data":"string"},{"start":907,"end":909,"data":"any"},{"start":909,"end":919,"data":"() => void"},{"start":919,"end":932,"data":"any"},{"start":932,"end":972,"data":"string"},{"start":972,"end":974,"data":"any"},{"start":974,"end":984,"data":"() => void"},{"start":984,"end":997,"data":"any"},{"start":997,"end":1026,"data":"string"},{"start":1026,"end":1028,"data":"any"},{"start":1028,"end":1038,"data":"() => void"},{"start":1038,"end":1051,"data":"any"},{"start":1051,"end":1053,"data":"string"},{"start":1053,"end":1055,"data":"any"},{"start":1055,"end":1065,"data":"() => void"},{"start":1065,"end":1078,"data":"any"},{"start":1078,"end":1088,"data":"string"},{"start":1088,"end":1090,"data":"any"},{"start":1090,"end":1102,"data":"() => void"},{"start":1102,"end":1118,"data":"any[]"},{"start":1118,"end":1128,"data":"() => void"},{"start":1128,"end":1146,"data":"number"},{"start":1146,"end":1158,"data":"() => void"},{"start":1158,"end":1162,"data":"OptionsParser"},{"start":1162,"end":1170,"data":"IOptions[]"},{"start":1170,"end":1173,"data":"any"},{"start":1173,"end":1177,"data":"OptionsParser"},{"start":1177,"end":1185,"data":"IOptions[]"},{"start":1185,"end":1190,"data":"any"},{"start":1190,"end":1191,"data":"IOptions[]"},{"start":1191,"end":1200,"data":"(a: any,b: any) => number"},{"start":1200,"end":1201,"data":"any"},{"start":1201,"end":1203,"data":"(a: any,b: any) => number"},{"start":1203,"end":1204,"data":"any"},{"start":1204,"end":1221,"data":"(a: any,b: any) => number"},{"start":1221,"end":1254,"data":"any"},{"start":1254,"end":1268,"data":"(a: any,b: any) => number"},{"start":1268,"end":1301,"data":"any"},{"start":1301,"end":1317,"data":"(a: any,b: any) => number"},{"start":1317,"end":1321,"data":"void"},{"start":1321,"end":1326,"data":"any"},{"start":1326,"end":1329,"data":"bool"},{"start":1329,"end":1334,"data":"any"},{"start":1334,"end":1355,"data":"void"},{"start":1355,"end":1364,"data":"number"},{"start":1364,"end":1389,"data":"void"},{"start":1389,"end":1394,"data":"any"},{"start":1394,"end":1397,"data":"bool"},{"start":1397,"end":1402,"data":"any"},{"start":1402,"end":1423,"data":"void"},{"start":1423,"end":1433,"data":"number"},{"start":1433,"end":1473,"data":"void"},{"start":1473,"end":1482,"data":"number"},{"start":1482,"end":1497,"data":"void"},{"start":1497,"end":1508,"data":"(a: any,b: any) => number"},{"start":1508,"end":1509,"data":"IOptions[]"},{"start":1509,"end":1510,"data":"any"},{"start":1510,"end":1522,"data":"() => void"},{"start":1547,"end":1556,"data":"() => void"},{"start":1556,"end":1561,"data":"void"},{"start":1561,"end":1570,"data":"number"},{"start":1570,"end":1572,"data":"void"},{"start":1572,"end":1573,"data":"number"},{"start":1573,"end":1576,"data":"bool"},{"start":1576,"end":1580,"data":"OptionsParser"},{"start":1580,"end":1588,"data":"IOptions[]"},{"start":1588,"end":1595,"data":"any"},{"start":1595,"end":1597,"data":"void"},{"start":1597,"end":1600,"data":"number"},{"start":1600,"end":1617,"data":"void"},{"start":1617,"end":1630,"data":"IOptions"},{"start":1630,"end":1634,"data":"OptionsParser"},{"start":1634,"end":1642,"data":"IOptions[]"},{"start":1642,"end":1643,"data":"IOptions"},{"start":1643,"end":1644,"data":"number"},{"start":1644,"end":1646,"data":"IOptions"},{"start":1646,"end":1666,"data":"void"},{"start":1666,"end":1667,"data":"bool"},{"start":1667,"end":1673,"data":"IOptions"},{"start":1673,"end":1679,"data":"string"},{"start":1679,"end":1720,"data":"void"},{"start":1720,"end":1743,"data":"string"},{"start":1743,"end":1757,"data":"void"},{"start":1757,"end":1768,"data":"string"},{"start":1768,"end":1774,"data":"IOptions"},{"start":1774,"end":1788,"data":"string"},{"start":1788,"end":1794,"data":"IOptions"},{"start":1794,"end":1799,"data":"string"},{"start":1799,"end":1813,"data":"any"},{"start":1813,"end":1819,"data":"string"},{"start":1819,"end":1839,"data":"void"},{"start":1839,"end":1845,"data":"IOptions"},{"start":1845,"end":1851,"data":"string"},{"start":1851,"end":1872,"data":"void"},{"start":1872,"end":1887,"data":"string"},{"start":1887,"end":1891,"data":"OptionsParser"},{"start":1891,"end":1913,"data":"string"},{"start":1913,"end":1919,"data":"IOptions"},{"start":1919,"end":1940,"data":"string"},{"start":1940,"end":1971,"data":"void"},{"start":1971,"end":1986,"data":"string"},{"start":1986,"end":1990,"data":"OptionsParser"},{"start":1990,"end":2011,"data":"string"},{"start":2011,"end":2017,"data":"IOptions"},{"start":2017,"end":2030,"data":"string"},{"start":2030,"end":2046,"data":"void"},{"start":2046,"end":2052,"data":"any[]"},{"start":2052,"end":2058,"data":"any"},{"start":2058,"end":2059,"data":"string[]"},{"start":2059,"end":2070,"data":"string"},{"start":2070,"end":2072,"data":"string[]"},{"start":2072,"end":2078,"data":"IOptions"},{"start":2078,"end":2084,"data":"string"},{"start":2084,"end":2085,"data":"string[]"},{"start":2085,"end":2087,"data":"any"},{"start":2087,"end":2107,"data":"void"},{"start":2107,"end":2118,"data":"string"},{"start":2118,"end":2125,"data":"any"},{"start":2125,"end":2128,"data":"bool"},{"start":2128,"end":2137,"data":"number"},{"start":2137,"end":2158,"data":"void"},{"start":2158,"end":2167,"data":"number"},{"start":2167,"end":2170,"data":"any"},{"start":2170,"end":2181,"data":"string"},{"start":2181,"end":2188,"data":"number"},{"start":2188,"end":2189,"data":"any"},{"start":2189,"end":2215,"data":"void"},{"start":2215,"end":2227,"data":"() => void"},{"start":2227,"end":2233,"data":"any[]"},{"start":2233,"end":2239,"data":"any"},{"start":2239,"end":2240,"data":"string[]"},{"start":2240,"end":2251,"data":"string"},{"start":2251,"end":2253,"data":"string[]"},{"start":2253,"end":2305,"data":"string"},{"start":2305,"end":2306,"data":"string[]"},{"start":2306,"end":2308,"data":"any"},{"start":2308,"end":2320,"data":"() => void"},{"start":2343,"end":2352,"data":"() => void"},{"start":2352,"end":2357,"data":"void"},{"start":2357,"end":2366,"data":"number"},{"start":2366,"end":2368,"data":"void"},{"start":2368,"end":2369,"data":"number"},{"start":2369,"end":2372,"data":"bool"},{"start":2372,"end":2378,"data":"any[]"},{"start":2378,"end":2385,"data":"any"},{"start":2385,"end":2387,"data":"void"},{"start":2387,"end":2390,"data":"number"},{"start":2390,"end":2407,"data":"void"},{"start":2407,"end":2420,"data":"any"},{"start":2420,"end":2426,"data":"any[]"},{"start":2426,"end":2427,"data":"any"},{"start":2427,"end":2428,"data":"number"},{"start":2428,"end":2430,"data":"any"},{"start":2430,"end":2431,"data":"number"},{"start":2431,"end":2446,"data":"any"},{"start":2446,"end":2455,"data":"number"},{"start":2455,"end":2458,"data":"any"},{"start":2458,"end":2464,"data":"any[]"},{"start":2464,"end":2465,"data":"any"},{"start":2465,"end":2466,"data":"number"},{"start":2466,"end":2468,"data":"any"},{"start":2468,"end":2469,"data":"number"},{"start":2469,"end":2480,"data":"any"},{"start":2480,"end":2481,"data":"number"},{"start":2481,"end":2489,"data":"any"},{"start":2489,"end":2492,"data":"string"},{"start":2492,"end":2496,"data":"any"},{"start":2496,"end":2502,"data":"any[]"},{"start":2502,"end":2503,"data":"any"},{"start":2503,"end":2504,"data":"number"},{"start":2504,"end":2506,"data":"any"},{"start":2506,"end":2507,"data":"number"},{"start":2507,"end":2510,"data":"any"},{"start":2510,"end":2521,"data":"void"},{"start":2521,"end":2528,"data":"() => void"},{"start":2528,"end":2536,"data":"new(host: any) => OptionsParser"},{"start":2536,"end":2550,"data":"(name: string,config: IOptions): any; "},{"start":2550,"end":2562,"data":"string"},{"start":2562,"end":2564,"data":"(name: string,config: IOptions): any; "},{"start":2564,"end":2580,"data":"IOptions"},{"start":2580,"end":2582,"data":"(name: string,config: IOptions): any; "},{"start":2582,"end":2588,"data":"new(host: any) => OptionsParser"},{"start":2588,"end":2602,"data":"(name: string,config: IOptions): any; "},{"start":2602,"end":2614,"data":"string"},{"start":2614,"end":2616,"data":"(name: string,config: IOptions): any; "},{"start":2616,"end":2632,"data":"IOptions"},{"start":2632,"end":2634,"data":"(name: string,config: IOptions): any; "},{"start":2634,"end":2647,"data":"string"},{"start":2647,"end":2660,"data":"(name: string,config: IOptions): any; "},{"start":2660,"end":2664,"data":"void"},{"start":2664,"end":2665,"data":"bool"},{"start":2665,"end":2671,"data":"IOptions"},{"start":2671,"end":2688,"data":"void"},{"start":2688,"end":2694,"data":"IOptions"},{"start":2694,"end":2697,"data":"any"},{"start":2697,"end":2698,"data":"IOptions"},{"start":2698,"end":2701,"data":"any"},{"start":2701,"end":2702,"data":"IOptions"},{"start":2702,"end":2707,"data":"string"},{"start":2707,"end":2708,"data":"any"},{"start":2708,"end":2722,"data":"void"},{"start":2722,"end":2727,"data":"string"},{"start":2727,"end":2730,"data":"any"},{"start":2730,"end":2734,"data":"string"},{"start":2734,"end":2735,"data":"any"},{"start":2735,"end":2746,"data":"void"},{"start":2746,"end":2758,"data":"(name: string,config: IOptions): any; "},{"start":2758,"end":2764,"data":"IOptions"},{"start":2764,"end":2777,"data":"string"},{"start":2777,"end":2787,"data":"(name: string,config: IOptions): any; "},{"start":2787,"end":2793,"data":"IOptions"},{"start":2793,"end":2808,"data":"string"},{"start":2808,"end":2818,"data":"(name: string,config: IOptions): any; "},{"start":2818,"end":2824,"data":"IOptions"},{"start":2824,"end":2838,"data":"bool"},{"start":2838,"end":2850,"data":"(name: string,config: IOptions): any; "},{"start":2850,"end":2854,"data":"OptionsParser"},{"start":2854,"end":2862,"data":"IOptions[]"},{"start":2862,"end":2868,"data":"any"},{"start":2868,"end":2874,"data":"IOptions"},{"start":2874,"end":2876,"data":"any"},{"start":2876,"end":2883,"data":"(name: string,config: IOptions): any; "},{"start":2883,"end":2891,"data":"new(host: any) => OptionsParser"},{"start":2891,"end":2903,"data":"(name: string,config: IOptions): any; "},{"start":2903,"end":2915,"data":"string"},{"start":2915,"end":2917,"data":"(name: string,config: IOptions): any; "},{"start":2917,"end":2933,"data":"IOptions"},{"start":2933,"end":2935,"data":"(name: string,config: IOptions): any; "},{"start":2935,"end":2941,"data":"new(host: any) => OptionsParser"},{"start":2941,"end":2953,"data":"(name: string,config: IOptions): any; "},{"start":2953,"end":2965,"data":"string"},{"start":2965,"end":2967,"data":"(name: string,config: IOptions): any; "},{"start":2967,"end":2983,"data":"IOptions"},{"start":2983,"end":2985,"data":"(name: string,config: IOptions): any; "},{"start":2985,"end":2998,"data":"string"},{"start":2998,"end":3011,"data":"(name: string,config: IOptions): any; "},{"start":3011,"end":3015,"data":"void"},{"start":3015,"end":3016,"data":"bool"},{"start":3016,"end":3022,"data":"IOptions"},{"start":3022,"end":3039,"data":"void"},{"start":3039,"end":3045,"data":"IOptions"},{"start":3045,"end":3048,"data":"any"},{"start":3048,"end":3049,"data":"IOptions"},{"start":3049,"end":3052,"data":"any"},{"start":3052,"end":3053,"data":"IOptions"},{"start":3053,"end":3058,"data":"string"},{"start":3058,"end":3059,"data":"any"},{"start":3059,"end":3073,"data":"void"},{"start":3073,"end":3078,"data":"string"},{"start":3078,"end":3081,"data":"any"},{"start":3081,"end":3085,"data":"string"},{"start":3085,"end":3086,"data":"any"},{"start":3086,"end":3097,"data":"void"},{"start":3097,"end":3109,"data":"(name: string,config: IOptions): any; "},{"start":3109,"end":3115,"data":"IOptions"},{"start":3115,"end":3128,"data":"string"},{"start":3128,"end":3138,"data":"(name: string,config: IOptions): any; "},{"start":3138,"end":3144,"data":"IOptions"},{"start":3144,"end":3159,"data":"string"},{"start":3159,"end":3169,"data":"(name: string,config: IOptions): any; "},{"start":3169,"end":3175,"data":"IOptions"},{"start":3175,"end":3187,"data":"bool"},{"start":3187,"end":3199,"data":"(name: string,config: IOptions): any; "},{"start":3199,"end":3203,"data":"OptionsParser"},{"start":3203,"end":3211,"data":"IOptions[]"},{"start":3211,"end":3217,"data":"any"},{"start":3217,"end":3223,"data":"IOptions"},{"start":3223,"end":3225,"data":"any"},{"start":3225,"end":3232,"data":"(name: string,config: IOptions): any; "},{"start":3232,"end":3244,"data":"new(host: any) => OptionsParser"},{"start":3273,"end":3278,"data":"new(host: any) => OptionsParser"},{"start":3278,"end":3297,"data":"(argString: string) => void"},{"start":3297,"end":3314,"data":"string"},{"start":3314,"end":3327,"data":"(argString: string) => void"},{"start":3327,"end":3344,"data":"number"},{"start":3344,"end":3354,"data":"(argString: string) => void"},{"start":3354,"end":3367,"data":"any"},{"start":3367,"end":3376,"data":"string"},{"start":3376,"end":3401,"data":"any"},{"start":3401,"end":3413,"data":"(argString: string) => void"},{"start":3413,"end":3444,"data":"() => any"},{"start":3444,"end":3458,"data":"any"},{"start":3458,"end":3466,"data":"number"},{"start":3466,"end":3468,"data":"any"},{"start":3468,"end":3479,"data":"() => any"},{"start":3479,"end":3491,"data":"(argString: string) => void"},{"start":3491,"end":3525,"data":"() => any"},{"start":3525,"end":3539,"data":"any"},{"start":3539,"end":3549,"data":"number"},{"start":3549,"end":3551,"data":"any"},{"start":3551,"end":3562,"data":"() => any"},{"start":3562,"end":3574,"data":"(argString: string) => void"},{"start":3574,"end":3620,"data":"() => string"},{"start":3620,"end":3635,"data":"string"},{"start":3635,"end":3649,"data":"() => string"},{"start":3649,"end":3656,"data":"() => any"},{"start":3656,"end":3659,"data":"any"},{"start":3659,"end":3660,"data":"() => string"},{"start":3683,"end":3698,"data":"() => string"},{"start":3698,"end":3710,"data":"any"},{"start":3710,"end":3714,"data":"() => any"},{"start":3714,"end":3717,"data":"any"},{"start":3717,"end":3733,"data":"() => string"},{"start":3733,"end":3740,"data":"void"},{"start":3740,"end":3745,"data":"any"},{"start":3745,"end":3749,"data":"bool"},{"start":3749,"end":3754,"data":"any"},{"start":3754,"end":3759,"data":"bool"},{"start":3759,"end":3762,"data":"string"},{"start":3762,"end":3783,"data":"void"},{"start":3783,"end":3790,"data":"() => any"},{"start":3790,"end":3793,"data":"any"},{"start":3793,"end":3813,"data":"void"},{"start":3813,"end":3822,"data":"string"},{"start":3822,"end":3827,"data":"any"},{"start":3827,"end":3828,"data":"string"},{"start":3828,"end":3848,"data":"void"},{"start":3848,"end":3856,"data":"any"},{"start":3856,"end":3860,"data":"() => any"},{"start":3860,"end":3863,"data":"any"},{"start":3863,"end":3878,"data":"void"},{"start":3878,"end":3894,"data":"() => string"},{"start":3894,"end":3901,"data":"() => any"},{"start":3901,"end":3904,"data":"any"},{"start":3904,"end":3905,"data":"() => string"},{"start":3927,"end":3942,"data":"() => string"},{"start":3942,"end":3955,"data":"string"},{"start":3955,"end":3966,"data":"() => string"},{"start":3966,"end":3978,"data":"(argString: string) => void"},{"start":3978,"end":3988,"data":"string[]"},{"start":3988,"end":3994,"data":"string"},{"start":3994,"end":4002,"data":"string[]"},{"start":4002,"end":4012,"data":"(argString: string) => void"},{"start":4012,"end":4032,"data":"string"},{"start":4032,"end":4044,"data":"(argString: string) => void"},{"start":4044,"end":4051,"data":"void"},{"start":4051,"end":4059,"data":"number"},{"start":4059,"end":4062,"data":"bool"},{"start":4062,"end":4075,"data":"any"},{"start":4075,"end":4092,"data":"void"},{"start":4092,"end":4104,"data":"any"},{"start":4104,"end":4108,"data":"() => any"},{"start":4108,"end":4111,"data":"any"},{"start":4111,"end":4131,"data":"void"},{"start":4131,"end":4136,"data":"any"},{"start":4136,"end":4141,"data":"bool"},{"start":4141,"end":4144,"data":"string"},{"start":4144,"end":4165,"data":"void"},{"start":4165,"end":4179,"data":"string"},{"start":4179,"end":4198,"data":"() => string"},{"start":4198,"end":4201,"data":"string"},{"start":4201,"end":4226,"data":"void"},{"start":4226,"end":4243,"data":"any"},{"start":4243,"end":4268,"data":"void"},{"start":4268,"end":4278,"data":"string"},{"start":4278,"end":4285,"data":"any"},{"start":4285,"end":4288,"data":"bool"},{"start":4288,"end":4289,"data":"number"},{"start":4289,"end":4314,"data":"void"},{"start":4314,"end":4318,"data":"string[]"},{"start":4318,"end":4324,"data":"any"},{"start":4324,"end":4334,"data":"string"},{"start":4334,"end":4336,"data":"any"},{"start":4336,"end":4358,"data":"void"},{"start":4358,"end":4374,"data":"string"},{"start":4374,"end":4413,"data":"void"},{"start":4413,"end":4420,"data":"() => any"},{"start":4420,"end":4423,"data":"any"},{"start":4423,"end":4463,"data":"void"},{"start":4463,"end":4470,"data":"() => any"},{"start":4470,"end":4473,"data":"any"},{"start":4473,"end":4491,"data":"void"},{"start":4491,"end":4505,"data":"string"},{"start":4505,"end":4510,"data":"any"},{"start":4510,"end":4511,"data":"string"},{"start":4511,"end":4537,"data":"void"},{"start":4537,"end":4549,"data":"(argString: string) => void"},{"start":4549,"end":4553,"data":"void"},{"start":4553,"end":4563,"data":"string"},{"start":4563,"end":4570,"data":"any"},{"start":4570,"end":4573,"data":"bool"},{"start":4573,"end":4574,"data":"number"},{"start":4574,"end":4591,"data":"void"},{"start":4591,"end":4595,"data":"string[]"},{"start":4595,"end":4601,"data":"any"},{"start":4601,"end":4611,"data":"string"},{"start":4611,"end":4613,"data":"any"},{"start":4613,"end":4624,"data":"void"},{"start":4624,"end":4636,"data":"(argString: string) => void"},{"start":4636,"end":4640,"data":"OptionsParser"},{"start":4640,"end":4646,"data":"(args: string[]) => void"},{"start":4646,"end":4647,"data":"void"},{"start":4647,"end":4651,"data":"string[]"},{"start":4651,"end":4653,"data":"void"},{"start":4653,"end":4660,"data":"(argString: string) => void"},{"start":4660,"end":4668,"data":"new(host: any) => OptionsParser"},{"start":4741,"end":4746,"data":"new(host: any) => OptionsParser"},{"start":4746,"end":4759,"data":"(args: string[]) => void"},{"start":4759,"end":4765,"data":"string[]"},{"start":4765,"end":4771,"data":"string"},{"start":4771,"end":4773,"data":"string[]"},{"start":4773,"end":4786,"data":"(args: string[]) => void"},{"start":4786,"end":4803,"data":"number"},{"start":4803,"end":4815,"data":"(args: string[]) => void"},{"start":4815,"end":4849,"data":"() => string"},{"start":4849,"end":4856,"data":"string"},{"start":4856,"end":4860,"data":"string[]"},{"start":4860,"end":4861,"data":"string"},{"start":4861,"end":4871,"data":"number"},{"start":4871,"end":4873,"data":"string"},{"start":4873,"end":4884,"data":"() => string"},{"start":4884,"end":4896,"data":"(args: string[]) => void"},{"start":4896,"end":4903,"data":"void"},{"start":4903,"end":4911,"data":"number"},{"start":4911,"end":4914,"data":"bool"},{"start":4914,"end":4918,"data":"string[]"},{"start":4918,"end":4925,"data":"any"},{"start":4925,"end":4942,"data":"void"},{"start":4942,"end":4956,"data":"string"},{"start":4956,"end":4963,"data":"() => string"},{"start":4963,"end":4966,"data":"string"},{"start":4966,"end":4980,"data":"void"},{"start":4980,"end":4992,"data":"any"},{"start":4992,"end":4999,"data":"string"},{"start":4999,"end":5025,"data":"any"},{"start":5025,"end":5039,"data":"void"},{"start":5039,"end":5056,"data":"any"},{"start":5056,"end":5076,"data":"void"},{"start":5076,"end":5081,"data":"any"},{"start":5081,"end":5106,"data":"void"},{"start":5106,"end":5112,"data":"any"},{"start":5112,"end":5113,"data":"number"},{"start":5113,"end":5114,"data":"any"},{"start":5114,"end":5119,"data":"bool"},{"start":5119,"end":5122,"data":"string"},{"start":5122,"end":5147,"data":"void"},{"start":5147,"end":5151,"data":"OptionsParser"},{"start":5151,"end":5163,"data":"(argString: string) => void"},{"start":5163,"end":5164,"data":"void"},{"start":5164,"end":5182,"data":"any"},{"start":5182,"end":5183,"data":"number"},{"start":5183,"end":5185,"data":"any"},{"start":5185,"end":5235,"data":"void"},{"start":5235,"end":5251,"data":"any"},{"start":5251,"end":5252,"data":"number"},{"start":5252,"end":5254,"data":"any"},{"start":5254,"end":5276,"data":"void"},{"start":5276,"end":5289,"data":"IOptions"},{"start":5289,"end":5293,"data":"OptionsParser"},{"start":5293,"end":5304,"data":"(arg: string) => IOptions"},{"start":5304,"end":5305,"data":"IOptions"},{"start":5305,"end":5308,"data":"any"},{"start":5308,"end":5310,"data":"IOptions"},{"start":5310,"end":5338,"data":"void"},{"start":5338,"end":5344,"data":"IOptions"},{"start":5344,"end":5349,"data":"bool"},{"start":5349,"end":5353,"data":"any"},{"start":5353,"end":5382,"data":"void"},{"start":5382,"end":5395,"data":"any"},{"start":5395,"end":5415,"data":"string"},{"start":5415,"end":5420,"data":"any"},{"start":5420,"end":5446,"data":"void"},{"start":5446,"end":5459,"data":"any"},{"start":5459,"end":5461,"data":"string"},{"start":5461,"end":5463,"data":"any"},{"start":5463,"end":5489,"data":"void"},{"start":5489,"end":5493,"data":"OptionsParser"},{"start":5493,"end":5504,"data":"() => void"},{"start":5504,"end":5567,"data":"void"},{"start":5567,"end":5568,"data":"bool"},{"start":5568,"end":5574,"data":"IOptions"},{"start":5574,"end":5579,"data":"bool"},{"start":5579,"end":5610,"data":"void"},{"start":5610,"end":5615,"data":"any"},{"start":5615,"end":5618,"data":"string"},{"start":5618,"end":5625,"data":"() => string"},{"start":5625,"end":5627,"data":"any"},{"start":5627,"end":5628,"data":"string"},{"start":5628,"end":5656,"data":"void"},{"start":5656,"end":5662,"data":"IOptions"},{"start":5662,"end":5666,"data":"(s: string) => void"},{"start":5666,"end":5667,"data":"void"},{"start":5667,"end":5672,"data":"any"},{"start":5672,"end":5756,"data":"void"},{"start":5756,"end":5760,"data":"OptionsParser"},{"start":5760,"end":5768,"data":"string[]"},{"start":5768,"end":5774,"data":"any"},{"start":5774,"end":5781,"data":"string"},{"start":5781,"end":5783,"data":"any"},{"start":5783,"end":5809,"data":"void"},{"start":5809,"end":5816,"data":"(args: string[]) => void"}] \ No newline at end of file diff --git a/tests/cases/unittests/services/dumpAST.ts b/tests/cases/unittests/services/dumpAST.ts deleted file mode 100644 index b8db724c1d3..00000000000 --- a/tests/cases/unittests/services/dumpAST.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -DumpAST.compareDumpFilesWithBaseline(); diff --git a/tests/cases/unittests/services/dumpAST/baseline-create.ts b/tests/cases/unittests/services/dumpAST/baseline-create.ts deleted file mode 100644 index 26649664545..00000000000 --- a/tests/cases/unittests/services/dumpAST/baseline-create.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -describe('dumpAST-create-baselines', function() { - describe("create test baseline files for AST source locations", function() { - it("create baseline files", function() { - DumpAST.generateBaselineFiles(); - }); - }); -}); diff --git a/tests/cases/unittests/services/getCompletionsAtPosition.ts b/tests/cases/unittests/services/getCompletionsAtPosition.ts deleted file mode 100644 index aa3e771919f..00000000000 --- a/tests/cases/unittests/services/getCompletionsAtPosition.ts +++ /dev/null @@ -1,220 +0,0 @@ -/// - -debugger; - -describe('getCompletionsAtPosition', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts'; - var fileName3 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts'; - var fileName4 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts'; - var fileName5 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts'; - var fileName6 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts'; - var fileName7 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts'; - var fileName8 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts'; - var fileName9 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts'; - var fileName10 = 'tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts'; - var fileNameBugFixes = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts'; - - typescriptLS.addFile(fileName); - typescriptLS.addFile(fileName2); - typescriptLS.addFile(fileName3); - typescriptLS.addFile(fileName4); - typescriptLS.addFile(fileName5); - typescriptLS.addFile(fileName6); - typescriptLS.addFile(fileName7); - typescriptLS.addFile(fileName8); - typescriptLS.addFile(fileName9); - typescriptLS.addFile(fileName10); - typescriptLS.addFile(fileNameBugFixes); - - var ls = typescriptLS.getLanguageService(); - - // - // line and column are 1-based - // - function lineColToPosition(fileName: string, line: number, col: number): number { - var script = ls.languageService.getScriptAST(fileName); - assert.notNull(script); - - var lineMap = script.locationInfo.lineMap; - - assert.is(line >= 1); - assert.is(col >= 1); - assert.is(line <= lineMap.length); - var offset = lineMap[line - 1] + (col - 1); - - assert.is(offset < script.limChar); - return offset; - } - - // - // line and column are 1-based - // - function getCompletionList(fileName, line, column, isMemberCompletion) { - var position = lineColToPosition(fileName, line, column); - return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); - } - - describe("test cases for completion list", function () { - - //it("contains a private variable defined in a module", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName, 45, false); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "testing" && x.type == "string"); - //}); - - //it("'this.' member completion for class containing privates", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName, 85, true); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "privMeth" && x.type == "() => void"); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubMeth" && x.type == "() => void"); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubProp" && x.type == "number"); - //}); - - //it("member completion for class containing privates, outside of class scope", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName, 203, true); - - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubMeth" && x.type == "() => void"); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pubProp" && x.type == "number"); - //}); - - //it("member completion for module-exported class containing privates, outside of class and module scopes", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName, 343, true); - // assert.notNull(result); - // assert.notNull(result.entries); - // assert.equal(true, result.isMemberCompletion); - // assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "pub" && x.type == "number"); - - //}); - - //it("member completion for dotted typeref works", function () { - // assert.equal(125, lineColToPosition(fileName2, 12, 11)); - // var result = getCompletionList(fileName2, 12, 11, true); - // assert.notEqual(null, result); - // assert.notEqual(null, result.entries); - // assert.equal(true, result.isMemberCompletion); - // assert.equal(2, result.entries.length); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Blah"; }); - //}); - - // Negative Cases - it("doesnt return anything from a comment-1", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 5), true); - assert.equal(result.isMemberCompletion, true); - assert.equal(result.entries.length, 0); - }); - - it("doesnt return anything from a comment-2", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 5), false); - assert.equal(result.isMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - it("doesnt return anything from a comment-3", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 6), true); - assert.equal(result.isMemberCompletion, true); - assert.equal(result.entries.length, 0); - }); - - it("doesnt return anything from a comment-4", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName, lineColToPosition(fileName, 23, 6), false); - assert.equal(result.isMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - it("checks for completion in comment", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName3, lineColToPosition(fileName3, 1, 4), false); - assert.equal(result.isMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - /* - it("checks for completion in var decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName3, lineColToPosition(fileName3, 2, 5), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - - it("checks for completion in class decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName4, lineColToPosition(fileName4, 1, 7), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - - it("checks for completion in module decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName5, lineColToPosition(fileName5, 1, 7), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - it("checks for completion in interface decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName6, lineColToPosition(fileName6, 1, 11), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - - - it("checks for completion in function decl", function() { - var result = ls.languageService.getCompletionsAtPosition(fileName7, lineColToPosition(fileName7, 1, 10), false); - assert.equal(result.wasMemberCompletion, false); - assert.equal(result.entries.length, 0); - }); - */ - - it("checks for completion after single dot", function () { - var result = ls.languageService.getCompletionsAtPosition(fileName8, lineColToPosition(fileName8, 1, 1), true); - assert.equal(result.isMemberCompletion, true); - assert.equal(result.entries.length, 0); - }); - - //it("checks for completion at declaration of parameter type", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName9, lineColToPosition(fileName9, 9, 17), false); - // assert.equal(result.isMemberCompletion, false); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); - //}); - - //it("checks for completion after class extends", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName9, lineColToPosition(fileName9, 5, 30), false); - // assert.equal(result.isMemberCompletion, false); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bar"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Bleah"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "Foo"; }); - //}); - - //it("checks for completion at reference to function parameter", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileName10, lineColToPosition(fileName10, 4, 31), true); - // assert.equal(result.isMemberCompletion, true); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "charAt"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "charCodeAt"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "length"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "concat"; }); - //}); - - //it("checks for completion at enum", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 7, 22), true); - // assert.equal(result.isMemberCompletion, true); - // assert.equal(result.entries.length, 2); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "bar"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "baz"; }); - //}); - - //it("checks for completion at imported enum", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 10, 9), true); - // assert.equal(result.isMemberCompletion, true); - // assert.equal(result.entries.length, 2); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "bar"; }); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "baz"; }); - //}); - - //it("checks for completion inside target typed function", function () { - // var result = ls.languageService.getCompletionsAtPosition(fileNameBugFixes, lineColToPosition(fileNameBugFixes, 15, 40), false); - // assert.equal(result.isMemberCompletion, false); - // assert.arrayContainsOnce(result.entries, function (item: Services.CompletionEntry) { return item.name === "elem" && item.type === "string"; }); - //}); - }); -}); diff --git a/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts b/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts deleted file mode 100644 index e79de723081..00000000000 --- a/tests/cases/unittests/services/getCompletionsAtPositionAfterEdits.ts +++ /dev/null @@ -1,55 +0,0 @@ -/// - -describe('getCompletionsAtPositionAfterEdits', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts'; - var fileName2 = 'otherScript.ts'; - - typescriptLS.addFile(fileName); - typescriptLS.addScript(fileName2, typescriptLS.getScriptContent(1)); - - var ls = typescriptLS.getLanguageService(); - - // - // line and column are 1-based - // - function getCompletionList(fileName: string, position: number, isMemberCompletion: boolean): Services.CompletionInfo { - return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); - } - - function typeCharacters(fileName: string, line: number, column: number, text: string): number { - var pos = typescriptLS.lineColToPosition(fileName, line, column); - for (var i = 0; i < text.length; i++) { - typescriptLS.editScript(fileName, pos, pos, text.charAt(i)); - pos++; - } - return pos; - } - - describe("test cases for completion list after edits inside source file", function () { - - it("verify function arguments are available after edits at end of function", function () { - // Apply edit - var pos = typescriptLS.lineColToPosition(fileName, 5, 13); - var text = "this.children = ch"; - typescriptLS.editScript(fileName, pos, pos, text); - var result = getCompletionList(fileName, pos + text.length - 2 /*ch*/, false); - var entry = result.entries.filter(x => x.name == "children"); - assert.notNull(entry); - assert.equal(1, entry.length); - }); - - it("verify function arguments are available after edits at end of function after multiple edits", function () { - // Apply edit - var text = "this.children = ch"; - var pos = typeCharacters(fileName2, 5, 13, text); - var result = getCompletionList(fileName2, pos - 2 /*ch*/, false); - var entry = result.entries.filter(x => x.name == "children"); - assert.notNull(entry); - assert.equal(1, entry.length); - }); - }); -}); diff --git a/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts b/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts deleted file mode 100644 index 4e1a35b81c2..00000000000 --- a/tests/cases/unittests/services/getCompletionsAtPositionObjectLiterals.ts +++ /dev/null @@ -1,100 +0,0 @@ -///// - -//describe('getCompletionsAtPositionObjectLiterals', function () { -// var typescriptls = new Harness.TypeScriptLS(); - -// typescriptls.addDefaultLibrary(); - -// var fileNameObjectLiterals = 'tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts'; - -// typescriptls.addFile(fileNameObjectLiterals); - -// var ls = typescriptls.getLanguageService(); - -// // -// // line and column are 1-based -// // -// function getCompletionList(fileName: string, line: number, column: number, isMemberCompletion: boolean): Services.CompletionInfo { -// var position = typescriptls.lineColToPosition(fileName, line, column); -// return ls.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); -// } - -// function assertIsMemberCompletions(result: Services.CompletionInfo) { -// assert.notNull(result); -// assert.is(result.isMemberCompletion, "isMemberCompletion should be set"); -// assert.is(!result.maybeInaccurate, "CompletionInfo should be accurate"); -// assert.is(result.entries.length == 2, "Completion should contain only 2 members of object literal"); -// assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "x1" && x.type == "number"); -// assert.arrayContainsOnce(result.entries, (x: Services.CompletionEntry) => x.name == "y1" && x.type == "number"); -// } - -// function assertIsGlobalCompletions(result: Services.CompletionInfo) { -// assert.notNull(result); -// assert.is(!result.isMemberCompletion, "isMemberCompletion should be not be set"); -// assert.is(!result.maybeInaccurate, "CompletionInfo should be accurate"); -// assert.is(result.entries.length >= 10, "Completion should be global completion set"); -// } - -// function assertIsNoCompletions(result: Services.CompletionInfo) { -// assert.notNull(result); -// assert.is(result.entries.length == 0, "Completion should be empty (i.e. no completion)"); -// } - -// describe("test cases for completion list inside object literals", function () { -// it("Literal member completion inside empty literal", function () { -// var result = getCompletionList(fileNameObjectLiterals, 8, 9, false); -// assertIsMemberCompletions(result); -// }); - -// it("Literal member completion for 2nd member name", function () { -// var result = getCompletionList(fileNameObjectLiterals, 13, 9, false); -// assertIsMemberCompletions(result); -// }); - -// it("Literal member completion at existing member name location", function () { -// var result = getCompletionList(fileNameObjectLiterals, 17, 9, false); -// assertIsMemberCompletions(result); -// }); - -// it("Literal member completion after existing member name location", function () { -// var result = getCompletionList(fileNameObjectLiterals, 17, 12, false); -// assertIsMemberCompletions(result); -// }); - -// }); - -// describe("test cases for global completion list inside object literals", function () { -// it("Literal member completion after member name with empty member expression and missing colon", function () { -// var result = getCompletionList(fileNameObjectLiterals, 27, 13, false); -// assertIsGlobalCompletions(result); - -// var result = getCompletionList(fileNameObjectLiterals, 28, 5, false); -// assertIsGlobalCompletions(result); -// }); - -// it("Literal member completion after member name with empty member expression", function () { -// var result = getCompletionList(fileNameObjectLiterals, 31, 13, false); -// assertIsGlobalCompletions(result); - -// var result = getCompletionList(fileNameObjectLiterals, 31, 22, false); -// assertIsGlobalCompletions(result); -// }); - -// it("No completion on '{' location", function () { -// var result = getCompletionList(fileNameObjectLiterals, 7, 23, false); -// assertIsGlobalCompletions(result); -// }); -// }); - -// describe("test cases for no completion list inside object literals", function () { -// it("No completion on comments (1)", function () { -// var result = getCompletionList(fileNameObjectLiterals, 8, 12, false); -// assertIsNoCompletions(result); -// }); - -// it("No completion on comments (2)", function () { -// var result = getCompletionList(fileNameObjectLiterals, 8, 18, false); -// assertIsNoCompletions(result); -// }); -// }); -//}); diff --git a/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts b/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts deleted file mode 100644 index d9291ed821f..00000000000 --- a/tests/cases/unittests/services/getDefinitionPositionAtPosition.ts +++ /dev/null @@ -1,193 +0,0 @@ -/// - -describe('getDefinitionPositionAtPosition', function() { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts'; - var fileName3 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts'; - - typescriptLS.addFile(fileName); - typescriptLS.addFile(fileName2); - typescriptLS.addFile(fileName3); - - var ls = typescriptLS.getLanguageService(); - - function lineToOffset(line: number, col = 0, sFile?) { - var script: TypeScript.Script; - if (sFile) { - if (sFile === 1){ - script = ls.languageService.getScriptAST(fileName); - } else if (sFile === 2) { - script = ls.languageService.getScriptAST(fileName2); - } else if (sFile === 3){ - script = ls.languageService.getScriptAST(fileName3); - } - } - else { - script = ls.languageService.getScriptAST(fileName); - } - return script.locationInfo.lineMap[line - 1] + col; - } - - function definitionAtPos(line: number, col: number) { - var result = ls.getDefinitionAtPosition(fileName, lineToOffset(line, col)); - if (result.substr(0,9) === "##ERROR##") { - return null; - } - var parts = result.split('\t'); - var defScriptIndex = parts[0]; - var defPosition = parts[1]; - return { index : defScriptIndex, pos : defPosition } - } - - function verifyDefinition(indexAndPos: {index: string; pos: string;}, line: number, col: number, fileNum: number) { - if (indexAndPos.index !== fileNum.toString()) { - throw new Error("Expected file index to be " + fileNum + " but it was " + indexAndPos.index + " instead."); - } - if (indexAndPos.pos!== lineToOffset(line, col, fileNum).toString()) { - throw new Error("Expected offset to be " + lineToOffset(line, col, fileNum).toString() + " but it was " + indexAndPos.pos + " instead."); - } - } - - describe('GoTo Definition', function() { - /* - LOCAL - */ - - it("A variable that is defined in the same file", function() { - var indexAndPos = definitionAtPos(8, 0); - verifyDefinition(indexAndPos, 2, 0, 1); - }); - - it("A function that is defined in the same file", function() { - var indexAndPos = definitionAtPos(9, 0); - verifyDefinition(indexAndPos, 3, 0, 1); - }); - - it("A class that is defined in the same file", function() { - var indexAndPos = definitionAtPos(10, 16); - verifyDefinition(indexAndPos, 4, 0, 1); - }); - - it("An interface that is defined in the same file", function() { - var indexAndPos = definitionAtPos(11, 26); - verifyDefinition(indexAndPos, 5, 0, 1); - }); - - it("A module that is defined in the same file", function() { - var indexAndPos = definitionAtPos(12, 15); - verifyDefinition(indexAndPos, 6, 0, 1); - }); - - /* - REMOTE - */ - - it("A variable that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(14, 0); - verifyDefinition(indexAndPos, 2, 0, 2); - }); - - it("A function that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(15, 0); - verifyDefinition(indexAndPos, 3, 0, 2); - }); - - it("A class that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(16, 19); - verifyDefinition(indexAndPos, 4, 0, 2); - }); - - it("An interface that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(17, 29); - verifyDefinition(indexAndPos, 5, 0, 2); - }); - - it("A module that is defined in a remote file", function() { - var indexAndPos = definitionAtPos(18, 18); - verifyDefinition(indexAndPos, 6, 0, 2); - }); - - /* - REMOTE -> REMOTE - */ - - it("A variable that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(20, 0); - verifyDefinition(indexAndPos, 1, 0, 3); - }); - - it("A function that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(21, 0); - verifyDefinition(indexAndPos, 2, 0, 3); - }); - - it("A class that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(22, 19); - verifyDefinition(indexAndPos, 3, 0, 3); - }); - - it("An interface that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(23, 29); - verifyDefinition(indexAndPos, 4, 0, 3); - }); - - it("A module that is defined in a remote file that is referenced from a remote file", function() { - var indexAndPos = definitionAtPos(24, 18); - verifyDefinition(indexAndPos, 5, 0, 3); - }); - - /* - Others - */ - - it("A shadowed variable inside a module", function() { - var indexAndPos = definitionAtPos(29, 6); - verifyDefinition(indexAndPos, 28, 4, 1); - }); - - it("A function being overloaded on global - 1", function() { - var indexAndPos = definitionAtPos(32, 9); - verifyDefinition(indexAndPos, 34, 0, 1); - }); - - it("A function being overloaded on global - 2", function() { - var indexAndPos = definitionAtPos(36, 0); - verifyDefinition(indexAndPos, 34, 0, 1); - }); - - it("Constructor being overloaded in class", function() { - var indexAndPos = definitionAtPos(40, 4); - verifyDefinition(indexAndPos, 42, 4, 1); - }); - - it("A function being overloaded in class - 1", function() { - var indexAndPos = definitionAtPos(52, 11); - verifyDefinition(indexAndPos, 54, 4, 1); - }); - - it("A static function being overloaded in class - 1", function() { - var indexAndPos = definitionAtPos(50, 11); - verifyDefinition(indexAndPos, 51, 4, 1); - }); - - it("Calling a static function of a class", function() { - var indexAndPos = definitionAtPos(63, 19); - verifyDefinition(indexAndPos, 51, 4, 1); - }); - - it("A class implementing an interface", function() { - var indexAndPos = definitionAtPos(83, 24); - verifyDefinition(indexAndPos, 78, 0, 1); - }); - - it("An ambient variable", function() { - var indexAndPos = definitionAtPos(91, 0); - verifyDefinition(indexAndPos, 89, 0, 1); - }); - }); -}); - diff --git a/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts b/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts deleted file mode 100644 index ca22c326aab..00000000000 --- a/tests/cases/unittests/services/getDefinitionPositionAtPositionPartialInterface.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// - -describe('getDefinitionPositionAtPositionPartialInterface', function() { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts'; - - typescriptLS.addFile(fileName); - typescriptLS.addFile(fileName2); - - var ls = typescriptLS.getLanguageService() - function definitionAtPos(fileName:string, line: number, col: number) { - return ls.languageService.getDefinitionAtPosition(fileName, typescriptLS.lineColToPosition(fileName, line, col)); - } - - describe('GoTo Definition', function() { - it("returns the location of the first part of a partial interface", function() { - var def = definitionAtPos(fileName2, 8, 13); - assert.notNull(def); - assert.equal(def.unitIndex, 1); - assert.equal(typescriptLS.positionToZeroBasedLineCol(fileName, def.minChar).line + 1, 2); - assert.equal(typescriptLS.positionToZeroBasedLineCol(fileName, def.minChar).col + 1, 5); - }); - }); -}); - diff --git a/tests/cases/unittests/services/getImplementorsAtPosition.ts b/tests/cases/unittests/services/getImplementorsAtPosition.ts deleted file mode 100644 index 748e1f6f1f9..00000000000 --- a/tests/cases/unittests/services/getImplementorsAtPosition.ts +++ /dev/null @@ -1,73 +0,0 @@ -/// - -describe('getImplementorsAtPosition', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts'; - - typescriptLS.addFile(fileName); - - var ls = typescriptLS.getLanguageService(); - - - function getImplementorsAtPos(fileName:string, line: number, col: number): Services.ReferenceEntry[] { - var pos = typescriptLS.lineColToPosition(fileName, line, col); - - return ls.languageService.getImplementorsAtPosition(fileName, pos); - } - - describe('Get Implementors At Position Simple Tests', function () { - it("Find derived class from base class", function() { - var result = getImplementorsAtPos(fileName, 2, 12); - assert.notNull(result); - assert.equal(2, result.length); - }); - - it("Should not find base class from derived class", function() { - var result = getImplementorsAtPos(fileName, 6, 12); - assert.notNull(result); - assert.equal(1, result.length); - }); - - it("Find derived interface from base interface", function() { - var result = getImplementorsAtPos(fileName, 13, 16); - assert.notNull(result); - assert.equal(2, result.length); - }); - - it("Should not find base interface from derived interface", function() { - var result = getImplementorsAtPos(fileName, 16, 16); - assert.notNull(result); - assert.equal(1, result.length); - }); - - it("Find dervied class from base interface", function() { - var result = getImplementorsAtPos(fileName, 22, 16); - assert.notNull(result); - assert.equal(2, result.length); - }); - - it("Should not find base interface from derived class", function() { - var result = getImplementorsAtPos(fileName, 25, 12); - assert.notNull(result); - assert.equal(1, result.length); - }); - }); - - describe('Get Implementors At Position Complex Tests', function () { - it("Find derived classes and interfaces from top level interface", function() { - var result = getImplementorsAtPos(fileName, 32, 17); - assert.notNull(result); - assert.equal(6, result.length); - }); - - it("Find derived classes and interfaces from middle interface", function() { - var result = getImplementorsAtPos(fileName, 41, 18); - assert.notNull(result); - assert.equal(4, result.length); - }); - }); -}); - diff --git a/tests/cases/unittests/services/getReferencesAtPosition.ts b/tests/cases/unittests/services/getReferencesAtPosition.ts deleted file mode 100644 index 1f3645c2046..00000000000 --- a/tests/cases/unittests/services/getReferencesAtPosition.ts +++ /dev/null @@ -1,188 +0,0 @@ -/// - -debugger; - -describe('getReferencesAtPosition', function() { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName1 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts'; - var fileName3 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts'; - var fileName4 = 'tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts'; - - typescriptLS.addFile(fileName1); - typescriptLS.addFile(fileName2); - typescriptLS.addFile(fileName3); - typescriptLS.addFile(fileName4); - - var ls = typescriptLS.getLanguageService(); - - // Returns the offset corresponding to the line + column given - function lineToOffset(line: number, col = 0, fileName?: string = fileName1) { - var script: TypeScript.Script = ls.languageService.getScriptAST(fileName); - return script.locationInfo.lineMap[line - 1] + col; - } - - describe("local get references", function() { - - it("finds references to comment", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(2, 25)); - assert.equal(1, result.split("\n").length); - }); - - it("find references to type", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(3, 15)); - var count = 0; - // Filter out the lib.d.ts - var items = result.split("\n"); - for (var i = 0; i < items.length; i++) { - if (items[i].split(" ")[0] !== "0") { - count++; - } - } - assert.equal(10, count); - }); - - it("find references to a variable declared in global", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(3, 4)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a variable declared in a class", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(8, 8)); - assert.equal(3, result.split("\n").length); - }); - - it("find references to static variable declared in a class", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(6, 16)); - assert.equal(7, result.split("\n").length); - }); - - it("find references to a variable declared in a function", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(22, 8)); - assert.equal(3, result.split("\n").length); - }); - - it("find references to a class parameter", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(15, 17)); - assert.equal(2, result.split("\n").length); - }); - - it("find references to a function parameter", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(20, 14)); - assert.equal(3, result.split("\n").length); - }); - - it("find references to a function argument", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(66, 8)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a class argument", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(65, 29)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to illegal assignment", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(75, 0)); - assert.equal(8, result.split("\n").length); - }); - - it("find references to unresolved symbol", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(76, 0)); - assert.equal(1, result.split("\n").length); - }); - - it("find references to no context", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(77, 0)); - assert.equal(1, result.split("\n").length); - }); - - it("find references to shadowed function parameter", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(79, 20)); - assert.equal(4, result.split("\n").length); - }); - - it("find reference misses function parameter", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(115, 11)); - assert.equal(3, result.split("\n").length); - }); - }); - - describe("remote get references", function() { - it("find references to a variable declared in global", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(96, 0)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a type", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(87, 23)); - assert.equal(9, result.split("\n").length); - }); - - it("find references to a function argument", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(91, 19)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a class argument", function() { - var result = ls.getReferencesAtPosition(fileName1, lineToOffset(90, 43)); - assert.equal(12, result.split("\n").length); - }); - - it("find references to a variable declared in a class", function() { - var result = ls.getReferencesAtPosition(fileName2, lineToOffset(5, 8, fileName2)); - assert.equal(3, result.split("\n").length); - }); - - it("find references to static variable declared in a class", function() { - var result = ls.getReferencesAtPosition(fileName2, lineToOffset(6, 11, fileName2)); - assert.equal(7, result.split("\n").length); - }); - }); - - describe("get references for overrides", function() { - it("find references to a field declared in a base class", function() { - var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(62, 11, fileName3)); - assert.equal(3, result.length); - }); - - it("find references to a field declared in a base interface", function() { - var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(65, 11, fileName3)); - assert.equal(3, result.length); - }); - - it("find references to a field declared in a chain of base class and interfaces", function() { - var result = ls.languageService.getReferencesAtPosition(fileName3, lineToOffset(68, 11, fileName3)); - assert.equal(6, result.length); - }); - }); - - describe("get references for statics with same names as members", function() { - it("find references to a member method with the same name as a static", function() { - /* public foo(): void */ - var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(7, 21, fileName4)); - assert.equal(3, result.length); - }); - - it("find references to a static method with the same name as a member", function() { - /* public static foo(): void */ - var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(9, 28, fileName4)); - assert.equal(2, result.length); - }); - - it("find references to a member property with the same name as a static", function() { - /* bar: Foo */ - var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(4, 14, fileName4)); - assert.equal(3, result.length); - }); - - it("find references to a static property with the same name as a member", function() { - /* static bar: Foo */ - var result = ls.languageService.getReferencesAtPosition(fileName4, lineToOffset(5, 21, fileName4)); - assert.equal(2, result.length); - }); - }); -}); diff --git a/tests/cases/unittests/services/getReferencesAtPosition2.ts b/tests/cases/unittests/services/getReferencesAtPosition2.ts deleted file mode 100644 index 4a0eb2ab1ac..00000000000 --- a/tests/cases/unittests/services/getReferencesAtPosition2.ts +++ /dev/null @@ -1,235 +0,0 @@ -/// - -function testFileForReferenceHighlighting(filename: string, expectedMissingCount ?= 0, expectedExtraCount ?= 0) { - describe( - 'The file ' + filename + ' has ' + expectedMissingCount + ' missing reference highlights and ' + expectedExtraCount + ' extra reference highlights', - function(filename: string, expectedMissingCount: number, expectedExtraCount: number) { - return function() { - validateReferencesFile(filename, expectedMissingCount, expectedExtraCount); - } - }(filename, expectedMissingCount, expectedExtraCount) - ); -} - -function validateReferencesFile(filename: string, expectedMissingCount: number, expectedExtraCount: number) { - var __typescriptLS = new Harness.TypeScriptLS(); - - // Read the input file and split it apart into sub-files - var testFile = IO.readFile(filename); - var testFileParts = splitFile(testFile); - - var testFileNames: string[] = []; - var testFileContents: string[] = []; - - // For each sub-file, add it to the project and collect its spans - var spans: Span[] = []; - var caretPositions: Span[] = []; - var i; - for(i = 0; i < testFileParts.length; i++) { - var partSpans: Span[] = []; - var partCarets: Span[] = []; - var transformedCode = extractCodeSpans(testFileParts[i], partSpans, partCarets); - - partSpans.forEach(function(sp) { - sp.fileIndex = i; - spans.push(sp); - }); - - partCarets.forEach(function(sp) { - sp.fileIndex = i; - caretPositions.push(sp); - }); - - var tempFilename = 'tempFile' + i + '.ts'; - testFileNames.push(tempFilename); - testFileContents.push(transformedCode); - __typescriptLS.addScript(tempFilename , transformedCode); - } - - // Be sure to do this last so file indices don't get off-by-n'd by the default library - __typescriptLS.addDefaultLibrary(); - testFileContents.push(Harness.Compiler.libText); - - // If there's no caret position, someone screwed up the test authoring - if(caretPositions.length === 0) { - throw new Error('No caret positions in ' + filename + ' - did you forget to add some?'); - } - - var __ls = __typescriptLS.getLanguageService(); - - for(var caretIndex = 0; caretIndex < caretPositions.length; caretIndex++) { - var caret = caretPositions[caretIndex]; - describe('Returns the correct references at caret position = ' + caret, function() { - var references = __ls.getReferencesAtPosition(testFileNames[caret.fileIndex], caret.start); - var referencesList = Span.fromReferenceLines(references); - referencesList.forEach(function(rf) { rf.getContent(testFileContents); }); - - var diff = diffLists(spans, referencesList, function(s1, s2) { return s1.equals(s2); }); - if(expectedExtraCount === 0) { - it('Has no extra highlights', function() { - assert.equal('', diff.extraItems.join(', ')); - }); - } else { - it('Has ' + expectedExtraCount + ' extra highlights', function() { - assert.equal(expectedExtraCount, diff.extraItems.length); - }); - } - - if(expectedMissingCount === 0) { - it('Has no missing highlights', function() { - assert.equal('', diff.missingItems.join(', ')); - }); - } else { - it('Has ' + expectedMissingCount + ' missing highlights', function() { - assert.equal(expectedMissingCount, diff.missingItems.length); - }); - } - }); - } -} - -interface ListDiffResult { - areIdentical: boolean; - extraItems: any[]; - missingItems: any[]; -} - -function diffLists(expected: any[], actual: any[], equals: (expct: any, actl: any) => boolean) : ListDiffResult { - var result = { areIdentical: false, extraItems: actual.slice(0), missingItems: expected.slice(0) }; - - var i, j; - for(i = 0; i < result.extraItems.length; i++) { - for(j = 0; j < result.missingItems.length; j++) { - if(equals(result.missingItems[j], result.extraItems[i])) { - result.extraItems.splice(i, 1); - result.missingItems.splice(j, 1); - i--; - break; - } - } - } - - result.areIdentical = result.extraItems.length === 0 && result.missingItems.length === 0; - return result; -} - -class Span { - constructor (public start: number, public length: number, public content: string) { } - - public fileIndex: number = null; - - public getContent(fileContents: string[]) { - this.content = fileContents[this.fileIndex].substr(this.start, this.length); - } - - static fromReferenceLine(line: string): Span { - var parts = line.split(' '); - var fileNumber = parseInt(parts[0]); - var start = parseInt(parts[1]); - var end = parseInt(parts[2]); - - var result = new Span(start, end - start, ""); - result.fileIndex = fileNumber; - return result; - } - - static fromReferenceLines(lines: string): Span[] { - var result: Span[] = []; - lines.split('\n').forEach(function(ln: string) { - if(ln) { - result.push(fromReferenceLine(ln)); - } - }); - return result; - } - - public toString(): string { - return '[File = ' + this.fileIndex + ', Start = ' + this.start + ', Length = ' + this.length + ', Content = "' + this.content + '"]'; - } - - public equals(other: Span) { - if(!other) return false; - // Don't check 'content' as that won't be populated in all cases (it's only for diagnostic purposes) - return other.start === this.start && - other.length === this.length && - other.fileIndex === this.fileIndex; - } -} - -function splitFile(contents: string): string[] { - var delimiterChar = '='; - var delimiterStr = delimiterChar + delimiterChar + delimiterChar + delimiterChar; - - var result: string[] = []; - - while(true) { - var delimIndex = contents.indexOf(delimiterStr); - if(delimIndex === -1) { - result.push(contents); - break; - } else { - result.push(contents.substr(0, delimIndex - 1)); - while(contents.charAt(delimIndex) === delimiterChar) { - delimIndex++; - } - contents = contents.substr(delimIndex); - } - } - - return result; -} - -function extractCodeSpans(code: string, outputSpans: Span[], caretPositions: Span[]): string { - var startTag = '[|'; - var endTag = '|]'; - var caretMarker = '^^'; - var result = code; - while(true) { - var caretIndex = result.indexOf(caretMarker); - var tagStartIndex = result.indexOf(startTag); - if(tagStartIndex === -1 && caretIndex === -1) break; // No more matches - - if(tagStartIndex != -1 && ((tagStartIndex < caretIndex) || (caretIndex === -1))) { - // Tag series is first - var tagEndIndex = result.indexOf(endTag, tagStartIndex + tagStartIndex.length); - if(tagEndIndex === -1) throw new Error('Unbalanced ' + startTag + '/' + endTag + ' pairs - expected to find a ' + startTag); - - var interiorStart = tagStartIndex + startTag.length; - var content = result.substr(interiorStart, tagEndIndex - interiorStart); - var contentCaretIndex = content.indexOf(caretMarker); - // Need to handle the case where there are caret[s] inside the tag markers - while(contentCaretIndex != -1) { - caretPositions.push(new Span(contentCaretIndex + tagStartIndex, 0, '')); - content = content.substring(0, contentCaretIndex) + content.substring(contentCaretIndex + caretMarker.length); - contentCaretIndex = content.indexOf(caretMarker); - } - - outputSpans.push(new Span(tagStartIndex, content.length, content)); - result = result.substr(0, tagStartIndex) + content + result.substr(tagEndIndex + endTag.length); - } else { - // Cursor marker is first - caretPositions.push(new Span(caretIndex, 0, '')); - result = result.substr(0, caretIndex) + result.substr(caretIndex + caretMarker.length); - } - } - - return result; -} - -var refFile = function(fn) { return Harness.userSpecifiedroot + 'tests/cases/unittests/services/testCode/references/' + fn; }; - -testFileForReferenceHighlighting(refFile('classLocal.ts')); - -testFileForReferenceHighlighting(refFile('classParameter.ts')); - -testFileForReferenceHighlighting(refFile('comment.ts')); - -testFileForReferenceHighlighting(refFile('functionOverloads.ts')); -testFileForReferenceHighlighting(refFile('functionParameter.ts')); - -testFileForReferenceHighlighting(refFile('illegalAssignment1.ts')); -testFileForReferenceHighlighting(refFile('illegalAssignment2.ts')); - -testFileForReferenceHighlighting(refFile('noContext.ts')); -testFileForReferenceHighlighting(refFile('referenceToClass.ts')); -testFileForReferenceHighlighting(refFile('static.ts')); diff --git a/tests/cases/unittests/services/getScriptLexicalStructure.ts b/tests/cases/unittests/services/getScriptLexicalStructure.ts deleted file mode 100644 index a9a449d6bf0..00000000000 --- a/tests/cases/unittests/services/getScriptLexicalStructure.ts +++ /dev/null @@ -1,904 +0,0 @@ -/// -describe('getScriptLexicalStructure', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts'; - - typescriptLS.addFile(fileName); - - var __ls = typescriptLS.getLanguageService(); - - - function getScriptLexicalStructure(fileName: string): Services.NavigateToItem[] { - return __ls.languageService.getScriptLexicalStructure(fileName); - } - - describe('Get script lexical structure', function () { - it("Cover all kinds of structure elements", function () { - var result = getScriptLexicalStructure(fileName); - - // Note: This baseline can be easily regenerated by taking the output of the test - // resulting from the call to "assert.equal" below. - var baseline = -[ - { - "name": "Bar", - "kind": "module", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 0, - "limChar": 1501, - "containerName": "", - "containerKind": "" - }, - { - "name": "x", - "kind": "var", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 47, - "limChar": 61, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "f", - "kind": "function", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 92, - "limChar": 114, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "IFoo", - "kind": "interface", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 139, - "limChar": 411, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "()", - "kind": "call", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 165, - "limChar": 183, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "new()", - "kind": "construct", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 212, - "limChar": 225, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "[]", - "kind": "index", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 264, - "limChar": 284, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 312, - "limChar": 324, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 363, - "limChar": 375, - "containerName": "Bar.IFoo", - "containerKind": "interface" - }, - { - "name": "Blah", - "kind": "enum", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 419, - "limChar": 491, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 440, - "limChar": 447, - "containerName": "Bar.Blah", - "containerKind": "enum" - }, - { - "name": "Bar", - "kind": "class", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 499, - "limChar": 1498, - "containerName": "Bar", - "containerKind": "module" - }, - { - "name": "constructor", - "kind": "constructor", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 520, - "limChar": 556, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barVar", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 532, - "limChar": 551, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barProp", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 597, - "limChar": 620, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barPropFunc", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 672, - "limChar": 702, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "getter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 747, - "limChar": 775, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "setter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 822, - "limChar": 844, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barPropP", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 899, - "limChar": 924, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "barPropFuncP", - "kind": "method", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 974, - "limChar": 1006, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "getter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1049, - "limChar": 1079, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "setter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1124, - "limChar": 1148, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1201, - "limChar": 1220, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1276, - "limChar": 1298, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "getter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1351, - "limChar": 1378, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "setter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1426, - "limChar": 1447, - "containerName": "Bar.Bar", - "containerKind": "class" - }, - { - "name": "Bar2", - "kind": "module", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1505, - "limChar": 3051, - "containerName": "", - "containerKind": "" - }, - { - "name": "x", - "kind": "var", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1560, - "limChar": 1581, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "f", - "kind": "function", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1613, - "limChar": 1642, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "IFoo", - "kind": "interface", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1668, - "limChar": 1947, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "()", - "kind": "call", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1701, - "limChar": 1719, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "new()", - "kind": "construct", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1748, - "limChar": 1761, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "[]", - "kind": "index", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1800, - "limChar": 1820, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1848, - "limChar": 1860, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1899, - "limChar": 1911, - "containerName": "Bar2.IFoo", - "containerKind": "interface" - }, - { - "name": "Blah", - "kind": "enum", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1955, - "limChar": 2034, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 1983, - "limChar": 1990, - "containerName": "Bar2.Blah", - "containerKind": "enum" - }, - { - "name": "Bar", - "kind": "class", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2042, - "limChar": 3048, - "containerName": "Bar2", - "containerKind": "module" - }, - { - "name": "constructor", - "kind": "constructor", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2070, - "limChar": 2106, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barVar", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2082, - "limChar": 2101, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barProp", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2147, - "limChar": 2170, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barPropFunc", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2222, - "limChar": 2252, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "getter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2297, - "limChar": 2325, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "setter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2372, - "limChar": 2394, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barPropP", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2449, - "limChar": 2474, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "barPropFuncP", - "kind": "method", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2524, - "limChar": 2556, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "getter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2599, - "limChar": 2629, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "setter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2674, - "limChar": 2698, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2751, - "limChar": 2770, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2826, - "limChar": 2848, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "getter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2901, - "limChar": 2928, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "setter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 2976, - "limChar": 2997, - "containerName": "Bar2.Bar", - "containerKind": "class" - }, - { - "name": "Bar3", - "kind": "module", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3057, - "limChar": 3083, - "containerName": "", - "containerKind": "" - }, - { - "name": "Bar4", - "kind": "module", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3087, - "limChar": 4611, - "containerName": "", - "containerKind": "" - }, - { - "name": "x", - "kind": "var", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3134, - "limChar": 3156, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "f", - "kind": "function", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3179, - "limChar": 3206, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "IFoo", - "kind": "interface", - "kindModifiers": "", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3226, - "limChar": 3506, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "()", - "kind": "call", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3260, - "limChar": 3278, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "new()", - "kind": "construct", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3307, - "limChar": 3320, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "[]", - "kind": "index", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3359, - "limChar": 3379, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3407, - "limChar": 3419, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3458, - "limChar": 3470, - "containerName": "Bar4.IFoo", - "containerKind": "interface" - }, - { - "name": "Blah", - "kind": "enum", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3514, - "limChar": 3594, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "export", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3543, - "limChar": 3550, - "containerName": "Bar4.Blah", - "containerKind": "enum" - }, - { - "name": "Bar", - "kind": "class", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3602, - "limChar": 4608, - "containerName": "Bar4", - "containerKind": "module" - }, - { - "name": "constructor", - "kind": "constructor", - "kindModifiers": "declare", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3631, - "limChar": 3665, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barVar", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3644, - "limChar": 3663, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barProp", - "kind": "property", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3707, - "limChar": 3730, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barPropFunc", - "kind": "method", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3782, - "limChar": 3809, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "getter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3857, - "limChar": 3882, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "prop1", - "kind": "setter", - "kindModifiers": "public", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 3932, - "limChar": 3951, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barPropP", - "kind": "property", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4009, - "limChar": 4034, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "barPropFuncP", - "kind": "method", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4084, - "limChar": 4113, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "getter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4159, - "limChar": 4186, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "prop1P", - "kind": "setter", - "kindModifiers": "private", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4234, - "limChar": 4255, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "foo", - "kind": "property", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4311, - "limChar": 4330, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "bar", - "kind": "method", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4386, - "limChar": 4405, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "getter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4461, - "limChar": 4485, - "containerName": "Bar4.Bar", - "containerKind": "class" - }, - { - "name": "foo2", - "kind": "setter", - "kindModifiers": "public,static", - "matchKind": "exact", - "unitIndex": 1, - "minChar": 4536, - "limChar": 4554, - "containerName": "Bar4.Bar", - "containerKind": "class" - } -]; - var baselineText = JSON.stringify(baseline, null, " "); - var resultText = JSON.stringify(result, null, " "); - assert.notNull(result); - assert.equal(79, result.length); - assert.equal(baselineText, resultText); - }); - }); -}); - diff --git a/tests/cases/unittests/services/getSignatureAtPosition.ts b/tests/cases/unittests/services/getSignatureAtPosition.ts deleted file mode 100644 index 72bbf8ba657..00000000000 --- a/tests/cases/unittests/services/getSignatureAtPosition.ts +++ /dev/null @@ -1,493 +0,0 @@ -/// - -describe('getSignatureAtPosition', function () { - var mytypescriptLS = new Harness.TypeScriptLS(); - - mytypescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts'; - - mytypescriptLS.addFile(fileName); - mytypescriptLS.addFile(fileName2); - - var myls = mytypescriptLS.getLanguageService(); - - function singatureAtPos(line: number, col: number): Services.SignatureInfo { - return myls.languageService.getSignatureAtPosition(fileName, mytypescriptLS.lineColToPosition(fileName, line, col)); - } - - function singatureAtPos2(line: number, col: number): Services.SignatureInfo { - return myls.languageService.getSignatureAtPosition(fileName2, mytypescriptLS.lineColToPosition(fileName2, line, col)); - } - - describe('Get signatures from position', function () { - it("Comment", function () { - var result = singatureAtPos(1, 4); - assert.equal(null, result); - }); - - it("No Context", function () { - var result = singatureAtPos(2, 1); - assert.equal(null, result); - }); - - it("Construct expression", function () { - var result = singatureAtPos(3, 23); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("sampleCls", formal.name); - assert.equal(1, formal.signatureGroup.length); - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("str", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("num", formal.signatureGroup[0].parameters[1].name); - assert.equal("number", formal.signatureGroup[0].parameters[1].type); - assert.equal("sampleCls", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 22), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 29), actual.closeParenLimChar); - assert.equal(2, actual.parameters.length); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 23), actual.parameters[0].minChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 25), actual.parameters[0].limChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 27), actual.parameters[1].minChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 3, 28), actual.parameters[1].limChar); - - assert.equal(0, result.activeFormal); - }); - - it("Wrong context", function () { - var result = singatureAtPos(4, 11); - assert.equal(null, result); - }); - - it("Call expression", function () { - var result = singatureAtPos(7, 8); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("fnTest", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("str", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("num", formal.signatureGroup[0].parameters[1].name); - assert.equal("number", formal.signatureGroup[0].parameters[1].type); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 7, 7), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 7, 9), actual.closeParenLimChar); - assert.equal(0, actual.parameters.length); - - assert.equal(-1, result.activeFormal); - }); - - it("Overloaded function", function () { - var result = singatureAtPos(11, 12); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("fnOverload", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("any", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("test", formal.signatureGroup[1].parameters[0].name); - assert.equal("string", formal.signatureGroup[1].parameters[0].type); - assert.equal("any", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 11, 11), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 11, 13), actual.closeParenLimChar); - assert.equal(0, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Overloaded function 2", function () { - var result = singatureAtPos(12, 12); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("fnOverload", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("any", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("test", formal.signatureGroup[1].parameters[0].name); - assert.equal("string", formal.signatureGroup[1].parameters[0].type); - assert.equal("any", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 11), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 15), actual.closeParenLimChar); - assert.equal(1, actual.parameters.length); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 12), actual.parameters[0].minChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 12, 14), actual.parameters[0].limChar); - - assert.equal(1, result.activeFormal); - }); - - it("Overloaded construct - before open paren", function () { - var result = singatureAtPos(15, 24); - assert.equal(null, result); - }); - - it("Overloaded construct - after close paren", function () { - var result = singatureAtPos(15, 26); - assert.equal(null, result); - }); - - it("Overloaded construct", function () { - var result = singatureAtPos(15, 25); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("clsOverload", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("clsOverload", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("test", formal.signatureGroup[1].parameters[0].name); - assert.equal("string", formal.signatureGroup[1].parameters[0].type); - assert.equal("clsOverload", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 15, 24), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 15, 26), actual.closeParenLimChar); - - assert.equal(0, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Overloaded construct: call second overload", function () { - var result = singatureAtPos(16, 25); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("clsOverload", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("clsOverload", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("test", formal.signatureGroup[1].parameters[0].name); - assert.equal("string", formal.signatureGroup[1].parameters[0].type); - assert.equal("clsOverload", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 24), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 28), actual.closeParenLimChar); - - assert.equal(1, actual.parameters.length); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 25), actual.parameters[0].minChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 16, 27), actual.parameters[0].limChar); - - assert.equal(1, result.activeFormal); - }); - - it("Incomplete call (with statements after the incomple call)", function () { - var result = singatureAtPos(31, 14); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("f1", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(0, formal.signatureGroup[0].parameters.length); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 31, 13), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); - - assert.equal(1, actual.parameters.length); - - assert.equal(-1, result.activeFormal); - }); - - it("Incomplete call 2 (inside another incomplete call)", function () { - var result = singatureAtPos(32, 14); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("f2", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(1, formal.signatureGroup[0].parameters.length); - assert.equal("n", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 32, 13), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(-1, result.activeFormal); - }); - - it("Incomplete call 3 (close curly after incomplete call)", function () { - var result = singatureAtPos(33, 14); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("f3", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("n", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("s", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 33, 13), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 34, 10), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Calling off a parameter function", function () { - var result = singatureAtPos(44, 22); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("callback", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("a", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("b", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("string", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 44, 21), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 44, 28), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Calling off a returned function", function () { - var result = singatureAtPos(53, 15); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("a", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("b", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("string", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 53, 14), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 53, 21), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Calling off a object literal property function", function () { - var result = singatureAtPos(58, 9); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("f", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("a", formal.signatureGroup[0].parameters[0].name); - assert.equal("number", formal.signatureGroup[0].parameters[0].type); - assert.equal("b", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("string", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 58, 8), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 58, 15), actual.closeParenLimChar); - - assert.equal(2, actual.parameters.length); - - assert.equal(0, result.activeFormal); - }); - - it("Calling off super constructor", function() { - var result = singatureAtPos(69, 19); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("base", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(1, formal.signatureGroup[0].parameters.length); - assert.equal("s", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("base", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("n", formal.signatureGroup[1].parameters[0].name); - assert.equal("number", formal.signatureGroup[1].parameters[0].type); - assert.equal("base", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 69, 18), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 69, 22), actual.closeParenLimChar); - - assert.equal(1, actual.parameters.length); - assert.equal(0, result.activeFormal); - }); - - it("Calling off super of super constructor", function() { - var result = singatureAtPos(79, 19); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("B2", formal.name); - assert.equal(2, formal.signatureGroup.length); - - assert.equal(1, formal.signatureGroup[0].parameters.length); - assert.equal("s", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("B2", formal.signatureGroup[0].returnType); - - assert.equal(1, formal.signatureGroup[1].parameters.length); - assert.equal("n", formal.signatureGroup[1].parameters[0].name); - assert.equal("number", formal.signatureGroup[1].parameters[0].type); - assert.equal("B2", formal.signatureGroup[1].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName, 79, 18), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName, 79, 22), actual.closeParenLimChar); - - assert.equal(1, actual.parameters.length); - assert.equal(0, result.activeFormal); - }); - }); - - describe('Get signatures at EOF', function () { - it("Function signature at EOF", function () { - var result = singatureAtPos2(5, 5); - assert.notNull(result); - - var formal = result.formal; - assert.notNull(formal); - - assert.equal(false, formal.isNew); - assert.equal("Foo", formal.name); - assert.equal(1, formal.signatureGroup.length); - - assert.equal(2, formal.signatureGroup[0].parameters.length); - assert.equal("arg1", formal.signatureGroup[0].parameters[0].name); - assert.equal("string", formal.signatureGroup[0].parameters[0].type); - assert.equal("arg2", formal.signatureGroup[0].parameters[1].name); - assert.equal("string", formal.signatureGroup[0].parameters[1].type); - assert.equal("void", formal.signatureGroup[0].returnType); - - var actual = result.actual; - assert.notNull(actual); - - assert.equal(mytypescriptLS.lineColToPosition(fileName2, 5, 4), actual.openParenMinChar); - assert.equal(mytypescriptLS.lineColToPosition(fileName2, 5, 5), actual.closeParenLimChar); - assert.equal(0, actual.currentParameter); - - assert.equal(1, actual.parameters.length); - - assert.equal(-1, result.activeFormal); - }); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/services/incrementalParser.ts b/tests/cases/unittests/services/incrementalParser.ts deleted file mode 100644 index 2cb20b0c9f2..00000000000 --- a/tests/cases/unittests/services/incrementalParser.ts +++ /dev/null @@ -1,103 +0,0 @@ -/// - -module IncrementalParserTest { - export class State { - private fileName: string; - private typescriptLS: Harness.TypeScriptLS; - private ls: Services.ILanguageServiceShim; - private logger: TypeScript.BufferedLogger; - private parser: TypeScript.IncrementalParser; - private script: TypeScript.Script; - private newSourceText: TypeScript.IScriptSnapshot; - - public applyEditInRange(fileName, startLine, startCol, endLine, endCol, newText) { - this.initFileName(fileName); - - var result = this.applyIncrementalParser(startLine, startCol, endLine, endCol, newText); - if (result === null) { - var sep = "\r\n | "; - throw new Error("Incremental parser should not have bailed out:" + sep + this.logger.logContents.join(sep)); - } - - this.assertTreesAreEqual(result); - } - - public assertBailout(fileName, startLine, startCol, endLine, endCol, newText) { - this.initFileName(fileName); - var result = this.applyIncrementalParser(startLine, startCol, endLine, endCol, newText); - assert.is(result == null, "Incremental parser should have bailed out"); - } - - private applyIncrementalParser(startLine, startCol, endLine, endCol, newText): TypeScript.UpdateUnitResult { - var fileName = this.fileName; - var offset1 = this.typescriptLS.lineColToPosition(fileName, startLine, startCol); - var offset2 = this.typescriptLS.lineColToPosition(fileName, endLine, endCol); - var textEdit = new Services.TextEdit(offset1, offset2, newText); - var newContent = this.typescriptLS.applyEdits(this.typescriptLS.getScriptContent(1), [textEdit]); - this.newSourceText = new TypeScript.StringScriptSnapshot(newContent); - - var result = this.parser.attemptIncrementalUpdateUnit(this.script, fileName, this.newSourceText, - new TypeScript.TextChangeRange(TypeScript.TextSpan.fromBounds(offset1, offset2), newText.length)); - return result; - } - - private initFileName(fileName: string) { - this.fileName = fileName; - this.typescriptLS = this.createLS(fileName); - this.ls = this.typescriptLS.getLanguageService(); - this.logger = new TypeScript.BufferedLogger(); - this.parser = new TypeScript.IncrementalParser(this.logger); - this.script = this.ls.languageService.getScriptAST(fileName); - assert.notNull(this.script); - } - - private assertTreesAreEqual(result: TypeScript.UpdateUnitResult) { - assert.notNull(result); - this.parser.mergeTrees(result); - - var finalScript = result.script1; - var nonIncrementalScript = this.typescriptLS.parseSourceText(this.fileName, this.newSourceText); - - var logger1 = new TypeScript.BufferedLogger(); - var astLogger1 = new TypeScript.AstLogger(logger1); - astLogger1.logScript(finalScript); - - var logger2 = new TypeScript.BufferedLogger(); - var astLogger2 = new TypeScript.AstLogger(logger2); - astLogger2.logScript(nonIncrementalScript); - - var log1 = logger1.logContents.join("\r\n"); - var log2 = logger2.logContents.join("\r\n"); - - assert.noDiff(log1, log2); - } - - private createLS(fileName: string): Harness.TypeScriptLS { - var typescriptLS = new Harness.TypeScriptLS(); - typescriptLS.addDefaultLibrary(); - typescriptLS.addFile(fileName); - return typescriptLS; - } - } -} - -describe('incrementalParser tests', function () { - var fileName = 'tests/cases/unittests/services/testCode/incrementalParser.ts'; - var fileName2 = 'tests/cases/unittests/services/testCode/incrementalParser2.ts'; - - - describe('Incremental edits to unit', function () { - it("Simple delete inside a function should be incremental", function () { - new IncrementalParserTest.State().applyEditInRange(fileName, 10, 5, 10, 39, ""); - }); - it("Simple insert inside a function should be incremental", function () { - new IncrementalParserTest.State().applyEditInRange(fileName, 10, 5, 10, 6, "test-test-test"); - }); - }); - - describe('Bail out tests', function () { - it("Adding semicolon at end of interface function should force bailout", function () { - new IncrementalParserTest.State().assertBailout(fileName2, 4, 16, 4, 16, ";"); - }); - }); -}); \ No newline at end of file diff --git a/tests/cases/unittests/services/overridesCollector.ts b/tests/cases/unittests/services/overridesCollector.ts deleted file mode 100644 index 13251f5df66..00000000000 --- a/tests/cases/unittests/services/overridesCollector.ts +++ /dev/null @@ -1,82 +0,0 @@ -/// - -describe('overridesCollector', function () { - var typescriptLS = new Harness.TypeScriptLS(); - - typescriptLS.addDefaultLibrary(); - - var fileName = 'tests/cases/unittests/services/testCode/overridesCollector.ts'; - - typescriptLS.addFile(fileName); - - var ls = typescriptLS.getLanguageService(); - - - function getOverridesAtPos(fileName:string, line: number, col: number): Services.SymbolSet { - var pos = typescriptLS.lineColToPosition(fileName, line, col); - - var script = ls.languageService.getScriptAST(fileName); - assert.notNull(script); - - var sym = ls.languageService.getSymbolAtPosition(script, pos); - assert.notNull(sym); - - var symbolTree = ls.languageService.getSymbolTree(); - assert.notNull(symbolTree); - - var collector = new Services.OverridesCollector(symbolTree); - return collector.findMemberOverrides(sym); - } - - describe('Overrides Collector Simple Tests', function () { - it("Find method override from base class", function() { - var result = getOverridesAtPos(fileName, 3, 17); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find method override from derived class", function() { - var result = getOverridesAtPos(fileName, 7, 17); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find method override from derived interface", function() { - var result = getOverridesAtPos(fileName, 17, 10); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find method override from base interface", function() { - var result = getOverridesAtPos(fileName, 14, 10); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find interface method override from derived class", function() { - var result = getOverridesAtPos(fileName, 26, 17); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - - it("Find interface method override from base interface", function() { - var result = getOverridesAtPos(fileName, 23, 11); - assert.notNull(result); - assert.equal(2, result.getAll().length); - }); - }); - describe('Overrides Collector Complex Tests', function () { - it("Find field override in deep hierarchy", function() { - var result = getOverridesAtPos(fileName, 42, 12); - assert.notNull(result); - assert.equal(5, result.getAll().length); - }); - - it("Find method override in deep hierarchy", function() { - var result = getOverridesAtPos(fileName, 46, 13); - assert.notNull(result); - assert.equal(3, result.getAll().length); - }); - }); -}); - diff --git a/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts b/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts deleted file mode 100644 index 92be52aa947..00000000000 --- a/tests/cases/unittests/services/testCode/getBraceMatchingAtPosition.ts +++ /dev/null @@ -1,27 +0,0 @@ -module Foo { - class Bar { - private f() { - var a:any[] = [[1, 2], [3, 4], 5]; - return ((1 + 1)); - } - - private f2() { - if(true) { }{ }; - } - } -} - - -// { } -// ( ) -// [ ] -// < > - -class TemplateTest { - public foo(a, b) { - return a; - } - public bar(a, b) { - return a < b || a > b; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts deleted file mode 100644 index 41e46ea0628..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition1.ts +++ /dev/null @@ -1,23 +0,0 @@ -module Foo { var testing = ""; test } - -class C1 { - public pubMeth() {this.} // test on 'this.' - private privMeth() {} - public pubProp = 0; - private privProp = 0; -} - -var f = new C1(); -f. // test on F. -module M { - export class C { public pub = 0; private priv = 1; } - export var V = 0; -} - - -var c = new M.C(); - -c. // test on c. - -//Test for comment -//c. \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts deleted file mode 100644 index 478027ee2ca..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition10.ts +++ /dev/null @@ -1,5 +0,0 @@ -module Test10 -{ - var x: string[] = []; - x.forEach(function(y) { y. }); -} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts deleted file mode 100644 index 9cad47b6d6e..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition2.ts +++ /dev/null @@ -1,12 +0,0 @@ -module Foo { - export class Bar { - - } - - - export module Blah { - - } -} - -var x:Foo. diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts deleted file mode 100644 index d1416fad86f..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition3.ts +++ /dev/null @@ -1,2 +0,0 @@ -// -var \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts deleted file mode 100644 index 56150d40069..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition4.ts +++ /dev/null @@ -1,4 +0,0 @@ -class -{ - -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts deleted file mode 100644 index a5a89ed024d..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition5.ts +++ /dev/null @@ -1,3 +0,0 @@ -module -{ -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts deleted file mode 100644 index 29a9a9d3b14..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition6.ts +++ /dev/null @@ -1 +0,0 @@ -interface \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts deleted file mode 100644 index fe6292bfdbb..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition7.ts +++ /dev/null @@ -1 +0,0 @@ -function \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts deleted file mode 100644 index 5109df29b73..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition8.ts +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts deleted file mode 100644 index 37369dc33fb..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPosition9.ts +++ /dev/null @@ -1,10 +0,0 @@ -module Bar -{ - export class Bleah { - } - export class Foo extends Bleah { - } -} - -function Blah(x:Bar.Bleah) { -} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts deleted file mode 100644 index 9cc47b34ee6..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPositionAfterEdits.ts +++ /dev/null @@ -1,8 +0,0 @@ -module Test1 { - class Person { - children: string[]; - constructor (public name:string, children:string[]) { - - } - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts deleted file mode 100644 index 08d056b6b6e..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPositionBugFixes.ts +++ /dev/null @@ -1,16 +0,0 @@ -module BugFixes { - enum Foo { - bar, - baz - } - - var f: Foo = Foo./*here*/; - - import foo f = Foo; - foo./*here*/; -} - -module BugFix2 { - interface iFace { (event: string); } - var foo: iFace = function (elem) { /*here*/ } -} diff --git a/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts b/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts deleted file mode 100644 index d127a8a34bd..00000000000 --- a/tests/cases/unittests/services/testCode/getCompletionsAtPositionObjectLiterals.ts +++ /dev/null @@ -1,33 +0,0 @@ -module ObjectLiterals { - interface MyPoint { - x1: number; - y1: number; - } - - var p1: MyPoint = { - /*here*/ - }; - - var p2: MyPoint = { - x1: 5, - /*here*/ - }; - - var p3: MyPoint = { - x1 /*here*/ - }; - - var p4: MyPoint = { - x1: 5, - y1 /*here*/ : 6 - }; - - // Negative cases (global completion) - var n4: MyPoint = { - x1: /*here*/ - }; - - var n2: MyPoint = { - x1: /*here*/, - }; -} diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts deleted file mode 100644 index 5228083a667..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition.ts +++ /dev/null @@ -1,91 +0,0 @@ -/// -var locVar; -function locFn() { } -class locCls { } -interface locInt{ } -module locMod{ export var foo = 1;} - -locVar = 1; -locFn(); -var foo = new locCls(); -class fooCls implements locInt { } -var fooVar = locMod.foo; - -remVar = 1; -remFn(); -var remfoo = new remCls(); -class remfooCls implements remInt { } -var remfooVar = remMod.foo; - -rem2Var = 1; -rem2Fn(); -var rem2foo = new rem2Cls(); -class rem2fooCls implements rem2Int { } -var rem2fooVar = rem2Mod.foo; - -var shdVar = "foo"; -module shdModule { - var shdVar; - shdVar = 1; -} - -function fnOverload( ); -function fnOverload(foo: string); -function fnOverload(foo: any) { }; - -fnOverload(); -fnOverload("test"); - -class clsOverload { - constructor (); - constructor (foo: string); - constructor (foo: any) { } -}; - -var clsOverloadVar = new clsOverload(); -clsOverloadVar = new clsOverload("test"); - -class clsInOverload { - static fnOverload( ); - static fnOverload(foo: string); - static fnOverload(foo: any) { }; - public fnOverload():any; - public fnOverload(foo: string); - public fnOverload(foo: any) { return "foo" }; - public fnOverload1():any; - public fnOverload1(foo: string); - public fnOverload1(foo: any) { return "foo" }; - - constructor () { } -} - -clsInOverload.fnOverload(); -clsInOverload.fnOverload("test"); - -var clsInOverloadVar = new clsInOverload(); -var foo3 = clsInOverloadVar.fnOverload(); -foo3 = clsInOverloadVar.fnOverload("test"); - -function fnInOverload() { - static fnOverload():any; - static fnOverload(foo: string); - static fnOverload(foo: any){ return "foo" }; -} - -fnInOverload.fnOverload(); -fnInOverload.fnOverload("test"); - -interface sInt { - sVar: number; - sFn: () => void; -} - -class iClass implements sInt { - public sVar = 1; - public sFn() { - } -} - -declare var ambientVar; - -ambientVar = 1; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts deleted file mode 100644 index ebee920b984..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition2.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -var remVar; -function remFn() { } -class remCls { } -interface remInt{ } -module remMod{ export var foo;} diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts deleted file mode 100644 index 23005628529..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPosition3.ts +++ /dev/null @@ -1,5 +0,0 @@ -var rem2Var; -function rem2Fn() { } -class rem2Cls { } -interface rem2Int{ } -module rem2Mod{ export var foo; } diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts deleted file mode 100644 index f251b2c5b0a..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface1.ts +++ /dev/null @@ -1,5 +0,0 @@ -module A { - export interface IA { - y: string; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts b/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts deleted file mode 100644 index 39a1e7fbf46..00000000000 --- a/tests/cases/unittests/services/testCode/getDefinitionsAtPositionPartialInterface2.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -module A { - export interface IA { - x: number; - } - - var x: IA; -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts b/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts deleted file mode 100644 index 1791e1395f4..00000000000 --- a/tests/cases/unittests/services/testCode/getImplementorsAtPosition.ts +++ /dev/null @@ -1,57 +0,0 @@ -module SimpleClassTest { - class Foo { - public foo(): void { - } - } - class Bar extends Foo { - public foo(): void { - } - } -} - -module SimpleInterfaceTest { - interface IFoo { - foo(): void; - } - interface IBar extends IFoo { - foo(): void; - } -} - -module SimpleClassInterfaceTest { - interface IFoo { - foo(): void; - } - class Bar implements IFoo { - public foo(): void { - } - } -} - -module Test { - interface IBase { - field: string; - method(): void; - } - - interface IBlah extends IBase { - field: string; - } - - interface IBlah2 extends IBlah { - field: string; - } - - interface IDerived extends IBlah2 { - method(): void; - } - - class Bar implements IDerived { - public field: string; - public method(): void { } - } - - class BarBlah extends Bar { - public field: string; - } -} diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts deleted file mode 100644 index 4014f438809..00000000000 --- a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest.ts +++ /dev/null @@ -1,117 +0,0 @@ -/// -// Comment Refence Test: globalVar -var globalVar: number = 2; - -class fooCls { - static clsSVar = 1; - //Declare - clsVar = 1; - - constructor (public clsParam: number) { - //Increments - globalVar++; - this.clsVar++; - fooCls.clsSVar++; - this.clsParam++; - modTest.modVar++; - } -} - -function foo(x: number) { - //Declare - var fnVar = 1; - - //Increments - fooCls.clsSVar++; - globalVar++; - modTest.modVar++; - fnVar++; - - //Return - return x++; -} - -module modTest { - //Declare - export var modVar:number; - - //Increments - globalVar++; - fooCls.clsSVar++; - modVar++; - - class testCls { - static boo = foo; - } - - function testFn(){ - static boo = foo; - - //Increments - globalVar++; - fooCls.clsSVar++; - modVar++; - } - - module testMod { - var boo = foo; - } -} - -//Type test -var clsTest: fooCls; - -//Arguments -clsTest = new fooCls(globalVar); -foo(globalVar); - -//Increments -fooCls.clsSVar++; -modTest.modVar++; -globalVar = globalVar + globalVar; - -//ETC - Other cases -globalVar = 3; -foo = foo + 1; -err = err++; - -//Shadowed fn Parameter -function shdw(globalVar: number) { - //Increments - globalVar++; - return globalVar; -} - -//Remotes -//Type test -var remoteclsTest: remotefooCls; - -//Arguments -remoteclsTest = new remotefooCls(remoteglobalVar); -remotefoo(remoteglobalVar); - -//Increments -remotefooCls.remoteclsSVar++; -remotemodTest.remotemodVar++; -remoteglobalVar = remoteglobalVar + remoteglobalVar; - -//ETC - Other cases -remoteglobalVar = 3; - -//Find References misses method param -var - - - - array = ["f", "o", "o"]; - -array.forEach( - - -function(str) { - - - - return str + " "; - -}); diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts deleted file mode 100644 index 67aa438a639..00000000000 --- a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest2.ts +++ /dev/null @@ -1,59 +0,0 @@ -var remoteglobalVar: number = 2; - -class remotefooCls { - //Declare - remoteclsVar = 1; - static remoteclsSVar = 1; - - constructor (public remoteclsParam: number) { - //Increments - remoteglobalVar++; - this.remoteclsVar++; - remotefooCls.remoteclsSVar++; - this.remoteclsParam++; - remotemodTest.remotemodVar++; - } -} - -function remotefoo(remotex: number) { - //Declare - var remotefnVar = 1; - - //Increments - remotefooCls.remoteclsSVar++; - remoteglobalVar++; - remotemodTest.remotemodVar++; - remotefnVar++; - - //Return - return remotex++; -} - -module remotemodTest { - //Declare - export var remotemodVar:number; - - //Increments - remoteglobalVar++; - remotefooCls.remoteclsSVar++; - remotemodVar++; - - class remotetestCls { - static remoteboo = remotefoo; - } - - function remotetestFn(){ - static remoteboo = remotefoo; - - //Increments - remoteglobalVar++; - remotefooCls.remoteclsSVar++; - remotemodVar++; - } - - module remotetestMod { - var remoteboo = remotefoo; - } -} - - diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts deleted file mode 100644 index 4dd668b29b1..00000000000 --- a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest3.ts +++ /dev/null @@ -1,70 +0,0 @@ -module FindRef3 { - module SimpleClassTest { - export class Foo { - public foo(): void { - } - } - export class Bar extends Foo { - public foo(): void { - } - } - } - - module SimpleInterfaceTest { - export interface IFoo { - foo(): void; - } - export interface IBar extends IFoo { - foo(): void; - } - } - - module SimpleClassInterfaceTest { - export interface IFoo { - foo(): void; - } - export class Bar implements IFoo { - public foo(): void { - } - } - } - - module Test { - export interface IBase { - field: string; - method(): void; - } - - export interface IBlah extends IBase { - field: string; - } - - export interface IBlah2 extends IBlah { - field: string; - } - - export interface IDerived extends IBlah2 { - method(): void; - } - - export class Bar implements IDerived { - public field: string; - public method(): void { } - } - - export class BarBlah extends Bar { - public field: string; - } - } - - function test() { - var x = new SimpleClassTest.Bar(); - x.foo(); - - var y: SimpleInterfaceTest.IBar = null; - y.foo(); - - var z = new Test.BarBlah(); - z.field = ""; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts b/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts deleted file mode 100644 index 4f705e721e8..00000000000 --- a/tests/cases/unittests/services/testCode/getReferencesAtPositionTest4.ts +++ /dev/null @@ -1,28 +0,0 @@ -module FindRef4 { - module MixedStaticsClassTest { - export class Foo { - bar: Foo; - static bar: Foo; - - public foo(): void { - } - public static foo(): void { - } - } - } - - function test() { - // instance function - var x = new MixedStaticsClassTest.Foo(); - x.foo(); - x.bar; - - var y = new MixedStaticsClassTest.Foo(); - y.foo(); - y.bar; - - // static function - MixedStaticsClassTest.Foo.foo(); - MixedStaticsClassTest.Foo.bar; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts b/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts deleted file mode 100644 index afac9249cc0..00000000000 --- a/tests/cases/unittests/services/testCode/getScriptLexicalStructure.ts +++ /dev/null @@ -1,112 +0,0 @@ -module Bar { // Module - var x: number; // Variable - function f(): void { } // Function - - interface IFoo { - (i: number): IFoo; // CallSignature - new (): IFoo; // ConstructSignature - [i: number]: number; // IndexSignature - foo: number; // PropertySignature - bar(): void; // FunctionSignature - } - - enum Blah { - foo = 2 // EnumMemberDeclaration - } - - class Bar { - constructor(private barVar: Bar) { } // ConstructorImplementation - - public barProp: number; // MemberVariableDeclaration - public barPropFunc(): void { } // MemberFunctionDeclaration - public get prop1(): void { } // MemberAccessorDeclaration - public set prop1() { } // MemberAccessorDeclaration - - private barPropP: number; // MemberVariableDeclaration - private barPropFuncP(): void { } // MemberFunctionDeclaration - private get prop1P(): void { } // MemberAccessorDeclaration - private set prop1P() { } // MemberAccessorDeclaration - - static foo: number; // StaticVariableDeclaration - static bar(): void { } // StaticFunctionDeclaration - static get foo2(): void { } // StaticAccessorDeclaration - static set foo2() { } // StaticAccessorDeclaration - } -} - -module Bar2 { // Module - export var x: number; // Variable - export function f(): void { } // Function - - export interface IFoo { - (i: number): IFoo; // CallSignature - new (): IFoo; // ConstructSignature - [i: number]: number; // IndexSignature - foo: number; // PropertySignature - bar(): void; // FunctionSignature - } - - export enum Blah { - foo = 2 // EnumMemberDeclaration - } - - export class Bar { - constructor(private barVar: Bar) { } // ConstructorImplementation - - public barProp: number; // MemberVariableDeclaration - public barPropFunc(): void { } // MemberFunctionDeclaration - public get prop1(): void { } // MemberAccessorDeclaration - public set prop1() { } // MemberAccessorDeclaration - - private barPropP: number; // MemberVariableDeclaration - private barPropFuncP(): void { } // MemberFunctionDeclaration - private get prop1P(): void { } // MemberAccessorDeclaration - private set prop1P() { } // MemberAccessorDeclaration - - static foo: number; // StaticVariableDeclaration - static bar(): void { } // StaticFunctionDeclaration - static get foo2(): void { } // StaticAccessorDeclaration - static set foo2() { } // StaticAccessorDeclaration - } -} - - -declare module Bar3 { - -} - -module Bar4 { // Module - declare var x: number; // Variable - declare function f(): void; // Function - - declare interface IFoo { - (i: number): IFoo; // CallSignature - new (): IFoo; // ConstructSignature - [i: number]: number; // IndexSignature - foo: number; // PropertySignature - bar(): void; // FunctionSignature - } - - declare enum Blah { - foo = 2 // EnumMemberDeclaration - } - - declare class Bar { - constructor (private barVar: Bar); // ConstructorImplementation - - public barProp: number; // MemberVariableDeclaration - public barPropFunc(): void; // MemberFunctionDeclaration - public get prop1(): void; // MemberAccessorDeclaration - public set prop1(); // MemberAccessorDeclaration - - private barPropP: number; // MemberVariableDeclaration - private barPropFuncP(): void; // MemberFunctionDeclaration - private get prop1P(): void; // MemberAccessorDeclaration - private set prop1P(); // MemberAccessorDeclaration - - static foo: number; // StaticVariableDeclaration - static bar(): void; // StaticFunctionDeclaration - static get foo2(): void; // StaticAccessorDeclaration - static set foo2(); // StaticAccessorDeclaration - } -} diff --git a/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts b/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts deleted file mode 100644 index 882216cb88d..00000000000 --- a/tests/cases/unittests/services/testCode/getSignatureAtPositionTest.ts +++ /dev/null @@ -1,85 +0,0 @@ -//Comment -class sampleCls { constructor (str: string, num: number) { } } -var x = new sampleCls("", 5); // new() test -sampleCls(); // negative test - -function fnTest(str: string, num: number) { } -fnTest(); // simple function test - -function fnOverload(); -function fnOverload(test: string); function fnOverload(test: string) { } -fnOverload() -fnOverload("") - -class clsOverload { constructor (); constructor (test: string); constructor (test?: string) { } } -var x = new clsOverload(); -var x = new clsOverload(""); - -module SimpleTests { - module CallExpressions { - class Foo { - public f1() { } - public f2(n: number) { } - public f3(n: number, s: string) { } - - } - - var x = new Foo(); - x.f1(); - x.f2(5); - x.f3(5, ""); - x.f1( - x.f2(5, - x.f3(5, - } - - module NewExpressions { - - } -} - -module OverloadTests { - module CallExpressions { - function foo(callback: (a: number, b: string) => string) { - callback(5, ""); - } - } -} - -module AnonymousFunctionTest { - var x2 = function (n: number, s: string): (a: number, b: string) => string { - return null; - } - x2(5, "")(1, ""); -} - -module ObjectLiteralTest { - var x = { n: 5, s: "", f: (a: number, b: string) => "" }; - x.f(4, ""); -} - -module SuperCallTest { - class base { - constructor(s: string); - constructor(n: number); - constructor(a: any) { } - } - class A extends base { - constructor() { - super(""); - } - } - - class B extends base { - } - class B2 extends B { - } - class B3 extends B2 { - constructor() { - super(""); - } - } - -} - - diff --git a/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts b/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts deleted file mode 100644 index 562fd566ce2..00000000000 --- a/tests/cases/unittests/services/testCode/getSignatureAtPositionTestEOF.ts +++ /dev/null @@ -1,5 +0,0 @@ -function Foo(arg1: string, arg2: string) { - -} - -Foo( \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts deleted file mode 100644 index 2649484f465..00000000000 --- a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber.ts +++ /dev/null @@ -1,132 +0,0 @@ -module Foo { - - class Bar { - - private foo:string = ""; - - private f() { - var a:any[] = [[1, 2], [3, 4], 5]; - - return ((1 + 1)); - } - - private f2() { - if(true) { }{ }; - } - } - - interface Foo { - - x:number; - - foo():number; - - } - - module Foo2 { - - function f() { - } - - var x: number; - - } - - enum Foo3 { - - val1, - - val2, - - } - -} - -function foo(bar, - blah, - -); - - -function test() { - for (var i = 0; i < 10; i++) { - - } - - for (var e in foo.bar) { - - } - - with (foo.bar) { - - } - - switch(foo.bar) { - - } - - switch (foo.bar) { - - case 1: - - break; - - } - -} - -function tryCatch() { - - try { - - } - - catch(err) { - - } - -} - - -function tryFinally() { - - try { - - } - - finally { - - } - -} - -function tryCatchFinally() { - - try { - - } - - catch(err) { - - } - - finally { - - } - -} - - -module SwitchTest { - var a = 3; - - if (a == 5) { - switch (a) { - case 1: - if (a == 5) { - - } - break; - } - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts deleted file mode 100644 index d4ab3136565..00000000000 --- a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber2.ts +++ /dev/null @@ -1,8 +0,0 @@ -// -// Note: Do not add more tests at the end of this file, as -// the purpose of this test is to verity smart indent -// works for unterminated function arguments at the end of a file. -// - -function foo(a, - diff --git a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts b/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts deleted file mode 100644 index 8122651914b..00000000000 --- a/tests/cases/unittests/services/testCode/getSmartIndentAtLineNumber3.ts +++ /dev/null @@ -1,6 +0,0 @@ -// -// Note: Do not add more tests at the end of this file, as -// the purpose of this test is to verity smart indent -// works for unterminated if statements at the end of a file. -// -if (true) diff --git a/tests/cases/unittests/services/testCode/incrementalParser.ts b/tests/cases/unittests/services/testCode/incrementalParser.ts deleted file mode 100644 index f5290476b80..00000000000 --- a/tests/cases/unittests/services/testCode/incrementalParser.ts +++ /dev/null @@ -1,24 +0,0 @@ -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds -// djf dasjkfh asdkfjhsa dfjhgsdfhjdfg dasfg asdjfhg asdfjga sfjhgdf jhfg asfsadfhg afjh gfjds - -function tryCatchFinally() { - addsdfsdafsdafsdfdsfdsfsfsaafdsddfsdaf; - try { - - } - - catch(err) { - - } - - finally { - - } - -} - diff --git a/tests/cases/unittests/services/testCode/incrementalParser2.ts b/tests/cases/unittests/services/testCode/incrementalParser2.ts deleted file mode 100644 index 86ec00ebd65..00000000000 --- a/tests/cases/unittests/services/testCode/incrementalParser2.ts +++ /dev/null @@ -1,5 +0,0 @@ -interface bah { - (y: number); - x: number; - (z: string) -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/overridesCollector.ts b/tests/cases/unittests/services/testCode/overridesCollector.ts deleted file mode 100644 index 1791e1395f4..00000000000 --- a/tests/cases/unittests/services/testCode/overridesCollector.ts +++ /dev/null @@ -1,57 +0,0 @@ -module SimpleClassTest { - class Foo { - public foo(): void { - } - } - class Bar extends Foo { - public foo(): void { - } - } -} - -module SimpleInterfaceTest { - interface IFoo { - foo(): void; - } - interface IBar extends IFoo { - foo(): void; - } -} - -module SimpleClassInterfaceTest { - interface IFoo { - foo(): void; - } - class Bar implements IFoo { - public foo(): void { - } - } -} - -module Test { - interface IBase { - field: string; - method(): void; - } - - interface IBlah extends IBase { - field: string; - } - - interface IBlah2 extends IBlah { - field: string; - } - - interface IDerived extends IBlah2 { - method(): void; - } - - class Bar implements IDerived { - public field: string; - public method(): void { } - } - - class BarBlah extends Bar { - public field: string; - } -} diff --git a/tests/cases/unittests/services/testCode/references/classLocal.ts b/tests/cases/unittests/services/testCode/references/classLocal.ts deleted file mode 100644 index 34eda48baee..00000000000 --- a/tests/cases/unittests/services/testCode/references/classLocal.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Local inside a class - -var n = 14; - -class foo { - private ^^[|n|] = 0; - - public bar() { - this.[|n|] = 9; - } - - constructor() { - this.[|n|]^^ = 4; - } - - public bar2() { - var n = 12; - } -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/classParameter.ts b/tests/cases/unittests/services/testCode/references/classParameter.ts deleted file mode 100644 index fad418de765..00000000000 --- a/tests/cases/unittests/services/testCode/references/classParameter.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Reference to a class parameter - -var p = 2; - -class p { } - -class foo { - constructor (public p: any) { - } - - public f(p) { - this.^^[|p|] = p; - } - -} - -var n = new foo(undefined); -n.^^[|p|] = null; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/comment.ts b/tests/cases/unittests/services/testCode/references/comment.ts deleted file mode 100644 index e6b8edaa015..00000000000 --- a/tests/cases/unittests/services/testCode/references/comment.ts +++ /dev/null @@ -1,4 +0,0 @@ -// References to ^^foo or b^^ar -/* in comments should not find fo^^o or bar^^ */ -class foo { } -var bar = 0; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/functionOverloads.ts b/tests/cases/unittests/services/testCode/references/functionOverloads.ts deleted file mode 100644 index d382f8818fa..00000000000 --- a/tests/cases/unittests/services/testCode/references/functionOverloads.ts +++ /dev/null @@ -1,6 +0,0 @@ -// function overloads should be highlighted together - -function [|^^foo|](x: string); -function [|^^foo|](x: string, y: number) { - [|^^foo|]('', 43); -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/functionParameter.ts b/tests/cases/unittests/services/testCode/references/functionParameter.ts deleted file mode 100644 index 67f63c35e72..00000000000 --- a/tests/cases/unittests/services/testCode/references/functionParameter.ts +++ /dev/null @@ -1,7 +0,0 @@ -var x; -var n; - -function n(x: number, [|n|]^^: number) { - ^^[|n|] = 32; - x = [|n|]; -} \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/globals.ts b/tests/cases/unittests/services/testCode/references/globals.ts deleted file mode 100644 index 1ebef4e885e..00000000000 --- a/tests/cases/unittests/services/testCode/references/globals.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Global variable reference - -var ^^global = 2; - -class foo { - constructor (public global) { } - public f(global) { } - public f2(global) { } -} - -class bar { - constructor () { - var n = [|global|]; - - var f = new foo(''); - f.global = ''; - } -} - -var k = [|global|]; - -================ -var m = [|global|]; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts b/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts deleted file mode 100644 index d1837f12555..00000000000 --- a/tests/cases/unittests/services/testCode/references/illegalAssignment1.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Neither should cause highlighting to occur -f^^oo = fo^^o; diff --git a/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts b/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts deleted file mode 100644 index 7ea1545517e..00000000000 --- a/tests/cases/unittests/services/testCode/references/illegalAssignment2.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Should still highlight even though it's invalid assignment -var ^^[|foo|] = function() { }; - -[|fo^^o|] = [|f^^oo|] + 1; \ No newline at end of file diff --git a/tests/cases/unittests/services/testCode/references/noContext.ts b/tests/cases/unittests/services/testCode/references/noContext.ts deleted file mode 100644 index fd1ef87c783..00000000000 --- a/tests/cases/unittests/services/testCode/references/noContext.ts +++ /dev/null @@ -1,20 +0,0 @@ -module modTest { - //Declare - export var modVar:number; - ^^ - - //Increments - modVar++; - - class testCls{ - ^^ - } - - function testFn(){ - //Increments - modVar++; - } ^^ -^^ - module testMod { - } -} diff --git a/tests/cases/unittests/services/testCode/references/referenceToClass.ts b/tests/cases/unittests/services/testCode/references/referenceToClass.ts deleted file mode 100644 index 28c6ca509db..00000000000 --- a/tests/cases/unittests/services/testCode/references/referenceToClass.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Class references should work across file and not find local variables -class [|foo|]^^ { - public n: ^^[|foo|]; - public foo: number; -} - -class bar { - public n: [|f^^o^^o|]; - public k = new [|foo|](); -} - -module mod { - var k: [|foo|] = null; -} - -=================== -var k: ^^[|foo|]; diff --git a/tests/cases/unittests/services/testCode/references/static.ts b/tests/cases/unittests/services/testCode/references/static.ts deleted file mode 100644 index 68fa11cd4a5..00000000000 --- a/tests/cases/unittests/services/testCode/references/static.ts +++ /dev/null @@ -1,28 +0,0 @@ -// reference a class static - -var n = 43; - -class foo { - static [|n|] = ''; - - public bar() { - foo.^^[|n|] = "'"; - if(foo.[|n|]) { - var x = foo.[|n|]; - } - } -} - -class foo2 { - private x = foo.[|n|]^^; - constructor() { - foo.^^[|n|] = x; - } - - function b(n) { - n = foo.[|n|]; - } -} - -================= -var q = foo.[|n|]; \ No newline at end of file From d502ae20e5da7b9cdb0c9463088b715e17aa6153 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 22:35:27 -0700 Subject: [PATCH 06/14] move formatting unit tests to a diffrent folder --- .../{ls => services}/documentRegistry.ts | 0 .../documentFormattingTests.json | 0 .../{ => formatting}/formatDiffTemplate.html | 0 .../getFormattingEditsForRange.ts | 0 .../getSmartIndentAtLineNumber.ts | 0 .../importedJavaScriptFormatting.ts | 0 .../{ => formatting}/ruleFormattingTests.json | 0 .../testCode/formatting/classes.ts | 0 .../testCode/formatting/classesBaseline.ts | 0 .../testCode/formatting/colonAndQMark.ts | 0 .../formatting/colonAndQMarkBaseline.ts | 0 .../formatting/documentReadyFunction.ts | 0 .../documentReadyFunctionBaseLine.ts | 0 .../testCode/formatting/emptyBlock.ts | 0 .../testCode/formatting/emptyBlockBaseline.ts | 0 .../formatting/emptyInterfaceLiteral.ts | 0 .../emptyInterfaceLiteralBaseLine.ts | 0 .../testCode/formatting/fatArrowFunctions.ts | 0 .../formatting/fatArrowFunctionsBaseline.ts | 0 .../formatting/formatDebuggerStatement.ts | 0 .../formatDebuggerStatementBaseline.ts | 0 .../formatvariableDeclarationList.ts | 0 .../formatvariableDeclarationListBaseline.ts | 0 .../testCode/formatting/implicitModule.ts | 0 .../formatting/implicitModuleBaseline.ts | 0 .../testCode/formatting/importDeclaration.ts | 0 .../formatting/importDeclarationBaseline.ts | 0 .../testCode/formatting/main.ts | 0 .../testCode/formatting/mainBaseline.ts | 0 .../testCode/formatting/moduleIndentation.ts | 0 .../formatting/moduleIndentationBaseline.ts | 0 .../testCode/formatting/modules.ts | 0 .../testCode/formatting/modulesBaseline.ts | 0 .../testCode/formatting/objectLiteral.ts | 0 .../formatting/objectLiteralBaseline.ts | 0 .../testCode/formatting/onClosingBracket.ts | 0 .../formatting/onClosingBracketBaseLine.ts | 0 .../testCode/formatting/onSemiColon.ts | 0 .../formatting/onSemiColonBaseline.ts | 0 .../formatting/spaceAfterConstructor.ts | 0 .../spaceAfterConstructorBaseline.ts | 0 .../testCode/formatting/tabAfterCloseCurly.ts | 0 .../formatting/tabAfterCloseCurlyBaseline.ts | 0 .../formatting/typescriptConstructs.ts | 0 .../typescriptConstructsBaseline.ts | 0 .../testCode/formatting/various.ts | 0 .../testCode/formatting/variousBaseline.ts | 0 .../testCode/formatting/withStatement.ts | 0 .../formatting/withStatementBaseline.ts | 0 .../testCode/testCode/formatting/classes.ts | 79 ++++++++++++ .../testCode/formatting/classesBaseline.ts | 79 ++++++++++++ .../testCode/formatting/colonAndQMark.ts | 4 + .../formatting/colonAndQMarkBaseline.ts | 4 + .../formatting/documentReadyFunction.ts | 3 + .../documentReadyFunctionBaseLine.ts | 3 + .../testCode/formatting/emptyBlock.ts | 1 + .../testCode/formatting/emptyBlockBaseline.ts | 1 + .../formatting/emptyInterfaceLiteral.ts | 10 ++ .../emptyInterfaceLiteralBaseLine.ts | 10 ++ .../testCode/formatting/fatArrowFunctions.ts | 112 ++++++++++++++++++ .../formatting/fatArrowFunctionsBaseline.ts | 112 ++++++++++++++++++ .../formatting/formatDebuggerStatement.ts | 2 + .../formatDebuggerStatementBaseline.ts | 2 + .../formatvariableDeclarationList.ts | 13 ++ .../formatvariableDeclarationListBaseline.ts | 13 ++ .../testCode/formatting/implicitModule.ts | 3 + .../formatting/implicitModuleBaseline.ts | 3 + .../testCode/formatting/importDeclaration.ts | 6 + .../formatting/importDeclarationBaseline.ts | 6 + .../testCode/testCode/formatting/main.ts | 95 +++++++++++++++ .../testCode/formatting/mainBaseline.ts | 98 +++++++++++++++ .../testCode/formatting/moduleIndentation.ts | 3 + .../formatting/moduleIndentationBaseline.ts | 3 + .../testCode/testCode/formatting/modules.ts | 76 ++++++++++++ .../testCode/formatting/modulesBaseline.ts | 76 ++++++++++++ .../testCode/formatting/objectLiteral.ts | 27 +++++ .../formatting/objectLiteralBaseline.ts | 31 +++++ .../testCode/formatting/onClosingBracket.ts | 32 +++++ .../formatting/onClosingBracketBaseLine.ts | 28 +++++ .../testCode/formatting/onSemiColon.ts | 1 + .../formatting/onSemiColonBaseline.ts | 1 + .../formatting/spaceAfterConstructor.ts | 1 + .../spaceAfterConstructorBaseline.ts | 1 + .../testCode/formatting/tabAfterCloseCurly.ts | 10 ++ .../formatting/tabAfterCloseCurlyBaseline.ts | 9 ++ .../formatting/typescriptConstructs.ts | 65 ++++++++++ .../typescriptConstructsBaseline.ts | 58 +++++++++ .../testCode/testCode/formatting/various.ts | 17 +++ .../testCode/formatting/variousBaseline.ts | 17 +++ .../testCode/formatting/withStatement.ts | 9 ++ .../formatting/withStatementBaseline.ts | 6 + 91 files changed, 1130 insertions(+) rename tests/cases/unittests/{ls => services}/documentRegistry.ts (100%) rename tests/cases/unittests/services/{ => formatting}/documentFormattingTests.json (100%) rename tests/cases/unittests/services/{ => formatting}/formatDiffTemplate.html (100%) rename tests/cases/unittests/services/{ => formatting}/getFormattingEditsForRange.ts (100%) rename tests/cases/unittests/services/{ => formatting}/getSmartIndentAtLineNumber.ts (100%) rename tests/cases/unittests/services/{ => formatting}/importedJavaScriptFormatting.ts (100%) rename tests/cases/unittests/services/{ => formatting}/ruleFormattingTests.json (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/classes.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/classesBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/colonAndQMark.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/colonAndQMarkBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/documentReadyFunction.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/documentReadyFunctionBaseLine.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/emptyBlock.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/emptyBlockBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/emptyInterfaceLiteral.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/emptyInterfaceLiteralBaseLine.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/fatArrowFunctions.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/fatArrowFunctionsBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/formatDebuggerStatement.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/formatDebuggerStatementBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/formatvariableDeclarationList.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/formatvariableDeclarationListBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/implicitModule.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/implicitModuleBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/importDeclaration.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/importDeclarationBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/main.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/mainBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/moduleIndentation.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/moduleIndentationBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/modules.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/modulesBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/objectLiteral.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/objectLiteralBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/onClosingBracket.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/onClosingBracketBaseLine.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/onSemiColon.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/onSemiColonBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/spaceAfterConstructor.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/spaceAfterConstructorBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/tabAfterCloseCurly.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/tabAfterCloseCurlyBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/typescriptConstructs.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/typescriptConstructsBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/various.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/variousBaseline.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/withStatement.ts (100%) rename tests/cases/unittests/services/{ => formatting}/testCode/formatting/withStatementBaseline.ts (100%) create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/classes.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/main.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/modules.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/various.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts create mode 100644 tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts diff --git a/tests/cases/unittests/ls/documentRegistry.ts b/tests/cases/unittests/services/documentRegistry.ts similarity index 100% rename from tests/cases/unittests/ls/documentRegistry.ts rename to tests/cases/unittests/services/documentRegistry.ts diff --git a/tests/cases/unittests/services/documentFormattingTests.json b/tests/cases/unittests/services/formatting/documentFormattingTests.json similarity index 100% rename from tests/cases/unittests/services/documentFormattingTests.json rename to tests/cases/unittests/services/formatting/documentFormattingTests.json diff --git a/tests/cases/unittests/services/formatDiffTemplate.html b/tests/cases/unittests/services/formatting/formatDiffTemplate.html similarity index 100% rename from tests/cases/unittests/services/formatDiffTemplate.html rename to tests/cases/unittests/services/formatting/formatDiffTemplate.html diff --git a/tests/cases/unittests/services/getFormattingEditsForRange.ts b/tests/cases/unittests/services/formatting/getFormattingEditsForRange.ts similarity index 100% rename from tests/cases/unittests/services/getFormattingEditsForRange.ts rename to tests/cases/unittests/services/formatting/getFormattingEditsForRange.ts diff --git a/tests/cases/unittests/services/getSmartIndentAtLineNumber.ts b/tests/cases/unittests/services/formatting/getSmartIndentAtLineNumber.ts similarity index 100% rename from tests/cases/unittests/services/getSmartIndentAtLineNumber.ts rename to tests/cases/unittests/services/formatting/getSmartIndentAtLineNumber.ts diff --git a/tests/cases/unittests/services/importedJavaScriptFormatting.ts b/tests/cases/unittests/services/formatting/importedJavaScriptFormatting.ts similarity index 100% rename from tests/cases/unittests/services/importedJavaScriptFormatting.ts rename to tests/cases/unittests/services/formatting/importedJavaScriptFormatting.ts diff --git a/tests/cases/unittests/services/ruleFormattingTests.json b/tests/cases/unittests/services/formatting/ruleFormattingTests.json similarity index 100% rename from tests/cases/unittests/services/ruleFormattingTests.json rename to tests/cases/unittests/services/formatting/ruleFormattingTests.json diff --git a/tests/cases/unittests/services/testCode/formatting/classes.ts b/tests/cases/unittests/services/formatting/testCode/formatting/classes.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/classes.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/classes.ts diff --git a/tests/cases/unittests/services/testCode/formatting/classesBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/classesBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/classesBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/classesBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/colonAndQMark.ts b/tests/cases/unittests/services/formatting/testCode/formatting/colonAndQMark.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/colonAndQMark.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/colonAndQMark.ts diff --git a/tests/cases/unittests/services/testCode/formatting/colonAndQMarkBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/colonAndQMarkBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/colonAndQMarkBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/colonAndQMarkBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/documentReadyFunction.ts b/tests/cases/unittests/services/formatting/testCode/formatting/documentReadyFunction.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/documentReadyFunction.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/documentReadyFunction.ts diff --git a/tests/cases/unittests/services/testCode/formatting/documentReadyFunctionBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/formatting/documentReadyFunctionBaseLine.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/documentReadyFunctionBaseLine.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/documentReadyFunctionBaseLine.ts diff --git a/tests/cases/unittests/services/testCode/formatting/emptyBlock.ts b/tests/cases/unittests/services/formatting/testCode/formatting/emptyBlock.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/emptyBlock.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/emptyBlock.ts diff --git a/tests/cases/unittests/services/testCode/formatting/emptyBlockBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/emptyBlockBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/emptyBlockBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/emptyBlockBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteral.ts b/tests/cases/unittests/services/formatting/testCode/formatting/emptyInterfaceLiteral.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteral.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/emptyInterfaceLiteral.ts diff --git a/tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteralBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/formatting/emptyInterfaceLiteralBaseLine.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/emptyInterfaceLiteralBaseLine.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/emptyInterfaceLiteralBaseLine.ts diff --git a/tests/cases/unittests/services/testCode/formatting/fatArrowFunctions.ts b/tests/cases/unittests/services/formatting/testCode/formatting/fatArrowFunctions.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/fatArrowFunctions.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/fatArrowFunctions.ts diff --git a/tests/cases/unittests/services/testCode/formatting/fatArrowFunctionsBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/fatArrowFunctionsBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/fatArrowFunctionsBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/fatArrowFunctionsBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatement.ts b/tests/cases/unittests/services/formatting/testCode/formatting/formatDebuggerStatement.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/formatDebuggerStatement.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/formatDebuggerStatement.ts diff --git a/tests/cases/unittests/services/testCode/formatting/formatDebuggerStatementBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/formatDebuggerStatementBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/formatDebuggerStatementBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/formatDebuggerStatementBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationList.ts b/tests/cases/unittests/services/formatting/testCode/formatting/formatvariableDeclarationList.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationList.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/formatvariableDeclarationList.ts diff --git a/tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationListBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/formatvariableDeclarationListBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/formatvariableDeclarationListBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/formatvariableDeclarationListBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/implicitModule.ts b/tests/cases/unittests/services/formatting/testCode/formatting/implicitModule.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/implicitModule.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/implicitModule.ts diff --git a/tests/cases/unittests/services/testCode/formatting/implicitModuleBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/implicitModuleBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/implicitModuleBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/implicitModuleBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/importDeclaration.ts b/tests/cases/unittests/services/formatting/testCode/formatting/importDeclaration.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/importDeclaration.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/importDeclaration.ts diff --git a/tests/cases/unittests/services/testCode/formatting/importDeclarationBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/importDeclarationBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/importDeclarationBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/importDeclarationBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/main.ts b/tests/cases/unittests/services/formatting/testCode/formatting/main.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/main.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/main.ts diff --git a/tests/cases/unittests/services/testCode/formatting/mainBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/mainBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/mainBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/mainBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/moduleIndentation.ts b/tests/cases/unittests/services/formatting/testCode/formatting/moduleIndentation.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/moduleIndentation.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/moduleIndentation.ts diff --git a/tests/cases/unittests/services/testCode/formatting/moduleIndentationBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/moduleIndentationBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/moduleIndentationBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/moduleIndentationBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/modules.ts b/tests/cases/unittests/services/formatting/testCode/formatting/modules.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/modules.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/modules.ts diff --git a/tests/cases/unittests/services/testCode/formatting/modulesBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/modulesBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/modulesBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/modulesBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/objectLiteral.ts b/tests/cases/unittests/services/formatting/testCode/formatting/objectLiteral.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/objectLiteral.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/objectLiteral.ts diff --git a/tests/cases/unittests/services/testCode/formatting/objectLiteralBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/objectLiteralBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/objectLiteralBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/objectLiteralBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/onClosingBracket.ts b/tests/cases/unittests/services/formatting/testCode/formatting/onClosingBracket.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/onClosingBracket.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/onClosingBracket.ts diff --git a/tests/cases/unittests/services/testCode/formatting/onClosingBracketBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/formatting/onClosingBracketBaseLine.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/onClosingBracketBaseLine.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/onClosingBracketBaseLine.ts diff --git a/tests/cases/unittests/services/testCode/formatting/onSemiColon.ts b/tests/cases/unittests/services/formatting/testCode/formatting/onSemiColon.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/onSemiColon.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/onSemiColon.ts diff --git a/tests/cases/unittests/services/testCode/formatting/onSemiColonBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/onSemiColonBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/onSemiColonBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/onSemiColonBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructor.ts b/tests/cases/unittests/services/formatting/testCode/formatting/spaceAfterConstructor.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/spaceAfterConstructor.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/spaceAfterConstructor.ts diff --git a/tests/cases/unittests/services/testCode/formatting/spaceAfterConstructorBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/spaceAfterConstructorBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/spaceAfterConstructorBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/spaceAfterConstructorBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurly.ts b/tests/cases/unittests/services/formatting/testCode/formatting/tabAfterCloseCurly.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurly.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/tabAfterCloseCurly.ts diff --git a/tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurlyBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/tabAfterCloseCurlyBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/tabAfterCloseCurlyBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/tabAfterCloseCurlyBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/typescriptConstructs.ts b/tests/cases/unittests/services/formatting/testCode/formatting/typescriptConstructs.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/typescriptConstructs.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/typescriptConstructs.ts diff --git a/tests/cases/unittests/services/testCode/formatting/typescriptConstructsBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/typescriptConstructsBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/typescriptConstructsBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/typescriptConstructsBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/various.ts b/tests/cases/unittests/services/formatting/testCode/formatting/various.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/various.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/various.ts diff --git a/tests/cases/unittests/services/testCode/formatting/variousBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/variousBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/variousBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/variousBaseline.ts diff --git a/tests/cases/unittests/services/testCode/formatting/withStatement.ts b/tests/cases/unittests/services/formatting/testCode/formatting/withStatement.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/withStatement.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/withStatement.ts diff --git a/tests/cases/unittests/services/testCode/formatting/withStatementBaseline.ts b/tests/cases/unittests/services/formatting/testCode/formatting/withStatementBaseline.ts similarity index 100% rename from tests/cases/unittests/services/testCode/formatting/withStatementBaseline.ts rename to tests/cases/unittests/services/formatting/testCode/formatting/withStatementBaseline.ts diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classes.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classes.ts new file mode 100644 index 00000000000..e779f69810f --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classes.ts @@ -0,0 +1,79 @@ + class a { + constructor ( n : number ) ; + constructor ( s : string ) ; + constructor ( ns : any ) { + + } + + public pgF ( ) { } ; + + public pv ; + public get d ( ) { + return 30 ; + } + public set d ( ) { + } + + public static get p2 ( ) { + return { x : 30 , y : 40 } ; + } + + private static d2 ( ) { + } + private static get p3 ( ) { + return "string" ; + } + private pv3 ; + + private foo ( n : number ) : string ; + private foo ( s : string ) : string ; + private foo ( ns : any ) { + return ns.toString ( ) ; + } +} + + class b extends a { +} + + class m1b { + +} + + interface m1ib { + + } + class c extends m1b { +} + + class ib2 implements m1ib { +} + + declare class aAmbient { + constructor ( n : number ) ; + constructor ( s : string ) ; + public pgF ( ) : void ; + public pv ; + public d : number ; + static p2 : { x : number ; y : number ; } ; + static d2 ( ) ; + static p3 ; + private pv3 ; + private foo ( s ) ; +} + + class d { + private foo ( n : number ) : string ; + private foo ( ns : any ) { + return ns.toString ( ) ; + } + private foo ( s : string ) : string ; +} + + class e { + private foo ( ns : any ) { + return ns.toString ( ) ; + } + private foo ( s : string ) : string ; + private foo ( n : number ) : string ; +} + diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts new file mode 100644 index 00000000000..e7e69b44125 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts @@ -0,0 +1,79 @@ +class a { + constructor(n: number); + constructor(s: string); + constructor(ns: any) { + + } + + public pgF() { }; + + public pv; + public get d() { + return 30; + } + public set d() { + } + + public static get p2() { + return { x: 30, y: 40 }; + } + + private static d2() { + } + private static get p3() { + return "string"; + } + private pv3; + + private foo(n: number): string; + private foo(s: string): string; + private foo(ns: any) { + return ns.toString(); + } +} + +class b extends a { +} + +class m1b { + +} + +interface m1ib { + +} +class c extends m1b { +} + +class ib2 implements m1ib { +} + +declare class aAmbient { + constructor(n: number); + constructor(s: string); + public pgF(): void; + public pv; + public d: number; + static p2: { x: number; y: number; }; + static d2(); + static p3; + private pv3; + private foo(s); +} + +class d { + private foo(n: number): string; + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; +} + +class e { + private foo(ns: any) { + return ns.toString(); + } + private foo(s: string): string; + private foo(n: number): string; +} + diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts new file mode 100644 index 00000000000..5562e142046 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts @@ -0,0 +1,4 @@ +class foo { + constructor (n?: number, m? = 5, o?: string = "") { } + x:number = 1?2:3; +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts new file mode 100644 index 00000000000..52bbe56251d --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts @@ -0,0 +1,4 @@ +class foo { + constructor(n?: number, m? = 5, o?: string = "") { } + x: number = 1 ? 2 : 3; +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts new file mode 100644 index 00000000000..35daa4d895c --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts @@ -0,0 +1,3 @@ +$ ( document ) . ready ( function ( ) { + alert ( 'i am ready' ) ; + } ); \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts new file mode 100644 index 00000000000..838ef682207 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts @@ -0,0 +1,3 @@ +$(document).ready(function() { + alert('i am ready'); +}); \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts new file mode 100644 index 00000000000..9e26dfeeb6e --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts new file mode 100644 index 00000000000..6f31cf5a2e6 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts @@ -0,0 +1 @@ +{ } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts new file mode 100644 index 00000000000..1feec453d03 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts @@ -0,0 +1,10 @@ + function foo ( x : { } ) { } + +foo ( { } ) ; + + + + interface bar { + x : { } ; + y : ( ) => { } ; + } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts new file mode 100644 index 00000000000..04f3c0bc9b9 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts @@ -0,0 +1,10 @@ +function foo(x: {}) { } + +foo({}); + + + +interface bar { + x: {}; + y: () => {}; +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts new file mode 100644 index 00000000000..ebbf54557fa --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts @@ -0,0 +1,112 @@ +// valid + ( ) => 1 ; + ( arg ) => 2 ; + arg => 2 ; + ( arg = 1 ) => 3 ; + ( arg ? ) => 4 ; + ( arg : number ) => 5 ; + ( arg : number = 0 ) => 6 ; + ( arg ? : number ) => 7 ; + ( ... arg : number [ ] ) => 8 ; + ( arg1 , arg2 ) => 12 ; + ( arg1 = 1 , arg2 =3 ) => 13 ; + ( arg1 ? , arg2 ? ) => 14 ; + ( arg1 : number , arg2 : number ) => 15 ; + ( arg1 : number = 0 , arg2 : number = 1 ) => 16 ; + ( arg1 ? : number , arg2 ? : number ) => 17 ; + ( arg1 , ... arg2 : number [ ] ) => 18 ; + ( arg1 , arg2 ? : number ) => 19 ; + +// in paren + ( ( ) => 21 ) ; + ( ( arg ) => 22 ) ; + ( ( arg = 1 ) => 23 ) ; + ( ( arg ? ) => 24 ) ; + ( ( arg : number ) => 25 ) ; + ( ( arg : number = 0 ) => 26 ) ; + ( ( arg ? : number ) => 27 ) ; + ( ( ... arg : number [ ] ) => 28 ) ; + +// in multiple paren + ( ( ( ( ( arg ) => { return 32 ; } ) ) ) ) ; + +// in ternary exression + false ? ( ) => 41 : null ; + false ? ( arg ) => 42 : null ; + false ? ( arg = 1 ) => 43 : null ; + false ? ( arg ? ) => 44 : null ; + false ? ( arg : number ) => 45 : null ; + false ? ( arg ? : number ) => 46 : null ; + false ? ( arg ? : number = 0 ) => 47 : null ; + false ? ( ... arg : number [ ] ) => 48 : null ; + +// in ternary exression within paren + false ? ( ( ) => 51 ) : null ; + false ? ( ( arg ) => 52 ) : null ; + false ? ( ( arg = 1 ) => 53 ) : null ; + false ? ( ( arg ? ) => 54 ) : null ; + false ? ( ( arg : number ) => 55 ) : null ; + false ? ( ( arg ? : number ) => 56 ) : null ; + false ? ( ( arg ? : number = 0 ) => 57 ) : null ; + false ? ( ( ... arg : number [ ] ) => 58 ) : null ; + +// ternary exression's else clause + false ? null : ( ) => 61 ; + false ? null : ( arg ) => 62 ; + false ? null : ( arg = 1 ) => 63 ; + false ? null : ( arg ? ) => 64 ; + false ? null : ( arg : number ) => 65 ; + false ? null : ( arg ? : number ) => 66 ; + false ? null : ( arg ? : number = 0 ) => 67 ; + false ? null : ( ... arg : number [ ] ) => 68 ; + + +// nested ternary expressions + ( a ? ) => { return a ; } ? ( b ? ) => { return b ; } : ( c ? ) => { return c ; } ; + +//multiple levels + ( a ? ) => { return a ; } ? ( b ) => ( c ) => 81 : ( c ) => ( d ) => 82 ; + + +// In Expressions + ( ( arg ) => 90 ) instanceof Function ; + ( ( arg = 1 ) => 91 ) instanceof Function ; + ( ( arg ? ) => 92 ) instanceof Function ; + ( ( arg : number ) => 93 ) instanceof Function ; + ( ( arg : number = 1 ) => 94 ) instanceof Function ; + ( ( arg ? : number ) => 95 ) instanceof Function ; + ( ( ... arg : number [ ] ) => 96 ) instanceof Function ; + +'' + ( arg ) => 100 ; + ( ( arg ) => 0 ) + '' + ( arg ) => 101 ; + ( ( arg = 1 ) => 0 ) + '' + ( arg = 2 ) => 102 ; + ( ( arg ? ) => 0 ) + '' + ( arg ? ) => 103 ; + ( ( arg : number ) => 0 ) + '' + ( arg : number ) => 104 ; + ( ( arg : number = 1 ) => 0 ) + '' + ( arg : number = 2 ) => 105 ; + ( ( arg ? : number = 1 ) => 0 ) + '' + ( arg ? : number = 2 ) => 106 ; + ( ( ... arg : number [ ] ) => 0 ) + '' + ( ... arg : number [ ] ) => 107 ; + ( ( arg1 , arg2 ? ) => 0 ) + '' + ( arg1 , arg2 ? ) => 108 ; + ( ( arg1 , ... arg2 : number [ ] ) => 0 ) + '' + ( arg1 , ... arg2 : number [ ] ) => 108 ; + + +// Function Parameters +function foo ( ... arg : any [ ] ) { } + +foo ( + ( a ) => 110 , + ( ( a ) => 111 ) , + ( a ) => { + return 112 ; + } , + ( a ? ) => 113 , + ( a , b ? ) => 114 , + ( a : number ) => 115 , + ( a : number = 0 ) => 116 , + ( a = 0 ) => 117 , + ( a ? : number = 0 ) => 118 , + ( a ? , b ? : number = 0 ) => 118 , + ( ... a : number [ ] ) => 119 , + ( a , b ? = 0 , ... c : number [ ] ) => 120 , + ( a ) => ( b ) => ( c ) => 121 , + false ? ( a ) => 0 : ( b ) => 122 + ) ; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts new file mode 100644 index 00000000000..7a1ef86f5af --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts @@ -0,0 +1,112 @@ +// valid +() => 1; +(arg) => 2; +arg => 2; +(arg = 1) => 3; +(arg?) => 4; +(arg: number) => 5; +(arg: number = 0) => 6; +(arg?: number) => 7; +(...arg: number[]) => 8; +(arg1, arg2) => 12; +(arg1 = 1, arg2 = 3) => 13; +(arg1?, arg2?) => 14; +(arg1: number, arg2: number) => 15; +(arg1: number = 0, arg2: number = 1) => 16; +(arg1?: number, arg2?: number) => 17; +(arg1, ...arg2: number[]) => 18; +(arg1, arg2?: number) => 19; + +// in paren +(() => 21); +((arg) => 22); +((arg = 1) => 23); +((arg?) => 24); +((arg: number) => 25); +((arg: number = 0) => 26); +((arg?: number) => 27); +((...arg: number[]) => 28); + +// in multiple paren +(((((arg) => { return 32; })))); + +// in ternary exression +false ? () => 41 : null; +false ? (arg) => 42 : null; +false ? (arg = 1) => 43 : null; +false ? (arg?) => 44 : null; +false ? (arg: number) => 45 : null; +false ? (arg?: number) => 46 : null; +false ? (arg?: number = 0) => 47 : null; +false ? (...arg: number[]) => 48 : null; + +// in ternary exression within paren +false ? (() => 51) : null; +false ? ((arg) => 52) : null; +false ? ((arg = 1) => 53) : null; +false ? ((arg?) => 54) : null; +false ? ((arg: number) => 55) : null; +false ? ((arg?: number) => 56) : null; +false ? ((arg?: number = 0) => 57) : null; +false ? ((...arg: number[]) => 58) : null; + +// ternary exression's else clause +false ? null : () => 61; +false ? null : (arg) => 62; +false ? null : (arg = 1) => 63; +false ? null : (arg?) => 64; +false ? null : (arg: number) => 65; +false ? null : (arg?: number) => 66; +false ? null : (arg?: number = 0) => 67; +false ? null : (...arg: number[]) => 68; + + +// nested ternary expressions +(a?) => { return a; } ? (b?) => { return b; } : (c?) => { return c; }; + +//multiple levels +(a?) => { return a; } ? (b) => (c) => 81 : (c) => (d) => 82; + + +// In Expressions +((arg) => 90) instanceof Function; +((arg = 1) => 91) instanceof Function; +((arg?) => 92) instanceof Function; +((arg: number) => 93) instanceof Function; +((arg: number = 1) => 94) instanceof Function; +((arg?: number) => 95) instanceof Function; +((...arg: number[]) => 96) instanceof Function; + +'' + (arg) => 100; +((arg) => 0) + '' + (arg) => 101; +((arg = 1) => 0) + '' + (arg = 2) => 102; +((arg?) => 0) + '' + (arg?) => 103; +((arg: number) => 0) + '' + (arg: number) => 104; +((arg: number = 1) => 0) + '' + (arg: number = 2) => 105; +((arg?: number = 1) => 0) + '' + (arg?: number = 2) => 106; +((...arg: number[]) => 0) + '' + (...arg: number[]) => 107; +((arg1, arg2?) => 0) + '' + (arg1, arg2?) => 108; +((arg1, ...arg2: number[]) => 0) + '' + (arg1, ...arg2: number[]) => 108; + + +// Function Parameters +function foo(...arg: any[]) { } + +foo( + (a) => 110, + ((a) => 111), + (a) => { + return 112; + }, + (a?) => 113, + (a, b?) => 114, + (a: number) => 115, + (a: number = 0) => 116, + (a = 0) => 117, + (a?: number = 0) => 118, + (a?, b?: number = 0) => 118, + (...a: number[]) => 119, + (a, b? = 0, ...c: number[]) => 120, + (a) => (b) => (c) => 121, + false ? (a) => 0 : (b) => 122 + ); \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts new file mode 100644 index 00000000000..314cd416a81 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts @@ -0,0 +1,2 @@ +if(false){debugger;} + if ( false ) { debugger ; } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts new file mode 100644 index 00000000000..c03acf91ecf --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts @@ -0,0 +1,2 @@ +if (false) { debugger; } +if (false) { debugger; } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts new file mode 100644 index 00000000000..956309d2c4d --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts @@ -0,0 +1,13 @@ +var fun1 = function ( ) { + var x = 'foo' , + z = 'bar' ; + return x ; +}, + +fun2 = ( function ( f ) { + var fun = function ( ) { + console . log ( f ( ) ) ; + }, + x = 'Foo' ; + return fun ; +} ( fun1 ) ) ; diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts new file mode 100644 index 00000000000..f1d32283fd7 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts @@ -0,0 +1,13 @@ +var fun1 = function() { + var x = 'foo', + z = 'bar'; + return x; +}, + +fun2 = (function(f) { + var fun = function() { + console.log(f()); + }, + x = 'Foo'; + return fun; +} (fun1)); diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts new file mode 100644 index 00000000000..352a252593b --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts @@ -0,0 +1,3 @@ + export class A { + + } diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts new file mode 100644 index 00000000000..df93540466f --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts @@ -0,0 +1,3 @@ +export class A { + +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts new file mode 100644 index 00000000000..afd010fe8b7 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts @@ -0,0 +1,6 @@ +module Foo { +} + +import bar = Foo; + +import bar2=Foo; diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts new file mode 100644 index 00000000000..d0a4e190d95 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts @@ -0,0 +1,6 @@ +module Foo { +} + +import bar = Foo; + +import bar2 = Foo; diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/main.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/main.ts new file mode 100644 index 00000000000..7640013af8b --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/main.ts @@ -0,0 +1,95 @@ + +var a;var c , b;var $d +var $e +var f +a++;b++; + +function f ( ) { + for (i = 0; i < 10; i++) { + k = abc + 123 ^ d; + a = XYZ[m (a[b[c][d]])]; + break; + + switch ( variable){ + case 1: abc += 425; +break; +case 404 : a [x--/2]%=3 ; + break ; + case vari : v[--x ] *=++y*( m + n / k[z]); + for (a in b){ + for (a = 0; a < 10; ++a) { + a++;--a; + if (a == b) { + a++;b--; + } +else +if (a == c){ +++a; +(--c)+=d; +$c = $a + --$b; +} +if (a == b) +if (a != b) { + if (a !== b) + if (a === b) + --a; + else + --a; + else { + a--;++b; +a++ + } + } + } + for (x in y) { +m-=m; +k=1+2+3+4; +} +} + break; + + } + } + var a ={b:function(){}}; + return {a:1,b:2} +} + +var z = 1; + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) +for (k = 0; k < 10; ++k) { +z++; +} + +for (k = 0; k < 10; k += 2) { +z++; +} + + $(document).ready (); + + + function pageLoad() { + $('#TextBox1' ) . unbind ( ) ; +$('#TextBox1' ) . datepicker ( ) ; +} + + function pageLoad ( ) { + var webclass=[ + { 'student' : + { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' } + } , +{ 'student': +{'id':'2','name':'Adam Davidson','legacySkill':'Cobol,MainFrame'} +} , + { 'student': +{ 'id':'3','name':'Charles Boyer' ,'legacySkill':'HTML, XML'} +} + ]; + +$create(Sys.UI.DataView,{data:webclass},null,null,$get('SList')); + +} + +$( document ).ready(function(){ +alert('hello'); + } ) ; diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts new file mode 100644 index 00000000000..30756f547ca --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts @@ -0,0 +1,98 @@ + +var a; var c, b; var $d +var $e +var f +a++; b++; + +function f() { + for (i = 0; i < 10; i++) { + k = abc + 123 ^ d; + a = XYZ[m(a[b[c][d]])]; + break; + + switch (variable) { + case 1: abc += 425; + break; + case 404: a[x-- / 2] %= 3; + break; + case vari: v[--x] *= ++y * (m + n / k[z]); + for (a in b) { + for (a = 0; a < 10; ++a) { + a++; --a; + if (a == b) { + a++; b--; + } + else + if (a == c) { + ++a; + (--c) += d; + $c = $a + --$b; + } + if (a == b) + if (a != b) { + if (a !== b) + if (a === b) + --a; + else + --a; + else { + a--; ++b; + a++ + } + } + } + for (x in y) { + m -= m; + k = 1 + 2 + 3 + 4; + } + } + break; + + } + } + var a = { b: function() { } }; + return { a: 1, b: 2 } +} + +var z = 1; +for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + for (k = 0; k < 10; ++k) { + z++; + } + +for (k = 0; k < 10; k += 2) { + z++; +} + +$(document).ready(); + + +function pageLoad() { + $('#TextBox1').unbind(); + $('#TextBox1').datepicker(); +} + +function pageLoad() { + var webclass = [ + { + 'student': + { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' } + }, +{ + 'student': + { 'id': '2', 'name': 'Adam Davidson', 'legacySkill': 'Cobol,MainFrame' } +}, + { + 'student': + { 'id': '3', 'name': 'Charles Boyer', 'legacySkill': 'HTML, XML' } + } + ]; + + $create(Sys.UI.DataView, { data: webclass }, null, null, $get('SList')); + +} + +$(document).ready(function() { + alert('hello'); +}); diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts new file mode 100644 index 00000000000..3030a36630a --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts @@ -0,0 +1,3 @@ + module Foo { + export module A . B . C { } + } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts new file mode 100644 index 00000000000..0013b367dcf --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts @@ -0,0 +1,3 @@ +module Foo { + export module A.B.C { } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modules.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modules.ts new file mode 100644 index 00000000000..5ce0d19b632 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modules.ts @@ -0,0 +1,76 @@ + module mod1 { + export class b { + } + class d { + } + + + export interface ib { + } +} + + module m2 { + + export module m3 { + export class c extends mod1.b { + } + export class ib2 implements mod1.ib { + } + } +} + + class c extends mod1.b { +} + + class ib2 implements mod1.ib { +} + + declare export module "m4" { + export class d { + } ; + var x : d ; + export function foo ( ) : d ; +} + + import m4 = module ( "m4" ) ; + export var x4 = m4.x ; + export var d4 = m4.d ; + export var f4 = m4.foo ( ) ; + + export module m1 { + declare export module "m2" { + export class d { + } ; + var x: d ; + export function foo ( ) : d ; + } + import m2 = module ( "m2" ) ; + import m3 = module ( "m4" ) ; + + export var x2 = m2.x ; + export var d2 = m2.d ; + export var f2 = m2.foo ( ) ; + + export var x3 = m3.x ; + export var d3 = m3.d ; + export var f3 = m3.foo ( ) ; +} + + export var x2 = m1.m2.x ; + export var d2 = m1.m2.d ; + export var f2 = m1.m2.foo ( ) ; + + export var x3 = m1.m3.x ; + export var d3 = m1.m3.d ; + export var f3 = m1.m3.foo ( ) ; + + export module m5 { + export var x2 = m1.m2.x ; + export var d2 = m1.m2.d ; + export var f2 = m1.m2.foo ( ) ; + + export var x3 = m1.m3.x ; + export var d3 = m1.m3.d ; + export var f3 = m1.m3.foo ( ) ; +} + diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts new file mode 100644 index 00000000000..e6f62024fe6 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts @@ -0,0 +1,76 @@ +module mod1 { + export class b { + } + class d { + } + + + export interface ib { + } +} + +module m2 { + + export module m3 { + export class c extends mod1.b { + } + export class ib2 implements mod1.ib { + } + } +} + +class c extends mod1.b { +} + +class ib2 implements mod1.ib { +} + +declare export module "m4" { + export class d { + }; + var x: d; + export function foo(): d; +} + +import m4 = module("m4"); +export var x4 = m4.x; +export var d4 = m4.d; +export var f4 = m4.foo(); + +export module m1 { + declare export module "m2" { + export class d { + }; + var x: d; + export function foo(): d; + } + import m2 = module("m2"); + import m3 = module("m4"); + + export var x2 = m2.x; + export var d2 = m2.d; + export var f2 = m2.foo(); + + export var x3 = m3.x; + export var d3 = m3.d; + export var f3 = m3.foo(); +} + +export var x2 = m1.m2.x; +export var d2 = m1.m2.d; +export var f2 = m1.m2.foo(); + +export var x3 = m1.m3.x; +export var d3 = m1.m3.d; +export var f3 = m1.m3.foo(); + +export module m5 { + export var x2 = m1.m2.x; + export var d2 = m1.m2.d; + export var f2 = m1.m2.foo(); + + export var x3 = m1.m3.x; + export var d3 = m1.m3.d; + export var f3 = m1.m3.foo(); +} + diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts new file mode 100644 index 00000000000..dbecc4d4fec --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts @@ -0,0 +1,27 @@ +var x = {foo: 1, +bar: "tt", +boo: 1 + 5}; + +var x2 = {foo: 1, +bar: "tt",boo:1+5}; + +function Foo() { +var typeICalc = { +clear: { +"()": [1, 2, 3] +} +} +} + +// Rule for object literal members for the "value" of the memebr to follow the indent +// of the member, i.e. the relative position of the value is maintained when the member +// is indented. +var x2 = { + foo: +3, + 'bar': + { a: 1, b : 2} +}; + +var x={ }; +var y = {}; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts new file mode 100644 index 00000000000..3a7fa63d927 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts @@ -0,0 +1,31 @@ +var x = { + foo: 1, + bar: "tt", + boo: 1 + 5 +}; + +var x2 = { + foo: 1, + bar: "tt", boo: 1 + 5 +}; + +function Foo() { + var typeICalc = { + clear: { + "()": [1, 2, 3] + } + } +} + +// Rule for object literal members for the "value" of the memebr to follow the indent +// of the member, i.e. the relative position of the value is maintained when the member +// is indented. +var x2 = { + foo: + 3, + 'bar': + { a: 1, b: 2 } +}; + +var x = {}; +var y = {}; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts new file mode 100644 index 00000000000..0161f04308d --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts @@ -0,0 +1,32 @@ +function f( ) { +var x = 3; + var z = 2 ; + a = z ++ - 2 * x ; + for ( ; ; ) { + a+=(g +g)*a%t; + b -- ; +} + + switch ( a ) + { + case 1 : { + a ++ ; + b--; + if(a===a) + return; + else + { + for(a in b) + if(a!=a) + { + for(a in b) + { +a++; + } + } + } + } + default: + break; + } +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts new file mode 100644 index 00000000000..051a4ebd13a --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts @@ -0,0 +1,28 @@ +function f() { + var x = 3; + var z = 2; + a = z++ - 2 * x; + for (; ;) { + a += (g + g) * a % t; + b--; + } + + switch (a) { + case 1: { + a++; + b--; + if (a === a) + return; + else { + for (a in b) + if (a != a) { + for (a in b) { + a++; + } + } + } + } + default: + break; + } +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts new file mode 100644 index 00000000000..3b5b5456a6f --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts @@ -0,0 +1 @@ +var a=b+c^d-e*++f; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts new file mode 100644 index 00000000000..2ba96e4f88a --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts @@ -0,0 +1 @@ +var a = b + c ^ d - e * ++f; \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts new file mode 100644 index 00000000000..7d98d5a8f43 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts @@ -0,0 +1 @@ +class test { constructor () { } } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts new file mode 100644 index 00000000000..bc124d41baf --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts @@ -0,0 +1 @@ +class test { constructor() { } } \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts new file mode 100644 index 00000000000..ec093e0e376 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts @@ -0,0 +1,10 @@ +module Tools { + export enum NodeType { + Error, + Comment, + } + export enum foob + { + Blah=1, Bleah=2 + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts new file mode 100644 index 00000000000..d0a3db2d51a --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts @@ -0,0 +1,9 @@ +module Tools { + export enum NodeType { + Error, + Comment, + } + export enum foob { + Blah = 1, Bleah = 2 + } +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts new file mode 100644 index 00000000000..43ef3710ef1 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts @@ -0,0 +1,65 @@ + module MyModule + { + module A.B.C { +module F { +} + } +interface Blah +{ +boo: string; +} + + class Foo + { + +} + +class Foo2 { +public foo():number { +return 5 * 6; +} +public foo2() { +if (1 === 2) + + +{ +var y : number= 76; +return y; +} + + while (2 == 3) { + if ( y == null ) { + +} + } +} + +public foo3() { +if (1 === 2) + +//comment preventing line merging +{ +var y = 76; +return y; +} + +} + } + } + +function foo(a:number, b:number):number +{ +return 0; +} + +function bar(a:number, b:number) :number[] { +return []; +} + +module BugFix3 { +declare var f: { + (): any; + (x: number): string; + foo: number; +}; +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts new file mode 100644 index 00000000000..929334e4730 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts @@ -0,0 +1,58 @@ +module MyModule { + module A.B.C { + module F { + } + } + interface Blah { + boo: string; + } + + class Foo { + + } + + class Foo2 { + public foo(): number { + return 5 * 6; + } + public foo2() { + if (1 === 2) { + var y: number = 76; + return y; + } + + while (2 == 3) { + if (y == null) { + + } + } + } + + public foo3() { + if (1 === 2) + + //comment preventing line merging + { + var y = 76; + return y; + } + + } + } +} + +function foo(a: number, b: number): number { + return 0; +} + +function bar(a: number, b: number): number[] { + return []; +} + +module BugFix3 { + declare var f: { + (): any; + (x: number): string; + foo: number; + }; +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/various.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/various.ts new file mode 100644 index 00000000000..bd814c2348e --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/various.ts @@ -0,0 +1,17 @@ +function f(a,b,c,d){ +for(var i=0;i<10;i++){ +var a=0; +var b=a+a+a*a%a/2-1; +b+=a; +++b; +f(a,b,c,d); +if(1===1){ +var m=function(e,f){ +return e^f; +} +} +} +} + +for (var i = 0 ; i < this.foo(); i++) { +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts new file mode 100644 index 00000000000..a4b5ceeb1c2 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts @@ -0,0 +1,17 @@ +function f(a, b, c, d) { + for (var i = 0; i < 10; i++) { + var a = 0; + var b = a + a + a * a % a / 2 - 1; + b += a; + ++b; + f(a, b, c, d); + if (1 === 1) { + var m = function(e, f) { + return e ^ f; + } + } + } +} + +for (var i = 0 ; i < this.foo(); i++) { +} \ No newline at end of file diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts new file mode 100644 index 00000000000..66ec4bf546f --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts @@ -0,0 +1,9 @@ +with (foo.bar) + + { + + } + +with (bar.blah) +{ +} diff --git a/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts new file mode 100644 index 00000000000..f81378d7f82 --- /dev/null +++ b/tests/cases/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts @@ -0,0 +1,6 @@ +with (foo.bar) { + +} + +with (bar.blah) { +} From d028c060348a3890dbb1e5c272a5c2aa964ca518 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 23:32:18 -0700 Subject: [PATCH 07/14] remove unused folders from unitest runner --- src/harness/runner.ts | 12 +++--------- src/harness/unittestrunner.ts | 28 ++++------------------------ 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/harness/runner.ts b/src/harness/runner.ts index 7ea996b24e6..331a19819b3 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -68,17 +68,11 @@ if (testConfigFile !== '') { runners.push(new GeneratedFourslashRunner()); break; case 'unittests': - runners.push(new UnitTestRunner(UnittestTestType.Compiler)); + runners.push(new UnitTestRunner()); break; case 'rwc': runners.push(new RWCRunner()); break; - case 'ls': - runners.push(new UnitTestRunner(UnittestTestType.LanguageService)); - break; - case 'services': - runners.push(new UnitTestRunner(UnittestTestType.Services)); - break; case 'reverse': reverse = true; break; @@ -96,12 +90,12 @@ if (runners.length === 0) { runners.push(new ProjectRunner()); } - //// language services + // language services runners.push(new FourslashRunner()); //runners.push(new GeneratedFourslashRunner()); // unittests - runners.push(new UnitTestRunner(UnittestTestType.Services)); + runners.push(new UnitTestRunner()); } sys.newLine = '\r\n'; diff --git a/src/harness/unittestrunner.ts b/src/harness/unittestrunner.ts index 7b9019788e6..c91b82a0d96 100644 --- a/src/harness/unittestrunner.ts +++ b/src/harness/unittestrunner.ts @@ -1,34 +1,13 @@ /// /// -enum UnittestTestType { - Compiler, - LanguageService, - Services, -} - class UnitTestRunner extends RunnerBase { - constructor(public testType: UnittestTestType) { + constructor() { super(); } public initializeTests() { - switch (this.testType) { - case UnittestTestType.Compiler: - this.tests = this.enumerateFiles('tests/cases/unittests/compiler'); - break; - case UnittestTestType.LanguageService: - this.tests = this.enumerateFiles('tests/cases/unittests/ls'); - break; - case UnittestTestType.Services: - this.tests = this.enumerateFiles('tests/cases/unittests/services', /colorization.ts/); - break; - default: - if (this.tests.length === 0) { - throw new Error('Unsupported test cases: ' + this.testType); - } - break; - } + this.tests = this.enumerateFiles('tests/cases/unittests/services'); var outfile = new Harness.Compiler.WriterAggregator() var outerr = new Harness.Compiler.WriterAggregator(); @@ -63,7 +42,8 @@ class UnitTestRunner extends RunnerBase { after: after, Harness: Harness, IO: Harness.IO, - ts:ts + ts: ts, + TypeScript: TypeScript // FourSlash: FourSlash }; } From 38cacc967fd0a4bc61dceff9dc1995ed48847f64 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 23:32:43 -0700 Subject: [PATCH 08/14] Enable unit tests for DocumentRegistry --- src/services/services.ts | 5 +- src/services/shims.ts | 4 +- .../unittests/services/documentRegistry.ts | 174 ++---------------- 3 files changed, 24 insertions(+), 159 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 19845f86483..f00825e4b41 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -693,8 +693,7 @@ module ts { compilationSettings: CompilerOptions, scriptSnapshot: TypeScript.IScriptSnapshot, version: number, - isOpen: boolean, - referencedFiles: string[]): SourceFile; + isOpen: boolean): SourceFile; updateDocument( soruceFile: SourceFile, @@ -1350,7 +1349,7 @@ module ts { sourceFile = documentRegistry.updateDocument(sourceFile, filename, compilationSettings, scriptSnapshot, version, isOpen, textChangeRange); } else { - sourceFile = documentRegistry.acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen, []); + sourceFile = documentRegistry.acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen); } // Remeber the new sourceFile diff --git a/src/services/shims.ts b/src/services/shims.ts index 891b9e1d913..36e28d3e060 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -837,8 +837,8 @@ module ts { public createLanguageServiceShim(host: LanguageServiceShimHost): LanguageServiceShim { try { var hostAdapter = new LanguageServiceShimHostAdapter(host); - var pullLanguageService = createLanguageService(hostAdapter, this.documentRegistry); - return new LanguageServiceShimObject(this, host, pullLanguageService); + var languageService = createLanguageService(hostAdapter, this.documentRegistry); + return new LanguageServiceShimObject(this, host, languageService); } catch (err) { logInternalError(host, err); diff --git a/tests/cases/unittests/services/documentRegistry.ts b/tests/cases/unittests/services/documentRegistry.ts index 871989cc232..a7ed030f44c 100644 --- a/tests/cases/unittests/services/documentRegistry.ts +++ b/tests/cases/unittests/services/documentRegistry.ts @@ -1,172 +1,38 @@ -/// /// -/// - -class TestSourceFile { - constructor( - public fileName: string, - public version: number, - public scriptSnapshot: TypeScript.IScriptSnapshot, - public isOpen: boolean, - public byteOrderMark: TypeScript.ByteOrderMark = TypeScript.ByteOrderMark.Utf8) { - } -} - -class TestHostSettings { - constructor( - public files: TypeScript.StringHashTable, - public compilationSettings: TypeScript.CompilationSettings = TypeScript.ImmutableCompilationSettings.defaultSettings().toCompilationSettings()) { - } -} - -describe("testDocumentRetrievalAndUpdate", () => { - function getHost(settings: TestHostSettings): TypeScript.Services.ILanguageServiceHost { - return { - getCompilationSettings(): TypeScript.CompilationSettings { - return settings.compilationSettings; - }, - - getScriptFileNames(): string[]{ - return settings.files.getAllKeys(); - }, - - getScriptVersion(fileName: string): number { - return settings.files.lookup(fileName).version; - }, - - getScriptIsOpen(fileName: string): boolean { - return settings.files.lookup(fileName).isOpen; - }, - - getScriptByteOrderMark(fileName: string): TypeScript.ByteOrderMark { - return settings.files.lookup(fileName).byteOrderMark; - }, - - getScriptSnapshot(fileName: string): TypeScript.IScriptSnapshot { - return settings.files.lookup(fileName).scriptSnapshot; - }, - - getDiagnosticsObject(): TypeScript.Services.ILanguageServicesDiagnostics { - throw TypeScript.Errors.notYetImplemented(); - }, - - getLocalizedDiagnosticMessages(): any { - return null; - }, - - information(): boolean { - return false; - }, - - debug(): boolean { - return false; - }, - - warning(): boolean { - return false; - }, - - error(): boolean { - return false; - }, - - fatal(): boolean { - return false; - }, - - log(s: string): void { - }, - - resolveRelativePath(path: string, directory: string): string { - throw TypeScript.Errors.notYetImplemented(); - }, - fileExists(path: string): boolean { - throw TypeScript.Errors.notYetImplemented(); - }, - directoryExists(path: string): boolean { - throw TypeScript.Errors.notYetImplemented(); - }, - getParentDirectory(path: string): string { - throw TypeScript.Errors.notYetImplemented(); - }, - getCancellationToken(): TypeScript.ICancellationToken { - return TypeScript.CancellationToken.None; - } - } - } - - function getLanguageServiceCompiler(ls: TypeScript.Services.ILanguageService): TypeScript.Services.LanguageServiceCompiler { - return (ls).compiler - } +describe("DocumentRegistry", () => { it("documents are shared between projects", () => { - function ensureDocumentIsShared(prefix: string, ls1: TypeScript.Services.ILanguageService, ls2: TypeScript.Services.ILanguageService, fileName: string): void { - var c1 = getLanguageServiceCompiler(ls1); - var c2 = getLanguageServiceCompiler(ls2); - // getDocument synchronized its internal state with host - var doc1 = c1.getDocument(fileName); - var doc2 = c2.getDocument(fileName); - if (doc1 !== doc2) { - throw new Error(prefix + ":document should be shared between language services"); - } - } - var files = new TypeScript.StringHashTable(); - var f1 = new TestSourceFile("file1.ts", 1, TypeScript.ScriptSnapshot.fromString("var x = 1;"), false); - files.add(f1.fileName, f1); - var factory = new TypeScript.Services.TypeScriptServicesFactory(); + var documentRegistry = ts.createDocumentRegistry(); + var defaultCompilerOptions = ts.getDefaultCompilerOptions(); - var hostSettings = new TestHostSettings(files); - var ls1 = factory.createPullLanguageService(getHost(hostSettings)); - var ls2 = factory.createPullLanguageService(getHost(hostSettings)); + var f1 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); + var f2 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); - ensureDocumentIsShared("==1==", ls1, ls2, f1.fileName); - - f1.version = 2; - f1.scriptSnapshot = TypeScript.ScriptSnapshot.fromString("var x = 2;"); - - ensureDocumentIsShared("==2==", ls1, ls2, f1.fileName); + assert(f1 === f2, "DocumentRegistry should return the same document for the same name"); }); it("documents are refreshed when settings in compilation settings affect syntax", () => { - var files = new TypeScript.StringHashTable(); - var f1 = new TestSourceFile("file1.ts", 1, TypeScript.ScriptSnapshot.fromString("var x = 1;"), false); - files.add(f1.fileName, f1); - var factory = new TypeScript.Services.TypeScriptServicesFactory(); - - var hostSettings = new TestHostSettings(files); - - var factory = new TypeScript.Services.TypeScriptServicesFactory(); - var ls = factory.createPullLanguageService(getHost(hostSettings)); - var compiler = getLanguageServiceCompiler(ls); - - var d1 = compiler.getDocument(f1.fileName); + var documentRegistry = ts.createDocumentRegistry(); + var compilerOptions: ts.CompilerOptions = { target: ts.ScriptTarget.ES5, module: ts.ModuleKind.AMD }; // change compilation setting that doesn't affect parsing - should have the same document - hostSettings.compilationSettings.generateDeclarationFiles = !hostSettings.compilationSettings.generateDeclarationFiles; - var d2 = compiler.getDocument(f1.fileName); + compilerOptions.declaration = true; + var f1 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); + compilerOptions.declaration = false; + var f2 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); + + assert(f1 === f2, "Expected to have the same document instance"); - if (d1 !== d2) { - throw new Error("Expected to have the same document instance"); - } // change value of compilation setting that is used during production of AST - new document is required - hostSettings.compilationSettings.codeGenTarget = TypeScript.LanguageVersion.EcmaScript5; - var d3 = compiler.getDocument(f1.fileName); - if (d2 === d3) { - throw new Error("Changed codeGenTarget: Expected to have different instances of document"); - } + compilerOptions.target = ts.ScriptTarget.ES3; + var f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); - hostSettings.compilationSettings.propagateEnumConstants = !hostSettings.compilationSettings.propagateEnumConstants; - var d4 = compiler.getDocument(f1.fileName); - if (d3 === d4) { - throw new Error("Changed propagateEnumConstants: Expected to have different instances of document"); - } + assert(f1 !== f3, "Changed target: Expected to have different instances of document"); - hostSettings.compilationSettings.allowAutomaticSemicolonInsertion = !hostSettings.compilationSettings.allowAutomaticSemicolonInsertion; - var d5 = compiler.getDocument(f1.fileName); - if (d4 === d5) { - throw new Error("Changed allowAutomaticSemicolonInsertion: Expected to have different instances of document"); - } + compilerOptions.module = ts.ModuleKind.CommonJS; + var f4 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), 1, false); + assert(f1 !== f4, "Changed module: Expected to have different instances of document"); }); }); \ No newline at end of file From bae6ddd1b54cf6ab9d855af339cbeb4db56ee3cd Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 23:51:15 -0700 Subject: [PATCH 09/14] add unterminated multiline comment classification tests --- tests/cases/unittests/services/colorization.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index 157c31fbec7..cba14ae6957 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -191,4 +191,22 @@ describe('Colorization', function () { assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); }); }); + + describe("test cases for colorizing unterminted multi-line comment", function () { + it("unterminated multi-line comment correctelly", function () { + var results = getClassifications("/*", ts.EndOfLineState.Start); + + assert.equal(results.tuples.length, 1); + verifyClassification(results.tuples[0], 2, ts.TokenClass.Comment); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); + }); + + it("unterminated multi-line comment with trailing space correctelly", function () { + var results = getClassifications("/* ", ts.EndOfLineState.Start); + + assert.equal(results.tuples.length, 1); + verifyClassification(results.tuples[0], 3, ts.TokenClass.Comment); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); + }); + }); }); \ No newline at end of file From ad9a87dfb6e9d9c7b811e92c2320ae306bbdc115 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 8 Aug 2014 10:37:10 -0700 Subject: [PATCH 10/14] Add some huristic optimization to not colorize a keyword if precceded by a dot or a keyword. this should handel cases for "a.var" or "module string { }" --- src/services/services.ts | 83 +++++++++++-------- .../cases/unittests/services/colorization.ts | 33 +++++++- 2 files changed, 82 insertions(+), 34 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index f00825e4b41..63feb8fed42 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -659,6 +659,8 @@ module ts { InMultiLineCommentTrivia, InSingleQuoteStringLiteral, InDoubleQuoteStringLiteral, + EndingWithKeyword, + EndingWithDotToken, } export enum TokenClass { @@ -2217,25 +2219,33 @@ module ts { function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { var offset = 0; var lastTokenOrCommentEnd = 0; - var inMultiLineComment = false; + var lastToken = SyntaxKind.Unknown; + var inUnterminatedMultiLineComment = false; - if (lexState !== EndOfLineState.Start) { - // If we're in a string literal, then prepend: "\ - // (and a newline). That way when we lex we'll think we're still in a string literal. - // - // If we're in a multiline comment, then prepend: /* - // (and a newline). That way when we lex we'll think we're still in a multiline comment. - if (lexState === EndOfLineState.InDoubleQuoteStringLiteral) { + // If we're in a string literal, then prepend: "\ + // (and a newline). That way when we lex we'll think we're still in a string literal. + // + // If we're in a multiline comment, then prepend: /* + // (and a newline). That way when we lex we'll think we're still in a multiline comment. + switch (lexState) { + case EndOfLineState.InDoubleQuoteStringLiteral: text = '"\\\n' + text; - } - else if (lexState === EndOfLineState.InSingleQuoteStringLiteral) { + offset = 3; + break; + case EndOfLineState.InSingleQuoteStringLiteral: text = "'\\\n" + text; - } - else if (lexState === EndOfLineState.InMultiLineCommentTrivia) { + offset = 3; + break; + case EndOfLineState.InMultiLineCommentTrivia: text = "/*\n" + text; - } - - offset = 3; + offset = 3; + break; + case EndOfLineState.EndingWithDotToken: + lastToken = SyntaxKind.DotToken; + break; + case EndOfLineState.EndingWithKeyword: + lastToken = SyntaxKind.FirstKeyword; + break; } var result: ClassificationResult = { @@ -2245,11 +2255,8 @@ module ts { scanner = createScanner(ScriptTarget.ES5, text, onError, processComment); - var lastToken = SyntaxKind.Unknown; var token = SyntaxKind.Unknown; do { - inMultiLineComment = false; - token = scanner.scan(); if ((token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) && !noRegexTable[lastToken]) { @@ -2257,6 +2264,9 @@ module ts { token = SyntaxKind.RegularExpressionLiteral; } } + else if (isKeyword(token) && (isKeyword(lastToken) || lastToken === SyntaxKind.DotToken)) { + token = SyntaxKind.Identifier; + } lastToken = token; @@ -2268,7 +2278,7 @@ module ts { function onError(message: DiagnosticMessage): void { - inMultiLineComment = message.key === Diagnostics.Asterisk_Slash_expected.key; + inUnterminatedMultiLineComment = message.key === Diagnostics.Asterisk_Slash_expected.key; } function processComment(start: number, end: number) { @@ -2291,21 +2301,24 @@ module ts { if (end >= text.length) { // We're at the end. - if (inMultiLineComment) { + if (inUnterminatedMultiLineComment) { result.finalLexState = EndOfLineState.InMultiLineCommentTrivia; - return; } - - if (token === SyntaxKind.StringLiteral) { + else if (token === SyntaxKind.StringLiteral) { var tokenText = scanner.getTokenText(); if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === CharacterCodes.backslash) { var quoteChar = tokenText.charCodeAt(0); result.finalLexState = quoteChar === CharacterCodes.doubleQuote ? EndOfLineState.InDoubleQuoteStringLiteral : EndOfLineState.InSingleQuoteStringLiteral; - return; } } + else if (token === SyntaxKind.DotToken) { + result.finalLexState = EndOfLineState.EndingWithDotToken; + } + else if (isKeyword(token)) { + result.finalLexState = EndOfLineState.EndingWithKeyword; + } } } @@ -2331,8 +2344,8 @@ module ts { } } - function isBinaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { - switch (tokenKind) { + function isBinaryExpressionOperatorToken(token: SyntaxKind): boolean { + switch (token) { case SyntaxKind.AsteriskToken: case SyntaxKind.SlashToken: case SyntaxKind.PercentToken: @@ -2374,8 +2387,8 @@ module ts { } } - function isPrefixUnaryExpressionOperatorToken(tokenKind: SyntaxKind): boolean { - switch (tokenKind) { + function isPrefixUnaryExpressionOperatorToken(token: SyntaxKind): boolean { + switch (token) { case SyntaxKind.PlusToken: case SyntaxKind.MinusToken: case SyntaxKind.TildeToken: @@ -2388,18 +2401,22 @@ module ts { } } - function classFromKind(kind: SyntaxKind) { - if (kind >= SyntaxKind.FirstKeyword && kind <= SyntaxKind.LastKeyword) { + function isKeyword(token: SyntaxKind): boolean { + return token >= SyntaxKind.FirstKeyword && token <= SyntaxKind.LastKeyword; + } + + function classFromKind(token: SyntaxKind) { + if (isKeyword(token)) { return TokenClass.Keyword; } - else if (isBinaryExpressionOperatorToken(kind) || isPrefixUnaryExpressionOperatorToken(kind)) { + else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return TokenClass.Operator; } - else if (kind >= SyntaxKind.FirstPunctuation && kind <= SyntaxKind.LastPunctuation) { + else if (token >= SyntaxKind.FirstPunctuation && token <= SyntaxKind.LastPunctuation) { return TokenClass.Punctuation; } - switch (kind) { + switch (token) { case SyntaxKind.NumericLiteral: return TokenClass.NumberLiteral; case SyntaxKind.StringLiteral: diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index cba14ae6957..2b9afdb6ef1 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -28,15 +28,21 @@ describe('Colorization', function () { var classResult = myclassifier.getClassificationsForLine(code, initialEndOfLineState).split('\n'); var tuples: Classification[] = []; var i = 0; + var computedLength = 0; for (; i < classResult.length - 1; i += 2) { - tuples[i / 2] = { + var t = tuples[i / 2] = { length: parseInt(classResult[i]), class: parseInt(classResult[i + 1]) }; + + assert.isTrue(t.length > 0, "Result length should be greater than 0, got :" + t.length); + computedLength += t.length; } var finalEndOfLineState = classResult[classResult.length - 1]; + assert.equal(computedLength, code.length, "Expected accumilative length of all entries to match the length of the source. expected: " + code.length + ", but got: " + computedLength); + return { tuples: tuples, finalEndOfLineState: parseInt(finalEndOfLineState) @@ -209,4 +215,29 @@ describe('Colorization', function () { assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); }); }); + + describe("test cases for colorizing keywords", function () { + it("classifies keyword after a dot", function () { + var results = getClassifications("a.var", ts.EndOfLineState.Start); + verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier); + }); + + it("classifies keyword after a keyword", function () { + var results = getClassifications("module string", ts.EndOfLineState.Start); + verifyClassification(results.tuples[2], 6, ts.TokenClass.Identifier); + }); + + it("reports correct state with a line ending in a keyword", function () { + var results = getClassifications("module", ts.EndOfLineState.Start); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.EndingWithKeyword); + }); + + it("classifies keyword after a dot on previous line", function () { + var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken); + + assert.equal(results.tuples.length, 1); + verifyClassification(results.tuples[0], 3, ts.TokenClass.Identifier); + assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); + }); + }); }); \ No newline at end of file From 17c45ed986921fde08ea37097b38962b5b393130 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 8 Aug 2014 16:43:31 -0700 Subject: [PATCH 11/14] revert changes to classify a keyword as an identifier if the last token is keyword --- src/services/services.ts | 9 +-------- tests/cases/unittests/services/colorization.ts | 10 ---------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 63feb8fed42..7379ce5747f 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -659,7 +659,6 @@ module ts { InMultiLineCommentTrivia, InSingleQuoteStringLiteral, InDoubleQuoteStringLiteral, - EndingWithKeyword, EndingWithDotToken, } @@ -2243,9 +2242,6 @@ module ts { case EndOfLineState.EndingWithDotToken: lastToken = SyntaxKind.DotToken; break; - case EndOfLineState.EndingWithKeyword: - lastToken = SyntaxKind.FirstKeyword; - break; } var result: ClassificationResult = { @@ -2264,7 +2260,7 @@ module ts { token = SyntaxKind.RegularExpressionLiteral; } } - else if (isKeyword(token) && (isKeyword(lastToken) || lastToken === SyntaxKind.DotToken)) { + else if (lastToken === SyntaxKind.DotToken) { token = SyntaxKind.Identifier; } @@ -2316,9 +2312,6 @@ module ts { else if (token === SyntaxKind.DotToken) { result.finalLexState = EndOfLineState.EndingWithDotToken; } - else if (isKeyword(token)) { - result.finalLexState = EndOfLineState.EndingWithKeyword; - } } } diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index 2b9afdb6ef1..e395f20490c 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -222,16 +222,6 @@ describe('Colorization', function () { verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier); }); - it("classifies keyword after a keyword", function () { - var results = getClassifications("module string", ts.EndOfLineState.Start); - verifyClassification(results.tuples[2], 6, ts.TokenClass.Identifier); - }); - - it("reports correct state with a line ending in a keyword", function () { - var results = getClassifications("module", ts.EndOfLineState.Start); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.EndingWithKeyword); - }); - it("classifies keyword after a dot on previous line", function () { var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken); From be47b94c8f6a025b0bba9c453c42930296dba45e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 8 Aug 2014 16:45:10 -0700 Subject: [PATCH 12/14] clean up tests --- .../cases/unittests/services/colorization.ts | 281 +++++++----------- 1 file changed, 113 insertions(+), 168 deletions(-) diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index e395f20490c..414942bbded 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -1,4 +1,5 @@ interface Classification { + position: number; length: number; class: ts.TokenClass; } @@ -8,17 +9,10 @@ interface ClassiferResult { finalEndOfLineState: ts.EndOfLineState; } -var TokenClassNames = {}; -TokenClassNames[ts.TokenClass.Punctuation] = "Punctuation"; -TokenClassNames[ts.TokenClass.Keyword] = "Keyword"; -TokenClassNames[ts.TokenClass.Operator] = "Operator"; -TokenClassNames[ts.TokenClass.Comment] = "Comment"; -TokenClassNames[ts.TokenClass.Whitespace] = "Whitespace"; -TokenClassNames[ts.TokenClass.Identifier] = "Identifier"; -TokenClassNames[ts.TokenClass.NumberLiteral] = "NumberLiteral"; -TokenClassNames[ts.TokenClass.StringLiteral] = "StringLiteral"; -TokenClassNames[ts.TokenClass.RegExpLiteral] = "RegExpLiteral"; - +interface ClassificationEntry { + value: any; + class: ts.TokenClass; +} describe('Colorization', function () { var mytypescriptLS = new Harness.LanguageService.TypeScriptLS(); @@ -28,20 +22,21 @@ describe('Colorization', function () { var classResult = myclassifier.getClassificationsForLine(code, initialEndOfLineState).split('\n'); var tuples: Classification[] = []; var i = 0; - var computedLength = 0; + var position = 0; for (; i < classResult.length - 1; i += 2) { var t = tuples[i / 2] = { + position: position, length: parseInt(classResult[i]), class: parseInt(classResult[i + 1]) }; assert.isTrue(t.length > 0, "Result length should be greater than 0, got :" + t.length); - computedLength += t.length; + position += t.length; } var finalEndOfLineState = classResult[classResult.length - 1]; - assert.equal(computedLength, code.length, "Expected accumilative length of all entries to match the length of the source. expected: " + code.length + ", but got: " + computedLength); + assert.equal(position, code.length, "Expected accumilative length of all entries to match the length of the source. expected: " + code.length + ", but got: " + position); return { tuples: tuples, @@ -52,182 +47,132 @@ describe('Colorization', function () { function verifyClassification(classification: Classification, expectedLength: number, expectedClass: number) { assert.isNotNull(classification); assert.equal(classification.length, expectedLength, "Classification length does not match expected. Expected: " + expectedLength + ", Actual: " + classification.length); - assert.equal(classification.class, expectedClass, "Classification class does not match expected. Expected: " + TokenClassNames[expectedClass] + ", Actual: " + TokenClassNames[classification.class]); + assert.equal(classification.class, expectedClass, "Classification class does not match expected. Expected: " + ts.TokenClass[expectedClass] + ", Actual: " + ts.TokenClass[classification.class]); } - describe("test cases for colorization", function () { - var results = getClassifications('var x:string = "foo"; //Hello'); + function getEntryAtPosistion(result: ClassiferResult, position: number) { + for (var i = 0, n = result.tuples.length; i < n; i++) { + if (result.tuples[i].position === position) return result.tuples[i]; + } + return undefined; + } - it("checks for a keyword", function () { - verifyClassification(results.tuples[0], 3, ts.TokenClass.Keyword); + function punctuation(text: string) { return { value: text, class: ts.TokenClass.Punctuation }; } + function keyword(text: string) { return { value: text, class: ts.TokenClass.Keyword }; } + function operator(text: string) { return { value: text, class: ts.TokenClass.Operator }; } + function comment(text: string) { return { value: text, class: ts.TokenClass.Comment }; } + function whitespace(text: string) { return { value: text, class: ts.TokenClass.Whitespace }; } + function identifier(text: string) { return { value: text, class: ts.TokenClass.Identifier }; } + function numberLiteral(text: string) { return { value: text, class: ts.TokenClass.NumberLiteral }; } + function stringLiteral(text: string) { return { value: text, class: ts.TokenClass.StringLiteral }; } + function regExpLiteral(text: string) { return { value: text, class: ts.TokenClass.RegExpLiteral }; } + function finalEndOfLineState(value: number) { return { value: value, class: undefined }; } + + function test(text: string, initialEndOfLineState: ts.EndOfLineState, ...expectedEntries: ClassificationEntry[]): void { + var result = getClassifications(text, initialEndOfLineState); + + for (var i = 0, n = expectedEntries.length; i < n; i++) { + var expectedEntry = expectedEntries[i]; + + if (expectedEntry.class === undefined) { + assert.equal(result.finalEndOfLineState, expectedEntry.value, "final endOfLineState does not match expected."); + } + else { + var actualEntryPosition = text.indexOf(expectedEntry.value); + assert(actualEntryPosition >= 0, "token: '" + expectedEntry.value + "' does not exit in text: '" + text + "'."); + + var actualEntry = getEntryAtPosistion(result, actualEntryPosition); + + assert(actualEntry, "Could not find classification entry for '" + expectedEntry.value + "' at position: " + actualEntryPosition); + assert.equal(actualEntry.length, expectedEntry.value.length, "Classification class does not match expected."); + assert.equal(actualEntry.class, expectedEntry.class, "Classification class does not match expected."); + } + } + } + + describe("test getClassifications", function () { + it("Returns correct token classes", function () { + test("var x: string = \"foo\"; //Hello", + ts.EndOfLineState.Start, + keyword("var"), + whitespace(" "), + identifier("x"), + punctuation(":"), + keyword("string"), + operator("="), + stringLiteral("\"foo\""), + comment("//Hello"), + punctuation(";")); }); - it("checks for a whitespace", function () { - verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); + it("classifies correctelly a comment after a divide operator", function () { + test("1 / 2 // comment", + ts.EndOfLineState.Start, + numberLiteral("1"), + whitespace(" "), + operator("/"), + numberLiteral("2"), + comment("// comment")); }); - it("checks for a identifier", function () { - verifyClassification(results.tuples[2], 1, ts.TokenClass.Identifier); + it("classifies correctelly a literal after a divide operator", function () { + test("1 / 2, 3 / 4", + ts.EndOfLineState.Start, + numberLiteral("1"), + whitespace(" "), + operator("/"), + numberLiteral("2"), + numberLiteral("3"), + numberLiteral("4"), + operator(",")); }); - it("checks for an punctuation", function () { - verifyClassification(results.tuples[3], 1, ts.TokenClass.Punctuation); + it("classifies correctelly an unterminated multi-line string", function () { + test("'line1\\", + ts.EndOfLineState.Start, + stringLiteral("'line1\\"), + finalEndOfLineState(ts.EndOfLineState.InSingleQuoteStringLiteral)); }); - it("checks for a operator", function () { - verifyClassification(results.tuples[6], 1, ts.TokenClass.Operator); + it("classifies correctelly the second line of an unterminated multi-line string", function () { + test("\\", + ts.EndOfLineState.InDoubleQuoteStringLiteral, + stringLiteral("\\"), + finalEndOfLineState(ts.EndOfLineState.InDoubleQuoteStringLiteral)); }); - it("checks for a string literal", function () { - verifyClassification(results.tuples[8], 5, ts.TokenClass.StringLiteral); + it("classifies correctelly the last line of a multi-line string", function () { + test("'", + ts.EndOfLineState.InSingleQuoteStringLiteral, + stringLiteral("'"), + finalEndOfLineState(ts.EndOfLineState.Start)); }); - it("checks for a comment", function () { - verifyClassification(results.tuples[11], 7, ts.TokenClass.Comment); - }); - }); - - describe("test comment colorization after a divide operator", function () { - var results = getClassifications('1 / 1 // comment'); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[0], 1, ts.TokenClass.NumberLiteral); + it("classifies correctelly an unterminated multiline comment", function () { + test("/*", + ts.EndOfLineState.Start, + comment("/*"), + finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia)); }); - it("checks for a whitespace", function () { - verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); + it("classifies correctelly an unterminated multiline comment with trailing space", function () { + test("/* ", + ts.EndOfLineState.Start, + comment("/* "), + finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia)); }); - it("checks for a operator", function () { - verifyClassification(results.tuples[2], 1, ts.TokenClass.Operator); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[3], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[4], 1, ts.TokenClass.NumberLiteral); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[5], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a comment", function () { - verifyClassification(results.tuples[6], 10, ts.TokenClass.Comment); - }); - }); - - describe("test literal colorization after a divide operator", function () { - var results = getClassifications('1 / 2, 1 / 2'); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[0], 1, ts.TokenClass.NumberLiteral); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[1], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a operator", function () { - verifyClassification(results.tuples[2], 1, ts.TokenClass.Operator); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[3], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[4], 1, ts.TokenClass.NumberLiteral); - }); - - it("checks for a operator", function () { - verifyClassification(results.tuples[5], 1, ts.TokenClass.Operator); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[6], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[7], 1, ts.TokenClass.NumberLiteral); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[8], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a operator", function () { - verifyClassification(results.tuples[9], 1, ts.TokenClass.Operator); - }); - - it("checks for a whitespace", function () { - verifyClassification(results.tuples[10], 1, ts.TokenClass.Whitespace); - }); - - it("checks for a number literal", function () { - verifyClassification(results.tuples[11], 1, ts.TokenClass.NumberLiteral); - }); - - }); - - describe("test cases for colorizing multi-line string", function () { - it("classifies first line correctelly", function () { - var results = getClassifications("'line1\\", ts.EndOfLineState.Start); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 7, ts.TokenClass.StringLiteral); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InSingleQuoteStringLiteral); - }); - - it("classifies second line correctelly", function () { - var results = getClassifications("\\", ts.EndOfLineState.InDoubleQuoteStringLiteral); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 1, ts.TokenClass.StringLiteral); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InDoubleQuoteStringLiteral); - }); - - it("classifies third line correctelly", function () { - var results = getClassifications("'", ts.EndOfLineState.InSingleQuoteStringLiteral); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 1, ts.TokenClass.StringLiteral); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); - }); - }); - - describe("test cases for colorizing unterminted multi-line comment", function () { - it("unterminated multi-line comment correctelly", function () { - var results = getClassifications("/*", ts.EndOfLineState.Start); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 2, ts.TokenClass.Comment); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); - }); - - it("unterminated multi-line comment with trailing space correctelly", function () { - var results = getClassifications("/* ", ts.EndOfLineState.Start); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 3, ts.TokenClass.Comment); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia); - }); - }); - - describe("test cases for colorizing keywords", function () { - it("classifies keyword after a dot", function () { - var results = getClassifications("a.var", ts.EndOfLineState.Start); - verifyClassification(results.tuples[2], 3, ts.TokenClass.Identifier); + it("classifies correctelly a keyword after a dot", function () { + test("a.var", + ts.EndOfLineState.Start, + identifier("var")); }); it("classifies keyword after a dot on previous line", function () { - var results = getClassifications("var", ts.EndOfLineState.EndingWithDotToken); - - assert.equal(results.tuples.length, 1); - verifyClassification(results.tuples[0], 3, ts.TokenClass.Identifier); - assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start); + test("var", + ts.EndOfLineState.EndingWithDotToken, + identifier("var"), + finalEndOfLineState(ts.EndOfLineState.Start)); }); }); }); \ No newline at end of file From 06e858ff40cf7ff366c574b930a50ce386600d36 Mon Sep 17 00:00:00 2001 From: Adam Freidin Date: Fri, 15 Aug 2014 20:12:04 -0700 Subject: [PATCH 13/14] fix --declaration typechecking (complex case) This fixes generation of typescriptServices.d.ts, although this is not a current requirement ( https://github.com/Microsoft/TypeScript/issues/465 ). --- src/compiler/checker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 99c21d9ff15..cba51e8fd86 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -780,7 +780,7 @@ module ts { // But it cant, hence the accessible is going to be undefined, but that doesnt mean m.c is accessible // It is accessible if the parent m is accessible because then m.c can be accessed through qualification meaningToLook = getQualifiedLeftMeaning(meaning); - symbol = symbol.parent; + symbol = getParentOfSymbol(symbol); } // This could be a symbol that is not exported in the external module @@ -903,7 +903,7 @@ module ts { if (accessibleSymbolChain && !needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { break; } - symbol = accessibleSymbolChain ? accessibleSymbolChain[0].parent : symbol.parent; + symbol = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); meaning = getQualifiedLeftMeaning(meaning); } From d43f28d3a0b7bdb331e14a2acac84cf085220a3d Mon Sep 17 00:00:00 2001 From: Adam Freidin Date: Fri, 15 Aug 2014 21:14:33 -0700 Subject: [PATCH 14/14] baseline for typechecking --declaration --- .../reference/moduleSymbolMerging.js | 42 +++++++++++++++++++ tests/cases/compiler/moduleSymbolMerging.ts | 12 ++++++ 2 files changed, 54 insertions(+) create mode 100644 tests/baselines/reference/moduleSymbolMerging.js create mode 100644 tests/cases/compiler/moduleSymbolMerging.ts diff --git a/tests/baselines/reference/moduleSymbolMerging.js b/tests/baselines/reference/moduleSymbolMerging.js new file mode 100644 index 00000000000..4b35f939873 --- /dev/null +++ b/tests/baselines/reference/moduleSymbolMerging.js @@ -0,0 +1,42 @@ +//// [tests/cases/compiler/moduleSymbolMerging.ts] //// + +//// [A.ts] + +module A { export interface I {} } + +//// [B.ts] +/// +module A { ; } +module B { + export function f(): A.I { return null; } +} + + + +//// [A.js] +//// [B.js] +var A; +(function (A) { + ; +})(A || (A = {})); +var B; +(function (B) { + function f() { + return null; + } + B.f = f; +})(B || (B = {})); + + +//// [A.d.ts] +declare module A { + interface I { + } +} +//// [B.d.ts] +/// +declare module A { +} +declare module B { + function f(): A.I; +} diff --git a/tests/cases/compiler/moduleSymbolMerging.ts b/tests/cases/compiler/moduleSymbolMerging.ts new file mode 100644 index 00000000000..03df2c5e596 --- /dev/null +++ b/tests/cases/compiler/moduleSymbolMerging.ts @@ -0,0 +1,12 @@ +// @declaration: true + +// @Filename: A.ts +module A { export interface I {} } + +// @Filename: B.ts +/// +module A { ; } +module B { + export function f(): A.I { return null; } +} +