Commit graph

707 commits

Author SHA1 Message Date
Mohamed Hegazy cc3cae34e9 respond to code review remarks and reverted tryResolveScriptReference to resolveScriptReference 2014-09-05 13:06:10 -07:00
Anders Hejlsberg 5fdc908a36 Deferred type checking of function expressions to support circular definitions. 2014-09-05 12:55:28 -07:00
Mohamed Hegazy 3bcde460fd Add numeric indexer to HTMLElementCollection 2014-09-05 12:54:56 -07:00
Daniel Rosenwasser 84e385ddfa Made a getThisContainer function. 2014-09-05 12:14:50 -07:00
Sheetal Nandi 0dc95ceb60 Use double quotes in declaration file's reference path generation so that quotes in file name wouldnt affect reference resolution
Fixes #474
2014-09-04 16:21:56 -07:00
Mohamed Hegazy 5422e56d48 Do not show noImplictAny errors when widening for a cast expression 2014-09-04 14:25:12 -07:00
Sheetal Nandi f582902ec0 Merge pull request #569 from Microsoft/collisions
Report error if exports or require is used for declaration name in external module
2014-09-04 13:44:43 -07:00
Daniel Rosenwasser e6e9979482 getRefs/getOccs support for 'this' keyword. 2014-09-04 13:30:16 -07:00
Daniel Rosenwasser 492e1c5d72 Merge pull request #593 from Microsoft/getOccurrencesReturn
Get occurrences for return keywords.
2014-09-04 13:20:07 -07:00
Mohamed Hegazy acf557dd3c Do not emit references in generated declaration files if the --noresolve flag was set. This fixes a crash in the compiler when generating declarations with /// reference and noResolve 2014-09-04 13:16:22 -07:00
Daniel Rosenwasser 7b5440bb8d Addressed more CR feedback. 2014-09-04 12:44:18 -07:00
Daniel Rosenwasser 294ad06b68 Merge branch 'getOccurrences' of https://github.com/Microsoft/TypeScript into getOccurrences 2014-09-04 12:01:24 -07:00
Daniel Rosenwasser 837dddaec3 Addressed CR feedback. 2014-09-04 11:54:16 -07:00
Ryan Cavanaugh 4381f725ed Merge pull request #581 from Microsoft/instrument
Add jake task for making instrumented tsc
2014-09-04 10:55:01 -07:00
Anders Hejlsberg 5b1789b2b8 Merge pull request #597 from Microsoft/cacheFileLookups
Cache unsuccessful file lookups for improved performance.
2014-09-04 10:48:52 -07:00
Ryan Cavanaugh b8b522784c Address CR feedback 2014-09-04 10:44:36 -07:00
Anders Hejlsberg f62bbc238d Cache unsuccessful file lookups for improved performance. 2014-09-04 10:17:39 -07:00
Sheetal Nandi 3cc4b73858 Merge pull request #570 from Microsoft/linemaps
Handles all the line breaks in calculation of line-character position
2014-09-04 09:53:06 -07:00
Ryan Cavanaugh 0aba039a0d Speed up RWC IO playback by removing unfound files from resolution candidates 2014-09-04 09:18:29 -07:00
Ryan Cavanaugh f2546c1392 Correctly handle zero-length test inputs 2014-09-04 09:09:22 -07:00
Mohamed Hegazy 755fce2fd3 Merge pull request #493 from RReverser/patch-1
Fix for importing modules from definitions
2014-09-03 13:13:29 -07:00
Anders Hejlsberg be08411a6c Merge branch 'master' into deferredTypeLiterals 2014-09-03 10:53:21 -07:00
Ingvar Stepanyan 797ab01467 Return undefined instead of null. 2014-09-03 20:06:17 +03:00
Ingvar Stepanyan 4083d9299b Fixes #492
Conflicts:
	src/services/services.ts
