Commit graph

941 commits

Author SHA1 Message Date
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