Commit graph

1190 commits

Author SHA1 Message Date
Sheetal Nandi 49ac60f286 Support resolveJsonModule option when files contain the json file
Fixes #25636
2018-07-13 12:21:51 -07:00
Sheetal Nandi 4dc3cd3773 Use getEmitModuleKind to check module generation kind 2018-07-10 15:28:21 -07:00
Sheetal Nandi 3866a5048b Report errors for module generation other than "commonjs" with --resolveJsonModule
Fixes #25517
2018-07-10 15:00:46 -07:00
Ryan Cavanaugh d7ce0eae3a
Merge pull request #25524 from RyanCavanaugh/useGetEmitDeclarations
Use getEmitDeclarations instead of .declarations
2018-07-10 10:59:06 -07:00
Ryan Cavanaugh 72f0789908 Don't crash when an implicit rootDir constraint is violated under composite:true
Fixes #25527
2018-07-09 15:41:15 -07:00
Ryan Cavanaugh 1b1ffe952b Use getEmitDeclarations instead of .declarations 2018-07-09 14:51:40 -07:00
Andy 64555aa6a9
navigateTo: Collect results from all referenced projects. (#25283)
* navigateTo: Collect results from all referenced projects.

* Don't use project references, just source maps

* Move more code to session

* Test when implementation file is deleted

* Use tsserver tests instead of fourslash tests to ensure session is used

* Support find-all-references

* Restore fourslash tests

* Update emit baselines (added missing newline)

* Support rename

* @weswigham code review

* Don't open/close files

* Avoid growing `toDo` too eagerly

* @sheetalkamat code review

* Also get symlinked projects for originalLocation

* Update API (#24966)

* More @sheetalkamat code review

* Remove unnecessary test

* Update API (#24966)
2018-07-05 15:39:03 -07:00
Wesley Wigham 7084e6cf47
Adds related spans and error grouping for duplicate identifier errors (#25328)
* Adds related spans and error grouping for duplicate identifier errors

* Trim trailing whitespace

* Record related info in error baselines

* Make error more whimsical
2018-07-02 10:47:52 -07:00
Wesley Wigham 30db30055f
Fix module specifier case handling for declaration emit (#25110) 2018-06-29 11:02:43 -07:00
Wesley Wigham bd97e12f76
Multifaceted approach to performantly enabling fileExists outside of the synchronize step in the emit host (#25107)
* Multifaceted approach to performantly enabling fileExists outside of the synchronize step in the emit host

* make cache undefinable and handle correctly

* Remove unneeded cast

* Readd assert

* More useful failure messager
2018-06-22 14:05:36 -07:00
Ron Buckton 5bc8f957f1 Address lint warnings 2018-06-19 02:31:03 -07:00
Ron Buckton 891b15f60a Update gulpfile to support project references 2018-06-18 22:45:13 -07:00
Wesley Wigham 640af3f75e
Introduce related spans into tsserver protocol (#24548)
* Introduce related spans into tsserver protocol

* Incorporate pretty output, implement esModuleInterop related span
2018-06-15 10:54:36 -07:00
Wesley Wigham 2a1503610b
Stop generating sectional sourcemaps (#24917)
* Generate normal 1-part sourcemaps (at increased processing cost), since tools dislike sectional ones

* Add semicolon

* Accept sad baselines]

* Forward along sourcesContent if available

* Supress lint since the API actually calls for null here

* Fix concatenated sourcemap paths

* Accept bad baselines :(

* Add overloads

* Accept api update

* Fix lint
2018-06-13 18:52:23 -07:00
Ron Buckton 756e46bfe3 Reuse resolvedProjectReferences 2018-06-11 17:59:32 -07:00
Ryan Cavanaugh 5804905ca6 Jakefile rewrite WIP 2018-06-10 13:23:16 -07:00
Ryan Cavanaugh 856fc79ae7 Lint 2018-06-05 16:28:42 -07:00
Ryan Cavanaugh 5111f4d541 Move proj ref logic to the right place 2018-06-05 16:20:07 -07:00
Ryan Cavanaugh cf87bd446d Merge branch 'master' into tsbuild 2018-06-05 14:55:51 -07:00
Wesley Wigham d9b93903c0
Use more nodelike paths for import types when possible (#24610)
* Use more nodelike paths for import types when possible

* move functionality from services into compiler, fix with propert file/directory conflict handling

* mark suspect cast
2018-06-05 12:54:36 -07:00
Ryan Cavanaugh 45842a0c34 Merge remote-tracking branch 'weswigham/sourcemap-concatenation-station' into tsbuild 2018-06-05 12:31:32 -07:00
Ron Buckton fbeb58a147
Merge pull request #23893 from Microsoft/libReference
Adds 'lib' reference directives
2018-06-04 16:14:52 -07:00
Ron Buckton 666841264c Merge branch 'master' into libReference 2018-06-04 14:38:56 -07:00
Wesley Wigham 7eaa78846e
Visit the children of an import type/require call/dynamic import when looking for those (#24663) 2018-06-04 14:31:56 -07:00
Ryan Cavanaugh 9b0dc37f42 Merge branch 'fixMissingScriptInfo' into tsbuild 2018-06-04 10:59:42 -07:00
David Sherret 7e0ed5ec4d Fix createProgram js docs. 2018-06-01 23:29:05 -04:00
Ryan Cavanaugh 7e9e29ce64 Store + use the resolved path of sourceFiles in proj. ref. scenarios 2018-06-01 13:20:57 -07:00
Sheetal Nandi b0f039c9e2 Make suggestion diagnostics to wire cancellationToken
This especially needed if its a js file without the ts-check, the file wont be typechecked in getSemanticDiagnostics
Fixes part of #19458
2018-05-31 10:47:17 -07:00
Ron Buckton 7de55fbb7e PR Feedback 2018-05-31 09:50:51 -07:00
Wesley Wigham 8adbf85e0e
Candidate sectional sourcemap emit implementation 2018-05-30 17:53:26 -07:00
Ron Buckton ec0af20f5a Merge branch 'master' into libReference 2018-05-29 14:13:00 -07:00
Ryan Cavanaugh fe191fec6d Merge branch 'master' into tsbuild 2018-05-29 13:14:12 -07:00
Ryan Cavanaugh 19ab8abbb9 Fix strictNullChecks breaks 2018-05-24 13:42:12 -07:00
Sheetal Nandi 51058b56e5 Do not trigger invalidation if emitted file is in declarationDir 2018-05-24 13:36:52 -07:00
Ryan Cavanaugh 8936b030cd Merge branch 'master' into tsbuild 2018-05-24 13:01:58 -07:00
Andy e53e56cf82
Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
Andy 7106a587cc
Add type for diagnostics where location is defined (#23686)
* Add type for diagnostics where location is defined

* getSemanticDiagnostics may return global diagnostics

* Reduce array creation
2018-05-22 11:01:18 -07:00
Ryan Cavanaugh 7e0825a3e7 Clean, etc 2018-05-21 17:47:58 -07:00
Ron Buckton 698f229bb4 Merge branch 'master' into libReference 2018-05-09 11:41:13 -07:00
Alex Ryan 01351d43e4
Fix comment typo in program.ts 2018-05-08 14:36:32 -07:00
Wesley Wigham 8ab5be9a86
Add hook for adding transforms into the declaration emit pipeline after the main one (#23946)
* Add hook for adding transforms into the declaration emit pipeline after the main one

* Fix lint
2018-05-08 11:20:48 -07:00
Ryan Cavanaugh ffa0ccba2a Project References Core support 2018-05-07 15:12:50 -07:00
Ron Buckton 68c0e524a6 Accept new symbol baselines, ensure expected ordering for default libs 2018-05-04 17:23:56 -07:00
Ron Buckton 8d230fc428 Fix typo in comment 2018-05-04 15:51:13 -07:00
Ron Buckton a089297ca3 Add 'lib' reference support 2018-05-04 15:51:13 -07:00
Sheetal Nandi 4e6586deb8 PR feedback 2018-05-04 10:45:46 -07:00
Sheetal Nandi 15f9ea3d14 Merge branch 'master' into requireJson 2018-05-03 15:35:54 -07:00
Ron Buckton 56648ad0f1
Merge pull request #20763 from Microsoft/vfs
Update harness to use single robust virtual file system for tests.
2018-05-03 10:25:20 -07:00
Armando Aguirre 1d593fd81e
Merge pull request #23191 from armanio123/AddVueSupport
Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExte…
2018-05-02 18:13:34 -07:00
Ron Buckton d62a11ffc0 Merge branch 'master' into vfs 2018-05-01 18:58:31 -07:00
Ron Buckton 1dff0af646 More path cleanup 2018-05-01 18:53:54 -07:00
Mohamed Hegazy 2c956af927
Merge pull request #23664 from a-tarasyuk/feature/strictPropertyInitialization-can-not-be-used-without-strictNullChecks
Add warn that user can not use --strictPropertyInitialization without --strictNullChecks
2018-04-30 12:10:54 -07:00
Sheetal Nandi 579748bc2b Merge branch 'master' into requireJson 2018-04-30 11:44:09 -07:00
Daniel Rosenwasser 9672116d8c Merge remote-tracking branch 'origin/master' into importDotMeta 2018-04-25 22:21:56 -07:00
Alexader a20e59cae4 Add warn that user can not use --strictPropertyInitialization without --strictNullChecks 2018-04-24 21:48:46 +03:00
Andy 5c94bef0e1
Add 'renameFile' command to services (#23573)
* Add 'renameFile' command to services

* renameFile -> getEditsForFileRename

* Support `<reference path>` directives
2018-04-20 13:43:09 -07:00
Wesley Wigham 238ed7a94c
Visit EOF to collect jsdoc import types (#23521)
* Visit EOF to collect jsdoc import types

* Add flag to prevent jsdoc import types from influencing compilation set
2018-04-18 19:52:34 -04:00
Armando Aguirre 9923003ee6 Merge branch 'master' into AddVueSupport 2018-04-16 13:45:34 -07:00
Sheetal Nandi ce08af4dfe Merge branch 'master' into requireJson 2018-04-13 15:26:16 -07:00
Ryan Cavanaugh df95de3231 Merge branch 'master' into referencesDogfood_1 2018-04-11 16:17:38 -07:00
Ryan Cavanaugh 8294259ec2 Remove all reference comments from compiler/ 2018-04-11 15:38:26 -07:00
Andy a004571d3e
Update outdated comments (#23320) 2018-04-11 07:56:42 -07:00
Daniel Rosenwasser 9e2bbb6f8a Basic parsing/emitting support for 'import.meta'. 2018-04-10 12:55:43 -07:00
Armando Aguirre 50eb512566 Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExtensionInfo 2018-04-05 17:30:04 -07:00
Sheetal Nandi a14396320b Resolve json modules only when --resolveJsonModule is specified 2018-04-05 15:37:13 -07:00
Sheetal Nandi 9f724156be Merge branch 'master' into requireJson 2018-04-05 15:18:21 -07:00
Mohamed Hegazy e6fa4e4415
Merge pull request #23043 from alan-agius4/feature/compiler-host-falsy-file
fix: `CompilerHost.getSourceFile` is being called for odd filenames
2018-04-02 17:08:31 -07:00
Alan Agius 7e482b27fb fix: CompilerHost.getSourceFile is being called for odd filenames besides the one being compiled
Ignore falsy file names from `getDefaultLibraryFileName`

Closes: #13629
2018-04-02 20:58:37 +02:00
Wesley Wigham 414bc49cc4
Module or import types (#22592)
* Type side of import types

* Value side of import types

* Accept library changes

* Refined implementation, more tests

* Allow resolutions to be performed late if the resolution still results in a file already in the build

* Add another test case

* Add some jsdoc usages

* Allow nodebuilder to use import types where appropriate

* Parse & check generic instantiations

* use import types in nodebuilder for typeof module symbols

* Wire up go to definition for import types

* Accept updated type/symbol baselines now that symbols are wired in

* PR feedback

* Fix changes from merge

* Walk back late import handling

* Remove unused diagnostic

* Remove unrelated changes

* Use recursive function over loop

* Emit type arguments

* undo unrelated change

* Test for and support import type nodes in bundled declaration emit
2018-04-02 10:18:23 -07:00
Andy 5cef6274c3
Remove duplicate helper function (#23001) 2018-03-29 15:43:31 -07:00
Sheetal Nandi a0fe072fa7
Merge pull request #22613 from Microsoft/configFileErrors
Make config file parsing errors available through program and expose API
2018-03-29 13:08:03 -07:00
Wesley Wigham 6af764c560
Declaration maps and transparent goto definition using them (#22658)
* Add compiler option to enable declaration sourcemaps

* Transparent goto definition for sourcemapped declaration files

* Post-rebase touchups

* Rename API methods

* Fix lints

* Fix typo in name XD

* Log sourcemap decode errors

* Share the cache more, but also invalidate it more

* Remove todo

* Enable mapping on go to implementation as well

* Allow fourslash to test declaration maps mroe easily

* more test

* Handle sourceRoot

* Add tests documenting current behavior with other sourcemapping flags

* Ignore inline options for declaration file maps, simplify dispatch in emitter

* Change program diagnostic

* Fix nit

* Use charCodeAt

* Rename internal methods + veriables

* Avoid filter

* span -> position

* Use character codes

* Dont parse our sourcemap names until we need to start using them

* zero-index parsed positions

* Handle sourceMappingURL comments, including base64 encoded ones

* Unittest b64 decoder, make mroe robust to handle unicode properly

* Fix lint

* declarationMaps -> declarationMap

* Even more feedback

* USE Mroe lenient combined regexp

* only match base64 characters

* Fix nit
2018-03-26 12:15:34 -07:00
Wesley Wigham a909000b62
Parse and check type arguments on JSX opening and self-closing tags (#22415)
* Parse and check type arguments on JSX opening like elements

* Fix nits
2018-03-22 15:07:36 -07:00
Sheetal Nandi b4e0062b41 Merge branch 'master' into requireJson 2018-03-16 14:46:34 -07:00
Andy 28ff6b6ef3
Store import nodes in SourceFile.imports instead of StringLiteral nodes (#22495)
* Store import nodes in SourceFile.imports instead of StringLiteral nodes

* Change SourceFile#imports storage back

* Code review

* StringLiteral -> StringLiteralLike
2018-03-16 14:01:00 -07:00
Sheetal Nandi 7329eb1ab1 Make sure config file parsing errors are available through program
Fixes #22570, #21940
2018-03-15 14:58:50 -07:00
Sheetal Nandi 2d9af0b95c Merge branch 'master' into requireJson 2018-03-09 16:51:05 -08:00
Martyn Janes bcf6e342f1 Fix typo in emitDeclarationOnly error message for declaration required 2018-03-09 22:37:10 +03:00
Sheetal Nandi 2071466420 Merge branch 'master' into requireJson 2018-03-08 13:24:59 -08:00
Andy fa4619c5c1
Add 'info' diagnostics (#22204)
* Add 'info' diagnostics

* Code review
2018-02-28 11:16:32 -08:00
Sheetal Nandi 4257c2fa04 Resolve the .json file only if module name contains the extension 2018-02-23 17:27:17 -08:00
Sheetal Nandi a790a92f7d Parse all json values at root 2018-02-23 14:00:30 -08:00
Sheetal Nandi ca590d6fed Need allowJs to be true to use the json module resolution 2018-02-23 14:00:23 -08:00
Sheetal Nandi ee2e267d38 Replace usage of jsonObject on JsonSourceFile 2018-02-23 13:59:47 -08:00
Sheetal Nandi 5771adbbe7 Resolve Json file when module resolution strategy is node 2018-02-23 13:54:39 -08:00
Alex Eagle 2e66e74e14 fix --pretty output when context is multi-line
Fixes #22097
2018-02-22 22:56:00 -08:00
Andy b3edc8f9f4
Apply 'no-unnecessary-type-assertion' lint rule (#22005)
* Apply 'no-unnecessary-type-assertion' lint rule

* Fix type error

* Fix tsconfig.json

* Add --format back
2018-02-16 18:38:00 -08:00
Mohamed Hegazy 8f8fec433e
Rename switch --emitDeclarationsOnly to --emitDeclarationOnly (#21651)
* Rename `--emitDeclarationsOnly` to `--renameDeclarationOnly`

* Rename test files
2018-02-05 14:48:50 -08:00
AdityaDaflapurkar 39d78b7a2b Fix minor typos in documentation (#21538) 2018-02-01 10:58:31 -08:00
Sheetal Nandi cf540198e6 Always get diagnostics when emitting irrespective of whether its declaration only emit
The diagnostics reporting and expression resolution caching is quite intermingled at present.
Hence when we tried to get the declaration output without getting diagnostics, the resolution for functions return expression is cached but errors arent reported
Symbols arent marked as referenced. So at later time when trying to get the diagnostics since the expression resolution is cached, it doesnt even go through all checks
For now get diagnostics irrespective of declaration only output to avoid this issue.
Fixes #21518
2018-01-31 16:22:27 -08:00
Sheetal Nandi 76bf470072 Simplify isEmittedFile check instead of iterating through all source files.
Fixes #21459
2018-01-29 15:50:58 -08:00
Manoj Patel afc588eb9e --emitDeclarationsOnly flag to enable declarations only output (#20735)
* Add emitOnlyDeclarations flag

* Fix name

* verifyOptions checking logic

* Passing tests

* doJsEmitBaseline

* Tests !!!
2018-01-25 15:35:18 -08:00
Sheetal Nandi ed23ca582a Merge branch 'master' into builderApi 2018-01-17 16:11:44 -08:00
Andy b363f4f9cd
Log packageId in --traceResolution (#21233) 2018-01-17 11:41:23 -08:00
Sheetal Nandi 5bd3f97b18 Merge branch 'master' into builderApi 2018-01-16 11:14:39 -08:00
Sheetal Nandi 69bb5ea8f0 Do not trigger the failed lookup location invalidation for creation of program emit files
Handles #20934
2018-01-11 12:34:58 -08:00
Wesley Wigham 7e6315075d
Synthesize namespace records for proper esm interop (#19675)
* Integrate importStar and importDefault helpers

* Accept baselines

* Support dynamic imports, write helpers for umd module (and amd is possible) kinds

* Accept baselines

* Support AMD, use same helper initialization as is normal

* update typechecker to have errors on called imported namespaces and good error recovery with a quickfix

* Overhaul allowSyntheticDefaultExports to be safer

* Put the new behavior behind a flag

* Rename strictESM to ESMInterop

* ESMInterop -> ESModuleInterop, make default for tsc --init

* Rename ESMInterop -> ESModuleInterop in module.ts, add emit test (since fourslash doesnt do that)

* Remove erroneous semicolons from helper

* Reword diagnostic

* Change style

* Edit followup diagnostic

* Add secondary quickfix for call sites, tests forthcoming

* Add synth default to namespace import type, enhance quickfix

* Pair of spare tests for good measure

* Fix typos in diagnostic message

* Improve comment clarity

* Actually accept the updated changes to the esmodule interop description

* ESModule -> esModule

* Use find and not forEach

* Use guard

* Rely on implicit falsiness of Result.False

* These should have been emit flags
2018-01-08 16:36:23 -08:00
Sheetal Nandi 5bc78afcbb Merge branch 'master' into builderApi 2018-01-08 13:01:09 -08:00
Klaus Meinhardt 7ef541ca1f findConfigFile can return undefined (#20556) 2018-01-04 16:56:29 -08:00
Orta 5865494453 Switch the pretty output to use colons to separate file:line:char so that lines are clickable in terminals (#20736) 2018-01-04 16:38:52 -08:00
Daniel Rosenwasser ccd5608392
Merge pull request #20416 from JoshuaKGoldberg/tell-me-im-pretty
Prettified timestamps and error reports in --pretty
2017-12-19 12:59:35 -08:00
Josh Goldberg b3151707df Converted to enum; marked internal 2017-12-19 12:19:39 -08:00
Sheetal Nandi 2611c9b339 Merge branch 'master' into builderApi 2017-12-07 20:23:15 -08:00
Sheetal Nandi 4c21cbf145 Create builderState so that when FilesAffectedBy is only api needed, we arent tracking changed files 2017-12-07 11:47:49 -08:00
Ryan Cavanaugh c15470595f Dedupe local types from ATA and reuse old programs correctly 2017-12-06 13:17:21 -08:00
Sheetal Nandi 43c2610a69 More functions moved from system to WatchCompilerHost 2017-12-05 16:53:34 -08:00
Josh Goldberg 98b64db811 Re-added blue color, with corrected 94m code 2017-12-04 22:28:56 -08:00
Josh Goldberg eb5d8d0dd7 Prettified timestamps and error reports in --pretty
Timestamps look like Gulp's, with grey times inside white brackets.
Files have cyan filenames, yellow line and column numbers, and grey TS{####} errors. I wonder if those are actually useful for folks using the --pretty CLI: are they used for anything outside Visual Studio... Can we just get rid of them?

Re-uses compiler/program's color logic in compiler/watch. The relevant variables are now exported and marked `@internal`. Is there a preferred way of re-using this code in both those files?
2017-12-02 20:56:35 -08:00
Sheetal Nandi 0b79f4a073 Handle emit only declaration file to always produce declaration file and skip the diagnostics check 2017-11-22 18:37:07 -08:00
Sheetal Nandi 012f12bcbd To handle cancellation token, remove changed/affected files from the changeset only after getting the result 2017-11-22 18:24:53 -08:00
Nathan Shively-Sanders 744760df91 Cache result of isCheckJsEnabledForFile in getSemanticDiagnosticsForFile 2017-11-20 08:34:01 -08:00
Nathan Shively-Sanders eeeefcc10e Report jsdoc errors as semantic errors
This allows reporting of semantic errors as well. Semantic errors are
likely to outnumber syntactic errors, so it's valuable not to block
semantic errors on a few syntactic errors.
2017-11-17 10:38:30 -08:00
Andy 592ee00906
Have CompletionEntryDetails source use a relative path (#19917)
* Have CompletionEntryDetails source use a relative path

* Use getCanonicalFileName from services Instead of creating a new one
2017-11-14 14:26:49 -08:00
Mohamed Hegazy 1de3bbac2e Merge branch 'update-types3' of https://github.com/ajafff/TypeScript into ajafff-update-types3 2017-11-07 15:23:38 -08:00
Ron Buckton 31c3d444f1 Merge branch 'master' into compareStrings 2017-11-03 23:01:51 -07:00
Andy 1d7f449a87
Minor cleanups in pathCompletions.ts (#19685)
* Minor cleanups in pathCompletions.ts

* Update name
2017-11-03 15:06:22 -07:00
Mohamed Hegazy 6c71ca84e7
Add utility function to check for strict option flags (#19427)
* Add utility function to check for strict option flags
- Correctelly check for noImplicitAny in checker
- Correctelly check for noImplicitAny in installTypesForPackage refactor

* Respond to code review comments

* Accept baselines

* Revert "Accept baselines"

This reverts commit cf4ef62830.

* Move type alias to core
2017-10-30 13:05:54 -07:00
Ron Buckton 24437774a8 Further simplification 2017-10-26 11:56:29 -07:00
Ron Buckton 3605e4ef69 Remove unnecessary comment 2017-10-25 18:04:31 -07:00
Ron Buckton c0ed26e605 Simplify comparers 2017-10-25 17:46:39 -07:00
Ron Buckton 130c407708 More control over which collator to use in each situation 2017-10-25 16:30:19 -07:00
Ron Buckton 4d7923af00 Consistent naming 2017-10-24 16:37:41 -07:00
Ron Buckton dee77ced7c Added 'equateStrings' for string equality comparisons (rather than sorting) 2017-10-24 16:14:49 -07:00
Ron Buckton 763d17e947 Manually inline a few cases to reduce repeated 'ignoreCase' conditionals in loops 2017-10-24 14:17:29 -07:00
Sheetal Nandi 7828746cc9 Set the files found during node_modules search correctly when reusing existing program structure
This marks files reused correctly as from external library resulting in not using them for files to be emitted and computed for output structure
Fixes #19327
2017-10-23 19:05:38 -07:00
Klaus Meinhardt 3416e91468 Merge branch 'master' of https://github.com/Microsoft/TypeScript into update-types3 2017-10-22 22:35:21 +02:00
Bill Ticehurst 45ba0ac3b9 Set the scriptKind from the host configuration if present 2017-10-18 10:41:57 -07:00
Sheetal Nandi bce77fdfd9 Merge pull request #18960 from Microsoft/builderHandlesChangeInResolution
Builder handles changes in resolution/references when file's contents dont change
2017-10-11 12:11:44 -07:00
Klaus Meinhardt 9935bc0b2f Merge branch 'master' into update-types3 2017-10-07 00:15:20 +02:00
Sheetal Nandi 03441fe120 Merge branch 'master' into projectRootAsCurrentDirectoryInEmit 2017-10-04 18:48:16 -07:00
Sheetal Nandi bf4ca30bc3 Let builder find out from imports/typereference directives if file references have changed.
This is needed to ensure that the ambient module addition takes effect
Fixes #15632
2017-10-04 18:09:09 -07:00
Mohamed Hegazy ae3f29ade6 Accept baselines (#18903) 2017-10-02 19:08:13 -07:00
Sheetal Nandi 7f969e8138 Making APIs as internal so that we can enable them after we have figured out final details 2017-10-02 16:27:26 -07:00
Sheetal Nandi 835153ba50 PR feedback 2017-10-02 12:22:05 -07:00
Sheetal Nandi 9e08caebf5 Merge branch 'master' into watchImprovements 2017-09-29 10:43:05 -07:00
Daniel Rosenwasser 0ea7c61eb5 Merge pull request #18810 from Microsoft/unusedErrorArgs
Remove unused arguments for diagnostics
2017-09-28 12:51:57 -07:00
Daniel Rosenwasser 76d92a5dd6 Remove unused arguments in program.ts. 2017-09-27 22:04:52 -07:00
Sheetal Nandi fad71d3dc6 Use project root as the current directory whenever possible to create the project 2017-09-27 17:19:54 -07:00
Alex Eagle 9753d3950b --pretty output: move context after the file/error
Fixes #16583
2017-09-27 13:55:30 -07:00
Sheetal Nandi 68d360585a PR feedback 2017-09-26 16:21:15 -07:00
Sheetal Nandi 23acff5bc8 Merge branch 'master' into watchImprovements 2017-09-25 16:18:26 -07:00
Andy 25ad0b5581 Apply "array-type" lint rule (#18699) 2017-09-22 16:14:41 -07:00
Anders Hejlsberg 8f4a2c184c Merge pull request #18457 from Microsoft/tsIgnoreInTSFiles
Suppress errors in .ts files using '// @ts-ignore' comments
2017-09-20 00:56:56 +01:00
Andy 0ae42ea3de Allow relative imports of '.js' files when --noImplicitAny is disabled (#18489)
* Allow relative imports of '.js' files when `--noImplicitAny` is disabled

* Update baselines, and don't ignore a diagnostic about missing JSX
2017-09-19 12:42:29 -07:00
Armando Aguirre b03fbaf313 Merge branch 'master' into FixRenameInDefaultLibrary 2017-09-14 12:01:31 -07:00
Anders Hejlsberg f28d80d7d4 Support '// @ts-ignore' comments in .ts files 2017-09-13 15:40:10 -07:00
Sheetal Nandi b536f9dade Should not remove the reused resolutions in the file when file contents have not changed. 2017-09-12 12:09:06 -07:00
Sheetal Nandi fdb104b242 Merge branch 'master' into watchImprovements 2017-09-11 13:49:36 -07:00
Sheetal Nandi de28d02626 Add test case to verify correct resolution file is picked when current resolution file is not removed but higher precedence file is created 2017-09-08 15:45:47 -07:00
Andy 2e02778960 When loading a module from node_modules, get packageId even in the loadModuleFromFile case (#18185)
* When loading a module from node_modules, get packageId even in the `loadModuleFromFile` case

* Support packageId for <reference types> too
2017-09-07 14:31:20 -07:00
Klaus Meinhardt 4f61eef4c3 Merge branch 'master' of https://github.com/Microsoft/TypeScript into update-types3 2017-09-07 22:14:46 +02:00
Mohamed Hegazy 0637792f1b Merge branch 'master' into update-types3 2017-09-07 12:33:32 -07:00
Daniel Rosenwasser 448d75c08f Merge pull request #17675 from HerringtonDarkholme/master
fix #16567: better coloring on light theme terminal
2017-09-07 12:33:12 -07:00
Wesley Wigham 6695255d86 Allow trailing newline to have fake position (#18298)
* Actually support baselining pretty in the harness

* Test case from 18216

* Use host newline in formatDiagnosticsWithColorAndContext

* Merge statements
2017-09-07 12:26:23 -07:00
Sheetal Nandi 16cf7c40a8 Watch for the automatic types that included as part of type resolution 2017-08-31 09:13:59 -07:00
Sheetal Nandi 4c79033894 Refactoring to watches and caching of system such that we minimize function expressions
Also unified watcher info logging
2017-08-31 09:13:59 -07:00
Andy 4d05bfdf4a moduleAugmentations may contain an Identifier (#18009)
* `moduleAugmentations` may contain an `Identifier`

* Add comment

* Rename function
2017-08-25 15:14:51 -07:00
Andy e2141ad469 Mark some arrays as readonly (#17725)
* Mark some arrays as readonly

* Avoid unnecessary allocations and style changes

* Fix lint
2017-08-24 09:55:01 -07:00
Sheetal Nandi 8deef58fd6 Remove the unused function from the Project since builder has this logic now. 2017-08-18 12:15:03 -07:00
Armando Aguirre 9dd574b1a9 Added host.useCaseSens..., memoized getDefaultLibFileName. 2017-08-15 18:44:28 -07:00
Armando Aguirre 88262dbeb0 Changed check for default library by first checking hasNoDefaultLib, second library path and third name of file. 2017-08-14 18:19:43 -07:00
Armando Aguirre 5b86055786 Excluded the default library from rename service. 2017-08-14 17:58:04 -07:00
Sheetal Nandi 136b091a4a Update based on feedback 2017-08-14 16:34:30 -07:00
Sheetal Nandi 989508245b Updating according to feedback from PR 2017-08-14 12:52:29 -07:00
Sheetal Nandi 59d07dc488 Simplified mutate map options 2017-08-14 11:27:02 -07:00
Sheetal Nandi d0a23bb876 Merge branch 'watchImprovements' into builder 2017-08-12 15:35:30 -07:00
Andy 37b20ee670 For duplicate source files of the same package, make one redirect to the other (#16274)
* For duplicate source files of the same package, make one redirect to the other

* Add reuseProgramStructure tests

* Copy `sourceFileToPackageId` and `isSourceFileTargetOfRedirect` only if we completely reuse old structure

* Use fallthrough instead of early exit from loop

* Use a set to efficiently detect duplicate package names

* Move map setting outside of createRedirectSourceFile

* Correctly handle seenPackageNames set

* sourceFileToPackageId -> sourceFileToPackageName

* Renames

* Respond to PR comments

* Fix bug where `oldSourceFile !== newSourceFile` because oldSourceFile was a redirect

* Clean up redirectInfo

* Respond to PR comments
2017-08-09 14:39:06 -07:00
Herrington Darkholme 0255adc407 fix #16567: better coloring on light theme terminal 2017-08-08 10:12:11 +08:00
Sheetal Nandi 7474ba762c Implementation for invalidating source file containing possibly changed module resolution 2017-08-07 11:31:13 -07:00
Sheetal Nandi 46e3d1c1d9 Refactoring so that instead of just using from tsc --watch the new api is accessible all the time 2017-08-07 11:31:12 -07:00
Sheetal Nandi c814d8e847 Add tests for the tsc --watch 2017-08-07 11:24:07 -07:00
Sheetal Nandi 6237b221da Move the builder to compiler directory 2017-08-07 11:19:52 -07:00
Sheetal Nandi ef5935b52c Initial refactoring so that watch from tsc follows the tsserver projects 2017-08-07 11:19:52 -07:00
Sheetal Nandi 94a589b3bb Program cannot be reused if the missing file is now present
Also dont update filesByName array just to update missing file paths
2017-08-07 11:04:33 -07:00
Sheetal Nandi 273569f6fe Make the host cache store the fileName instead of undefined for the missing host files 2017-08-07 11:04:33 -07:00
Andy f945b26b54 Forbid type assertions in '.js' files (#17503) 2017-07-29 05:41:08 -07:00
Andy eadd084c82 Add 'name' property to Identifier (#17329)
* Add 'name' property to Identifier

* Rename to unescapedText

* Rename 'id.text' to 'id.escapedText'

* Rename 'id.unescapedText' to 'id.text'

* Make escapeIdentifier and unescapeIdentifier do nothing
2017-07-25 13:16:34 -07:00
Andy 53e4040ceb Remove duplicate emptyArrays (#17305) 2017-07-20 06:45:22 -07:00
Daniel Rosenwasser e8421827e0 Merge pull request #16600 from alexeagle/pretty2
Add missing newline in --pretty diagnostics formatter
2017-07-14 12:22:05 -07:00
Andy a0c672ac02 Add assertion that module / type reference names are defined (#17124) 2017-07-12 10:13:33 -07:00
Andy 8c3f5e2208 Remove createFileMap (#16810)
* Make `createFileMap` an internal detail of `program.ts`

* Remove createFileMap

* Clean up calls to `toPath`
2017-07-10 11:24:17 -07:00
Andy 17578e8a5d Use Map<true> for sets (#16972) 2017-07-07 10:34:36 -07:00
Wesley Wigham 4e6b2f3c93 Created a branded type for identifier-escaped strings (#16915)
* Created a branded type for escaped strings

Then flowed it throughout the compiler, finding and fixing a handful of
bugs relating to underscore-prefixed identifiers in the process.
Includes a test for two cases noticed - diagnostics from conflicting
symbols from export *'s, and enum with underscore prefixed member emit.

* Correctly double underscores WRT mapped types

* Add fourslash tests for other fixed issues

* use function call over cast

* Update forEachEntry type accuracy

* Just use escaped names for ActiveLabel

* Remove casts from getPropertyNameForPropertyNameNode

* This pattern has occurred a few times, could use a helper function.

* Remove duplicated helper

* Remove unneeded check, use helper

* Identifiers list is no longer escaped strings

* Extract repeated string-getting code into helper

* Rename type and associated functions

* Make getName() return UnderscoreEscapedString, add getUnescapedName()

* Add list of internal symbol names to escaped string type to cut back on casting

* Remove outdated comments

* Reassign interned values to nodes, just in case

* Swap to string enum

* Add deprecated aliases to escapeIdentifier and unescapeIdentifier

* Add temp var

* Remove unsafe casts

* Rename escaped string type as per @sandersn's suggestion, fix string enum usages

* Reorganize double underscore tests

* Remove jfreeman from TODO

* Remove unneeded parenthesis
2017-07-06 14:45:50 -07:00
Andrew Casey 569ecabb0a Address PR feedback
Make Program.getMissingFilePaths required

Assume getMissingFilePaths always returns a defined value

Make getMissingFilePaths internal

Replace nullable-bool with enum

Update type to reflect possibility of undefined

Use deepEqual to simplify tests

Make condition const

Don't bother cleaning up map before freeing it

Switch from foreach to for-of to simplify debugging

Use a Map, rather than a FileMap, to track open FileWatchers

Fix compilation errors

Introduce and consume arrayToSet

Fix lint warnings about misplaced braces

Delete incorrect comment

Delete from map during iteration

Eliminate unnecessary type annotations
2017-06-29 11:29:19 -07:00
Andrew Casey 4652fc491f Confirm method is defined before calling 2017-06-29 10:39:32 -07:00
Andrew Casey 4863ada22c Track missing files
1. Expose missing files from the `Program`.
2. In `tsc --watch` and `tsserver`, add file watchers to missing files.
3. When missing files are created, schedule compilation (tsc) or refresh
the containing projects (tsserver).
2017-06-29 10:39:31 -07:00
Andy 9013665e22 Replace FileMap with Map where there is no keyMapper (#16724)
* Replace FileMap with Map where there is no keyMapper

* Remove `toKey` and use `keyMapper` directly
2017-06-28 13:15:34 -07:00
Andy 9260a399a3 Remove duplicate switch cases (#16721) 2017-06-28 12:53:43 -07:00
Yui 47c1563649 Merge pull request #16544 from Microsoft/master-fixIncrementalParsingWithDynamicImport
[Master] wip - fix incremental parsing with dynamic import
2017-06-19 16:44:47 -07:00
Alex Eagle 0123bd0e20 Add missing newline in --pretty diagnostics formatter
It was compensated in tsc.ts, but then other compilers are missing a newline.
2017-06-17 09:20:55 -07:00
Sheetal Nandi 09f0b3471a Merge branch 'master' into ownJsonParsing 2017-06-15 09:59:37 -07:00
Yui T a92b549336 Set the structureReused to be safemoudles when dynamic import change 2017-06-14 21:50:12 -07:00
Yui T 1636fbc966 Wip-fix incremental parsing 2017-06-14 17:13:35 -07:00
Andy 09321b3834 Convert Extension to a string enum (#16425) 2017-06-09 19:32:44 -07:00
Daniel Rosenwasser 86e54ac787 Correct pluralization of 'Contain' to 'Contains', made the nodeflag internal. 2017-06-08 16:00:38 -07:00
Sheetal Nandi 48189c883f Merge branch 'master' into ownJsonParsing 2017-06-06 11:03:21 -07:00
Yui T b9017795a0 Revert "Revert "[Master] wip-dynamic import" (#16264)"
This reverts commit ccc60c8b3b.
2017-06-05 17:16:29 -07:00
Sheetal Nandi c4ad151a46 Merge branch 'master' into ownJsonParsing 2017-06-05 17:01:09 -07:00
Andy 8ace7b826f importFixes: Support missing "React" at a JSXOpeningElement (#16066)
* importFixes: Support missing "React" at a JSXOpeningElement

* Fix nextLineRule linting

* Rename to resolveJsxNamespaceAtLocation

* Expose getJsxNamespace and resolveNameAtLocation separately
2017-06-05 14:23:39 -07:00
Andy 70564110c0 Make use of array helper functions (#16226)
* Make use of array helper functions

* Remove unnecessary 'ts.'
2017-06-05 14:11:43 -07:00
Mohamed Hegazy ccc60c8b3b Revert "[Master] wip-dynamic import" (#16264) 2017-06-05 10:49:20 -07:00
Sheetal Nandi d680720f6d Merge branch 'master' into ownJsonParsing 2017-06-05 10:28:23 -07:00
Yui 9d16d34c6a Merge pull request #14774 from Microsoft/master-dynamicImport
[Master] wip-dynamic import
2017-06-05 06:59:14 -07:00
Klaus Meinhardt 456a6bf658 program.getSourceFile[ByPath] can return undefined 2017-06-03 00:11:49 +02:00
Yui T 2f476bf22f Merge branch 'master' into master-dynamicImport 2017-06-02 09:10:20 -07:00
Yui T e6d7327c3f Address PR: error message, fix capitalization, only allow functionLikeDeclaration and ImportCall for create Promise, use fall through comment 2017-06-01 23:21:59 -07:00
Andrew Casey cd84d2a85a Use emptyArray, rather than [] 2017-06-01 19:05:07 -07:00
Andrew Casey 9d0bbc4e44 Apply --checkJs to bind diagnostics as well as check diagnostics 2017-06-01 18:10:52 -07:00
Sheetal Nandi 8f4f6c565e Merge branch 'master' into ownJsonParsing 2017-06-01 10:43:41 -07:00
Nathan Shively-Sanders 2dd6627022 Report jsdoc syntax errors when checkJs is on 2017-05-30 13:32:46 -07:00
Sheetal Nandi f1ea38d127 Merge branch 'master' into ownJsonParsing 2017-05-24 12:46:29 -07:00
Kanchalai Tanglertsampan faab927c8d Merge branch 'master' into master-dynamicImport
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/emitter.ts
#	src/compiler/parser.ts
#	src/compiler/transformers/module/module.ts
#	src/compiler/transformers/module/system.ts
2017-05-24 11:26:06 -07:00
Donald Pipowitch e4d6752a93 add createProgram docs (#15697)
* add `createProgram` docs

* updated `createProgram` docs
2017-05-23 10:40:46 -07:00
Andy 38ece3b703 Merge pull request #15737 from Microsoft/findAllRefs_module
Support find-all-references for a module specifier
2017-05-19 08:11:56 -07:00
Andy Hanson 0ff187c8ac Remove 'isDeclarationFile()' function, use '.isDeclarationFile' 2017-05-17 08:12:23 -07:00
Sheetal Nandi ec2f9670d9 Merge branch 'master' into ownJsonParsing 2017-05-15 11:36:45 -07:00
Alex Eagle 4240f6f5d9 Extract diagnostics formatter used by --pretty
This allows compilers other than tsc.js to display nice in-context diagnostics
2017-05-12 16:19:46 -07:00
Sheetal Nandi d7e9609ae5 Merge branch 'master' into ownJsonParsing 2017-05-11 09:10:35 -07:00
Andy Hanson 71fb02c099 Support find-all-references for a module specifier 2017-05-10 11:02:17 -07:00
Kanchalai Tanglertsampan 1b7d3bfa07 Merge branch 'master' into master-dynamicImport 2017-05-04 10:14:32 -07:00
Arthur Ozga 2150a7796b Merge pull request #15261 from aozgaa/moduleReuse
Reuse Module Resolutions from Unchanged Files
2017-05-01 17:49:44 -07:00
Arthur Ozga 60825143a4 respond to comments 2017-05-01 17:49:19 -07:00
Arthur Ozga 2118de09e7 Simplify returns 2017-05-01 15:16:42 -07:00
Arthur Ozga ef1cd50dfc clarifying comments 2017-05-01 11:47:12 -07:00
Arthur Ozga c63d6d145a Avoid double-resolving modified files 2017-04-28 16:27:41 -07:00
Arthur Ozga 86d7031932 inline createOldProgramState 2017-04-28 10:40:31 -07:00
Arthur Ozga 6547c1816f check ambient modules before reusing old state 2017-04-27 20:27:48 -07:00
Yui T feb41f7d7c Merge branch 'master' into master-dynamicImport
# Conflicts:
#	src/compiler/diagnosticMessages.json
#	src/compiler/program.ts
2017-04-26 15:35:30 -07:00
Yui T e50667e49e Address minor PR comment 2017-04-26 15:02:54 -07:00
Yui T 2f61d472ed Address minor PR comment 2017-04-26 12:56:15 -07:00
Arthur Ozga ac20fc2d26 consolidate program-structure reuse flags 2017-04-21 16:54:42 -07:00
Arthur Ozga 0ea1b82a85 test module reuse 2017-04-20 18:55:15 -07:00
Arthur Ozga 7966c08cc4 make enum bitflag and add trace message 2017-04-20 11:02:35 -07:00
Arthur Ozga 044152e50f Merge branch 'moduleReuse' of github.com:aozgaa/TypeScript into moduleReuse 2017-04-19 11:13:52 -07:00
Arthur Ozga c3582d2443 cleanup 2017-04-18 16:23:01 -07:00
Mohamed Hegazy 8c33a792b3 Do not query for bind errors if skipLibCheck or skipDefaultLibCheck is set 2017-04-18 16:19:58 -07:00
Arthur Ozga 77f9099423 Remove WIP comment 2017-04-18 16:15:39 -07:00
Arthur Ozga d5f246fd99 Reuse module resolutions in unmodified files 2017-04-18 15:48:01 -07:00
Mohamed Hegazy e6ecfa46f0 Merge pull request #15229 from Microsoft/Fix15220
Fix #15220: Check for file on diagnostics before getting line map
2017-04-18 14:39:54 -07:00
Andy Hanson 455492d887 Merge branch 'master' into fallthrough 2017-04-18 09:48:21 -07:00
Arthur Ozga cbbf6f8847 Merge branch 'master' into tripleEquals 2017-04-17 15:57:51 -07:00
Sheetal Nandi 6f568b3f26 Merge branch 'master' into ownJsonParsing 2017-04-17 13:40:49 -07:00
Mohamed Hegazy 26d5af384c Check for the file before getting line map 2017-04-17 13:15:06 -07:00
Andy Hanson a82ac45e36 Merge branch 'master' into fallthrough 2017-04-12 10:58:03 -07:00
Andy Hanson ed5eca2b7b boolean-trivia lint rule: Enforce space between comment and argument 2017-04-11 09:44:58 -07:00
Andy Hanson 7320891933 boolean-trivia lint rule: Lint for null/undefined too 2017-04-07 13:13:39 -07:00
Arthur Ozga 7e03429a8e enforce triple-equals 2017-04-04 15:51:13 -07:00
Kanchalai Tanglertsampan 55430c46e6 Add boolean flag to not walk the tree if there is no dynamic import 2017-04-04 15:43:45 -07:00
Kanchalai Tanglertsampan 11f6eaec5b Merge branch 'master' into master-dynamicImport
# Conflicts:
#	src/compiler/commandLineParser.ts
2017-03-29 10:51:05 -07:00
Andy Hanson 1cf765d664 Lint for fallthrough in switch 2017-03-27 15:09:00 -07:00
Mohamed Hegazy db6c96967c Change ingore diagonstic comment to // @ts-ignore 2017-03-22 16:23:21 -07:00
Mohamed Hegazy e408cad618 Merge branch 'master' into checkJSFiles 2017-03-22 15:45:27 -07:00
Kanchalai Tanglertsampan c798489eb1 Move error report of incorrect grammar in dynamic import to checker 2017-03-22 15:04:17 -07:00
Kanchalai Tanglertsampan 91d9ecf3e2 Simply parse dynamic import as call-expression.... 2017-03-22 11:10:47 -07:00
Kanchalai Tanglertsampan e0192168f7 Use emitFlags to indicate that the subtree contains dynamic import 2017-03-20 14:01:50 -07:00
Andy Hanson 2305c10a65 Fix lint errors 2017-03-17 13:54:18 -07:00
Kanchalai Tanglertsampan a77f0d2b1a Do not collect imports in parser as it makes it very hard for incremental parsing 2017-03-16 17:47:10 -07:00
Mohamed Hegazy 3b57b5d4d5 Refactor checking for checkJs value in a common helper 2017-03-15 15:17:33 -07:00
DLehenbauer 3f980bead0 Remove vestiges of WScript support (Issue #14414) 2017-03-10 07:10:58 -08:00
Yui T 827abb3576 Parse import call and use collect its specifier 2017-03-09 22:30:06 -08:00
Mohamed Hegazy fe7719f0a9 Disable check diagnostics per line 2017-03-08 23:18:39 -08:00
Mohamed Hegazy 3d03f8d8a5 Merge branch 'fixBuildBreak' into checkJSFiles 2017-03-08 23:17:28 -08:00
Mohamed Hegazy e9f82145b7 Code review comments 2017-03-08 21:50:23 -08:00
Mohamed Hegazy fb218b7897 Error if --checkJs is used without --allowJs 2017-03-07 14:21:13 -08:00
Mohamed Hegazy 9305d4d99e Change flag name to checkJs 2017-03-07 13:48:37 -08:00
Vladimir Matveev fab4ef0bde cache semantic and declaration diagnostics in program (#14516) 2017-03-07 13:26:41 -08:00
Mohamed Hegazy b015c1d9b0 Allow @check directives to switch on/off checking in a file 2017-03-06 21:39:32 -08:00
Mohamed Hegazy 9f0c5ce141 Add support for //@check directives 2017-03-06 13:50:27 -08:00
Mohamed Hegazy 0b1fff7e66 Add --checkJsFiles 2017-03-06 13:47:27 -08:00
Anders Hejlsberg cda741d14a Introduce --strict compiler option 2017-03-03 10:25:10 -08:00
Ron Buckton 2f624f5df3 Expose transformations as public API 2017-02-07 14:36:15 -08:00
Ron Buckton ff4c72de00 Make most current Node factory functions public 2017-02-01 16:36:10 -08:00
Sheetal Nandi 911511e011 Report option diagnostic in tsconfig.json if possible 2017-01-23 13:16:02 -08:00
Andy Hanson a32914f687 Combine forEachExpectedEmitFile and forEachEmittedFile 2017-01-23 11:14:29 -08:00
Andy Hanson 8886cefe58 Clean up code for getting emitted files 2017-01-20 10:46:15 -08:00
Andy Hanson 932eaa3f90 Rename and consolidate map iteration helpers 2016-12-28 09:16:38 -08:00
Andy Hanson 9e33585a80 Merge branch 'master' into map5 2016-12-27 12:56:05 -08:00
Mohamed Hegazy e4b81d0331 Merge pull request #13006 from SaschaNaz/lintfix
Fix latest tslint errors
2016-12-26 11:24:25 -08:00
Vladimir Matveev 0649c2272c cache per-folder module resolutions during construction of the program (#13030) 2016-12-19 13:48:45 -08:00
Kagami Sascha Rosylight 2a941a7222 inline length 2016-12-20 03:12:35 +09:00
Kagami Sascha Rosylight 27a60e4580 fix linting errors 2016-12-18 15:44:54 +09:00
Andy Hanson b53b5cf4ab Remove the "set" function and use map.set with multiple lines of code if necessary. 2016-12-12 08:42:12 -08:00
Andy Hanson 6b1cc8972d Use native maps when they're available 2016-12-08 06:40:31 -08:00
Vladimir Matveev 9945529875 use location of config file as initial location for automatic type reference inclusion if possible (#12341) 2016-11-18 13:39:11 -08:00
Vladimir Matveev 4c2474463c ports #12237, #12258 and #12259 into master (#12274)
* treat failures to resolve module name as missing packages (#12237)

* added extra check to prevent multiple installation of the same typing, added version field to telemetry event (#12258)

* added extra check to prevent multiple installation of the same typing, added version field to telemetry event

* use ts.version

* switch to execSync to ensure that no install orders are interleaved (#12259)

* Make sure version is public

* Update file with version string for nightly release
2016-11-15 12:53:46 -08:00
Andy Hanson 6c7e1b6913 Merge branch 'master' into symlink3 2016-11-11 13:35:47 -08:00
Andy Hanson b65729e5b2 Merge branch 'master' into common_source_directory 2016-11-11 13:10:29 -08:00
Mohamed Hegazy ea309fe504 Update version (#12162) 2016-11-10 16:30:01 -08:00
Mohamed Hegazy d537b79c61 Merge release-2.1 into master (#12157)
* Update LKG

* Update version

* Update LKG

* Skip overloads with too-short function parameters

If the parameter of an overload is a function and the argument is also a
function, skip the overload if the parameter has fewer arguments than
the argument does. That overload cannot possibly apply, and should not
participate in, for example, contextual typing.

Example:

```ts
interface I {
  (a: number): void;
  (b: string, c): void;
}
declare function f(i: I): void;
f((x, y) => {});
```

This code now skips the first overload instead of considering.

This was a longstanding bug but was only uncovered now that more
functions expressions are context sensitive.

* Test skip overloads w/too-short function params

1. Update changed baseline.
2. Add a new test with baseline.

* Minor style improvements

* Ignore optionality when skipping overloads

* Do not use contextual signatures with too few parameters

* isAritySmaller runs later: getNonGenericSignature

* rewrite void-returning statements in constructors that capture result of super call (#11868)

* rewrite void-returning statements in constructors that capture result of super call

* linter

* Update LKG

* Fix emit inferred type which is a generic type-alias both fully and partially fill type parameters

* Add tests and baselines

* Skip trying to use alias if there is target type

* Update baselines

* Add diagnostics to remind adding tsconfig file for certain external project (#11932)

* Add diagnostics for certain external project

* Show tsconfig suggestion

* fix lint error

* Address pr

* fix comment

* Update error message

* Flag for not overwrite js files by default without generating errors (#11980)

* WIP

* Properly naming things

* refactor

* apply the option to all files and check out options

* Fix typo

* Update LKG

* lockLinter

* use local registry to check if typings package exist (#12014) (#12032)

use local registry to check if typings package exist

* Add test for https://github.com/Microsoft/TypeScript/pull/11980 (#12027)

* add test for the fix for overwrite emitting error

* cr feedback

* enable sending telemetry events to tsserver client (#12034) (#12051)

enable sending telemetry events

* Update LKG

* Reuse subtree transform flags for incrementally parsed nodes (#12088)

* Update LKG

* Update version

* Update LKG

* Do not emit "use strict" when targeting es6 or higher or module kind is es2015 and the file is external module

* Add tests and baselines

* [Release 2.1] fix11754 global augmentation (#12133)

* Exclude global augmentation from module resolution logic

* Address PR: check using string literal instead of NodeFlags.globalAugmentation

* Remove comment
2016-11-10 14:28:34 -08:00
Zhengbo Li 4dc58dde38 Exclude js files in non-configured projects compile-on-save emitting (#12118)
* Exclude js files in non-configured projects CoS emitting

* remove unnecessary method
2016-11-10 14:12:24 -08:00
Vladimir Matveev 3ecb60146b synthesize complete import declaration for tslib (#12151) 2016-11-10 11:57:37 -08:00
Sheetal Nandi c87bce1119 Merge pull request #11978 from Microsoft/errorReportingInJsFile
Report all the js file errors and skip only the nodes that are not allowed in JS file
2016-11-10 10:37:16 -08:00
Sheetal Nandi 2eba10a25b Updated condition for more readability 2016-11-10 09:40:50 -08:00
Sheetal Nandi dd7f00f20b Parse the jsxFactory again in the checker instead of using cached value in the program 2016-11-10 08:54:13 -08:00
Sheetal Nandi 3d6950d023 When emitting use jsx factory entity expression if provided 2016-11-09 16:40:11 -08:00
Sheetal Nandi 06affa6672 Resolve first identifier of the jsxFactory as part of type check 2016-11-09 15:35:54 -08:00
Sheetal Nandi f7bac98948 Verify that jsxFactory is either identifier or qualified name 2016-11-09 14:32:42 -08:00
Sheetal Nandi 4b8a55793a Add support for taking in jsxFactory option and report errors for invalid combinations 2016-11-09 12:23:59 -08:00
Sheetal Nandi 78bb276216 Merge branch 'master' into errorReportingInJsFile 2016-11-09 11:38:11 -08:00
Sheetal Nandi 6456325973 Handle abstract and const modifiers 2016-11-09 10:39:46 -08:00