2014-09-03 20:06:14 +03:00
Sheetal Nandi 7181184e32 Fixed the parenthesis around the expression around line indent calculation 2014-09-02 21:13:11 -07:00
Sheetal Nandi 223aaca674 Corrected linepos assignment 2014-09-02 21:11:21 -07:00
Ryan Cavanaugh f328c7c6f8 Handle missing files more gracefully; big perf gains in loggedIO 2014-09-02 17:16:25 -07:00
Ryan Cavanaugh 1249e9d06c Add timestamp to capture files for better tracking 2014-09-02 15:40:15 -07:00
Ryan Cavanaugh 18de560402 Add jake task for making instrumented tsc 2014-09-02 12:19:58 -07:00
Anders Hejlsberg 2105404931 Merge branch 'master' into deferredTypeLiterals 2014-08-30 16:14:11 -07:00
Sheetal Nandi 816b018ae2 Fix the tab and indent calculation when formatting comments in the emitted output 2014-08-29 20:49:47 -07:00
Sheetal Nandi a87a7794f4 Report error if exports or require is used for declaration name in external module
Fixes #63
2014-08-29 18:45:38 -07:00
Sheetal Nandi c2b78ead05 Handles all the line breaks in calculation of line-character position
lineFeed = 0x0A,              // \n
        carriageReturn = 0x0D,        // \r
        lineSeparator = 0x2028,
        paragraphSeparator = 0x2029,
        nextLine = 0x0085,

Fixes #131
2014-08-29 17:27:47 -07:00
Daniel Rosenwasser ba396ed28f Utilize getContainingFunction in services. 2014-08-29 17:13:14 -07:00
Mohamed Hegazy dc0560ae59 Merge branch 'master' into getReferences
Conflicts:
	tests/baselines/reference/aliasUsageInGenericFunction.types
	tests/baselines/reference/aliasUsageInObjectLiteral.types
	tests/baselines/reference/aliasUsageInOrExpression.types
	tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types
2014-08-29 15:56:36 -07:00
Daniel Rosenwasser fbb10cd6b3 Added getOccs support for return keywords. 2014-08-29 14:57:48 -07:00
Daniel Rosenwasser 3f3dd29461 Use isWhitespace in getIfElseOccurrences. 2014-08-29 14:52:43 -07:00
Mohamed Hegazy ee0c0f6cea Merge branch 'master' into restrictUseOfSys 2014-08-29 14:46:17 -07:00
Daniel Rosenwasser 38d7ba612f Added missing break statement. 2014-08-29 14:38:08 -07:00
Sheetal Nandi b514fa58a9 Merge pull request #514 from Microsoft/overloadSignatureDeclaration
Correct the declaration emit for overload implementation if there is single overload signature
2014-08-29 14:33:53 -07:00
Daniel Rosenwasser 0632d0c38c Addressed CR feedback, no longer highlighting elseifs with comments between. 2014-08-29 13:08:48 -07:00
Mohamed Hegazy 49d8157d28 ensure that sys is not used outside tsc.ts 2014-08-28 23:10:05 -07:00
Jason Freeman ad27af1a33 Merge branch 'master' into typeBaselines 2014-08-28 17:24:45 -07:00
Daniel Rosenwasser 24f6e41de1 Added getOccs support for if/else keywords, and some tests. 2014-08-28 17:14:57 -07:00
Jason Freeman 088ca88bfd Revert condition inside shouldWriteTypeOfFunctionSymbol 2014-08-28 13:18:59 -07:00
Jason Freeman 44c2453ec6 Don't use UseTypeOfFunction in typeWriter 2014-08-28 12:52:44 -07:00
Jason Freeman 46825ab05d Print Array as T[] 2014-08-28 12:48:30 -07:00
Jason Freeman 6a7d912fe4 Print pure namespaces as unknown 2014-08-28 12:40:58 -07:00
Jason Freeman 4e1bb26ad1 Print type of super 2014-08-28 12:31:37 -07:00
Daniel Rosenwasser 41d8d6c4e1 Merge pull request #549 from Microsoft/getOccurrences_switchCaseDefault
Get occurrences for switch/case/default/break keywords.
2014-08-28 11:41:33 -07:00
Sheetal Nandi 852f2d935c Merge pull request #516 from Microsoft/pinnedComments
Emit pinned or ///<reference> tag comments for signatures, ambient declaraitons and interfaces
2014-08-28 10:51:29 -07:00
Daniel Rosenwasser 813f28d865 Removed assertion. 2014-08-27 17:28:45 -07:00
Daniel Rosenwasser fd93a3b4f7 What's in a name anyhow? 2014-08-27 17:26:58 -07:00
Daniel Rosenwasser 0ce39a3c2a Addressed CR feedback. 2014-08-27 17:19:08 -07:00
Daniel Rosenwasser 04456a261a Made 'isAnyFunction' more exhaustive as it should be. 2014-08-27 16:58:59 -07:00
Daniel Rosenwasser ea613fd0d8 Replaced ES5 functions with analogous core.ts ones. 2014-08-27 16:39:05 -07:00
Daniel Rosenwasser 50d0cdc428 Better coverage against function boundaries. 2014-08-27 16:33:35 -07:00
Mohamed Hegazy 0f9c1adcd8 Merge branch 'master' into getReferences 2014-08-27 16:21:16 -07:00
Daniel Rosenwasser 232e51383f Moved null-guards to appropriate places, added helpers. 2014-08-27 16:07:46 -07:00
Anders Hejlsberg deaf8e4a78 Addressing CR feedback. 2014-08-27 13:54:23 -07:00
Daniel Rosenwasser 3825c9b542 Handled function boundaries. 2014-08-27 12:12:45 -07:00
Jason Freeman b13fb89d51 Merge branch 'master' into typeBaselines 2014-08-27 11:22:49 -07:00
Anders Hejlsberg f4d3c1c6e0 Deferred resolution of object literal members to support recursive types. 2014-08-26 20:45:31 -07:00
Daniel Rosenwasser 88f37e579c Support for switch/case/default/break in getOccs 2014-08-26 17:24:11 -07:00
Mohamed Hegazy 211008d015 Fix undefined symbol name in error message 2014-08-26 13:03:24 -07:00
Daniel Rosenwasser 1f77198c4c Made getOccs more resilient. 2014-08-26 12:27:54 -07:00
Daniel Rosenwasser 558be4ea22 Implemented getOccsAtPos for try-catch-finally. 2014-08-26 11:48:31 -07:00
Daniel Rosenwasser 5d15cd22b1 Beginning special casing for getOccurrencesAtPosition. 2014-08-26 11:44:30 -07:00
Daniel Rosenwasser e851e4b00b Removed unused method. 2014-08-25 17:57:50 -07:00
Daniel Rosenwasser f948f5d3f7 Re-added fourslash tests, corrected failures. 2014-08-25 17:35:18 -07:00
Daniel Rosenwasser 144eb8dc0d Added trivial syntax case. 2014-08-25 17:03:42 -07:00
Daniel Rosenwasser aef859f442 Merge branch 'master' into getReferences
Conflicts:
	src/services/services.ts
2014-08-25 16:51:35 -07:00
Daniel Rosenwasser 5c1b245d1d Initial work on getOccurrencesAtPosition. 2014-08-25 14:20:59 -07:00
Jason Freeman 828a1cd065 More type baseline changes 2014-08-25 11:04:30 -07:00
Jason Freeman cc20bb19d0 Baseline and harness changes 2014-08-25 10:55:22 -07:00
Mohamed Hegazy 892baf0d6c use Identifiers list from the parser to filter getReferences instead of bloomFilters 2014-08-22 22:27:05 -07:00
Mohamed Hegazy 695379404a remove bloom filters 2014-08-22 22:09:36 -07:00
Mohamed Hegazy 8fcc8b26ba Ensure range for string literal references are within the quotes to ensure rename is successful 2014-08-22 22:07:45 -07:00
Mohamed Hegazy c741e26031 Support external module names correctelly 2014-08-22 21:28:27 -07:00
Mohamed Hegazy fefe2fb093 Implement getScope 2014-08-22 16:30:21 -07:00
Daniel Rosenwasser b73558d208 Merge pull request #508 from Microsoft/printDiagnosticCodes
Emit error codes when reporting diagnostics.
2014-08-22 16:21:44 -07:00
Sheetal Nandi c4fdccacb8 Emit pinned/tripleslash reference comments of elided module declaration
Fixes #501
2014-08-22 16:10:33 -07:00
Sheetal Nandi 5353128387 Emit pinned/tripleslash reference comments of ambient declarations
Fixes #501
2014-08-22 16:10:26 -07:00
Sheetal Nandi 393464eb18 Emit pinned/tripleslash reference comments of interfaces
Fixes #501
2014-08-22 16:10:19 -07:00
Sheetal Nandi 85b892fd6a Emit pinned/tripleslash reference comments of signatures
Fixes #501
2014-08-22 16:10:11 -07:00
Sheetal Nandi e6cd3e15b0 Merge pull request #509 from Microsoft/emitLeadingCommentsForCurly
Emit leading comments for '}' of function/constructor block
2014-08-22 16:01:49 -07:00
Daniel Rosenwasser 48c6bdb2aa Merge branch 'master' into printDiagnosticCodes 2014-08-22 15:52:04 -07:00
Daniel Rosenwasser 7f4ae93904 Updated error reporting within harness to match that of tsc. 2014-08-22 15:32:40 -07:00
Cyrus Najmabadi 9aee22b943 Merge branch 'master' into newLanguageService
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/harness/fourslash.ts
	src/harness/harness.ts
	src/harness/harnessLanguageService.ts
	src/harness/rwcRunner.ts
	src/services/services.ts
2014-08-22 14:23:14 -07:00
Sheetal Nandi 519ef5b383 Correct the declaration emit for overload implementation if there is single overload signature
Fixes  #480
2014-08-22 13:24:57 -07:00
Daniel Rosenwasser d05a4c40b5 Made diagnostic lowercase. 2014-08-22 12:57:18 -07:00
Daniel Rosenwasser c3590aa233 Turned redeclaration into a string append. 2014-08-21 17:33:55 -07:00
Sheetal Nandi 53d79a25d3 Emit leading comments for '}' of the constructor block
Fixes #503
2014-08-21 17:17:32 -07:00
Sheetal Nandi 45e76e2bd2 Emit leading comments for '}' of the function block
Fixes #503
2014-08-21 17:17:02 -07:00
Sheetal Nandi 92e3202604 Fix the compilerRunner when compiling resulting d.ts file when --out is specified 2014-08-21 17:13:27 -07:00
Daniel Rosenwasser 07d56898ee Emit error codes when reporting diagnostics.
Addresses part of issue #506.
2014-08-21 17:08:58 -07:00
Sheetal Nandi 16d1cfd29d Merge pull request #505 from Microsoft/newLineBetweenSourceFiles
Emit new lines between source files emit so that the file contents always start on new line
2014-08-21 16:15:56 -07:00
Mohamed Hegazy f835b7c3b9 Merge pull request #504 from DickvdBrink/fix-declaration-emit-time
Fixed TypeScript.declarationEmitGetAccessorFunctionTime value
2014-08-21 14:03:42 -07:00
Sheetal Nandi 3e2de14933 Emit new lines between source files emit so that the file contents always start on new line
Fixes #500
2014-08-21 13:44:26 -07:00
Mohamed Hegazy dbf9e47832 use isDeclarationOrFunctionExpressionOrCatchVariableName instead of isDeclarationIdentifier in the language service and remove unused functions 2014-08-21 13:34:50 -07:00
Sheetal Nandi 753364768e Merge pull request #495 from Microsoft/rwcRunner
Simplifies RWC Runner to use HarnessCompiler.compileFiles so it can be used to baseline errors and sourcemaps more like compiler runner
2014-08-21 13:04:46 -07:00
Mohamed Hegazy 6965a06b04 Support getReferences on rightside of export assignment and import statements 2014-08-21 13:03:46 -07:00
Sheetal Nandi 2ac377cc76 Fixed the file map lookup to use hasOwnProperty 2014-08-21 13:03:08 -07:00
Mohamed Hegazy 5dc017b023 Merge pull request #502 from DickvdBrink/unused-var-parser
Remove some unused variables
2014-08-21 12:55:53 -07:00
Dick van den Brink 606601bc7c Fixed TypeScript.declarationEmitGetAccessorFunctionTime having a wrong value 2014-08-21 21:27:30 +02:00
Dick van den Brink c9e526ffe9 Remove some unused variables 2014-08-21 21:24:33 +02:00
Dick van den Brink 3cbb57fd51 Fix shouldAssert function
this.currentAssertionLevel was always undefined
2014-08-21 21:04:35 +02:00
Mohamed Hegazy bbeeb8df7f update getSymbolInfo 2014-08-21 00:13:29 -07:00
Mohamed Hegazy e0ffc47acc Merge branch 'master' into getReferences
Conflicts:
	src/compiler/checker.ts
2014-08-20 22:55:41 -07:00
Mohamed Hegazy 74518a9b7f respond to code review comments 2014-08-20 22:46:47 -07:00
Sheetal Nandi 6e4d0ef1ef Merge pull request #452 from Microsoft/emitComments
Emit comments in the .js and .d.ts files
2014-08-20 17:07:24 -07:00
Sheetal Nandi 8050959c10 Some minor changes as per code review feedback 2014-08-20 16:50:28 -07:00
Sheetal Nandi 412ef61cd8 Baseline sourcemap record from rwc runner 2014-08-20 15:57:25 -07:00
Sheetal Nandi 3d5f692c0a Emit the error file contents and highlight it to show errors for rwc errors 2014-08-20 15:44:52 -07:00
Mohamed Hegazy 978c2ef670 Fix getReferences for labels 2014-08-20 15:35:30 -07:00
Sheetal Nandi 58fca3773f Simplify rwc runner to use the common functionality to get errors, js files etc as part of harness compilation 2014-08-20 15:26:33 -07:00
Mohamed Hegazy 55512faa0d Use new tree to get Bloom filters 2014-08-20 11:25:39 -07:00
Jason Freeman e2071a344c Merge pull request #482 from Microsoft/typeWriter
Support resolution of any part of the RHS of an import
2014-08-20 13:22:28 -04:00
Sheetal Nandi 21020a71d1 Use local source file text to record source map span start 2014-08-19 20:33:36 -07:00
Sheetal Nandi b53e989f88 Emit declarations and sourcemaps in rwc test runner 2014-08-19 20:21:59 -07:00
Sheetal Nandi 0636a067fc Fix the new sourceMapRecording correctly if the multiple files output to single js file and the file ends with interface definition 2014-08-19 20:21:54 -07:00
Sheetal Nandi 4ba7446a7d Emit the line, col information into the rwc runner error baselines 2014-08-19 20:21:50 -07:00
Jason Freeman bfa2e940c0 Support resolution of any part of the RHS of an import 2014-08-19 15:04:30 -07:00
Sheetal Nandi b5bd1bf505 Emit detached comments for constructor body 2014-08-19 12:38:56 -07:00
Sheetal Nandi ebd00bd1bc Emit detached comments for function body 2014-08-19 12:06:52 -07:00
Sheetal Nandi a11ad539c4 Emit copyright headers before anything else in the sourceFile 2014-08-19 10:43:13 -07:00
Sheetal Nandi ce89da227d Include previous token trailing comments for parameters and type parameters as part of leading comments of them 2014-08-19 10:00:38 -07:00
Adam Freidin 828f4c9340 spelling fix 2014-08-19 08:01:12 -07:00
Cyrus Najmabadi 933f416d25 Add bits in tokens to mark if they contain leading/trailing trivia. 2014-08-19 01:37:35 -07:00
Jason Freeman f949c5014a Merge branch 'master' into typeWriter
Conflicts:
	src/compiler/types.ts
2014-08-18 19:57:35 -07:00
Jason Freeman a8c2f82f3c Temporary fix for import case in getTypeOfNode 2014-08-18 19:56:03 -07:00
Jason Freeman a08aa14a74 Address PR feedback 2014-08-18 18:51:18 -07:00
Daniel Rosenwasser 8baee8a785 Merge branch 'master' into diagnosticsCleanup 2014-08-18 15:42:58 -07:00
Daniel Rosenwasser a366984bc9 Reassigned diagnostic codes. 2014-08-18 15:42:27 -07:00
Jason Freeman d02d9bfa7e Merge branch 'master' into typeWriter
Conflicts:
	src/compiler/checker.ts
2014-08-18 14:37:21 -07:00
Mohamed Hegazy 54d8722189 Merge branch 'master' into classifier 2014-08-18 14:33:30 -07:00
Jason Freeman dc44edfa5f Clean up local state after the describe callback for each compiler test 2014-08-18 14:29:55 -07:00
Sheetal Nandi 7a5512cdd0 Merge pull request #466 from sparecycles/fix/checker-declaration
fix --declaration typechecking (complex case)
2014-08-18 13:32:50 -07:00
Sheetal Nandi e0faa65d4b Merge pull request #455 from Microsoft/formatComment
Align the multiline comments in the generated outputs by retaining its position relative to the first line in the comment
2014-08-18 13:26:18 -07:00
Mohamed Hegazy 2d4cec43f5 Updates after merge from master 2014-08-18 13:14:20 -07:00
Mohamed Hegazy 3251b7e234 Support filtering references based on meaning 2014-08-18 13:06:18 -07:00
Mohamed Hegazy f8122977a7 include inherited properties from base classes and interfaces in getReference results 2014-08-18 13:03:55 -07:00
Mohamed Hegazy 922d6d6258 support getReferences on properties and index access wiht numeric and string values 2014-08-18 13:03:35 -07:00
Mohamed Hegazy d419982422 Support getReferences on contextually typed object literal properties 2014-08-18 13:03:25 -07:00
Mohamed Hegazy 55d002117c support getReferences on object literals 2014-08-18 13:00:31 -07:00
Mohamed Hegazy fa1033ab7a add support for getReferences on property string index access 2014-08-18 12:41:22 -07:00
Mohamed Hegazy bfd13347d4 Handel getRefrences for labels 2014-08-18 12:41:12 -07:00
Mohamed Hegazy 901e8a83be Add basic getReferences implementation 2014-08-18 12:40:51 -07:00
Mohamed Hegazy f84d2af9e7 disable resolution for now 2014-08-18 12:40:41 -07:00
Mohamed Hegazy 32a5984601 expose utility functions 2014-08-18 12:40:10 -07:00