Commit Graph

14337 Commits

Author SHA1 Message Date
Sheetal Nandi
afee423a84 Feedback on formatting 2019-10-17 11:54:26 -07:00
Sheetal Nandi
bb4872b063 Do not write build info if there are no files to emit 2019-10-15 08:37:23 -07:00
Sheetal Nandi
4b10145340 Make sure commandline options are absolute paths so they dont conflict with tsbuildinfo paths
Fixes #33667
2019-10-14 14:44:47 -07:00
Andrew Branch
e146f0d13d Allow inferFromUsage to do auto-imports (#33915)
* Add test

* Auto-import instead of using ImportTypeNodes

* Write more tests and fix namespace case

* Remove unused enum memmber

* Update API baselines

* Lint

* Style nits and util consolidation
2019-10-14 10:33:00 -07:00
Sheetal Nandi
57d7edb7bd Merge pull request #33883 from microsoft/revert-32887-incrementalNoEmit
Revert "Disallow incremental with noEmit"
2019-10-10 13:08:35 -07:00
Daniel Rosenwasser
6162001254 fix #33427 (#33486)
fix #33427
2019-10-10 10:13:36 -07:00
Wesley Wigham
114329ade8 Handle when import alias has to parent (therefore is synthetic module symbol) (#33813) 2019-10-10 04:29:33 -07:00
Anders Hejlsberg
6104f746ad Merge pull request #33831 from microsoft/falseAssertions
Code following truthiness assertion with false argument is unreachable
2019-10-09 13:23:05 -07:00
Klaus Meinhardt
e48cd3a101 Fix noImplicitAny check on ambient private getters (#33896) 2019-10-09 10:05:26 -07:00
Sheetal Nandi
8032984de2 Revert "Disallow incremental with noEmit" 2019-10-08 13:41:40 -07:00
Wesley Wigham
f1c0300c02 Include project reference in release config so LKG build works (#33864) 2019-10-07 17:31:42 -07:00
Ron Buckton
01b3d41124 Add external mapShim/debug modules (#33712)
* Add external mapShim/debug modules

* rename test file
2019-10-07 13:31:07 -07:00
Daniel Rosenwasser
09a87b9e91 'amd' missing from error message for error TS1323 (#33803)
'amd' missing from error message for error TS1323
2019-10-07 10:12:31 -04:00
Anders Hejlsberg
92212ae19e More succinct 2019-10-06 10:06:40 -07:00
Anders Hejlsberg
720964f729 Fix bounds check 2019-10-05 19:14:48 -07:00
Anders Hejlsberg
d415b57d01 Merge branch 'master' into falseAssertions 2019-10-05 18:04:30 -07:00
Anders Hejlsberg
afe6f4c95c Merge pull request #33821 from microsoft/fix33806
Reflect control flow effects of optional chains in equality checks
2019-10-05 17:48:53 -07:00
Anders Hejlsberg
f7b22a0216 Support typeof and instanceof 2019-10-05 13:08:24 -07:00
Anders Hejlsberg
719b779b6b Reflect CFA effects of optional chains in equality checks 2019-10-04 15:27:32 -07:00
Ron Buckton
a47ac63738 Fix for incorrect 'this' type for optional call (#33799) 2019-10-04 13:39:42 -07:00
Anders Hejlsberg
feed4b9b53 Code following truthiness assertion with false argument is unreachable 2019-10-04 12:30:02 -07:00
Andrew Branch
e2b4c12596 Detect unbindable exports before setting CommonJS module indicator (#33784)
* Detect unbindable exports before setting CommonJS module indicator

* Fix comment

* Fix unrelated lint?
2019-10-04 11:52:38 -05:00
Alexander T
d9d3e310a0 'amd' missing from error message for error TS1323 2019-10-04 10:21:14 +03:00
Ron Buckton
c774762723 Fix crash in transformations (#33768) 2019-10-02 16:13:32 -07:00
Daniel Rosenwasser
a3a55cab2c Improve error message when reserved word is used as identifier (#33702)
Improve error message when reserved word is used as identifier
2019-10-01 16:20:28 -04:00
Wesley Wigham
410ff90c54 Fix the third crash in the chrome user suite test by remembering to pass excludeThisKeyword (#33711) 2019-10-01 13:14:23 -07:00
Daniel Rosenwasser
20f42f45ff Merge pull request #33709 from microsoft/moveMessageNumbers
Move error codes to appropriate section
2019-10-01 15:37:23 -04:00
Ron Buckton
526ed5284e Ensure prepend texts are set when skipping internals (#33694) 2019-10-01 12:33:17 -07:00
Daniel Rosenwasser
933065b69c Change error codes. 2019-10-01 12:18:01 -07:00
Mukesh Prasad
03a3589225 Better error message for mistaken import (#40)
Issue number of the reported bug or feature request: microsoft#13601
2019-10-01 17:27:38 +01:00
Sheetal Nandi
2d96a163d1 Merge pull request #33681 from microsoft/autoTypeReference
Fix issue when types installed after watch/editor is opened for auto type reference that is for global types not being detected
2019-10-01 08:28:08 -07:00
Sergey Tychinin
ab879939df Improve error message when reserved word is used as identifier
Signed-off-by: Sergey Tychinin <stychinin@bloomberg.net>
2019-10-01 10:48:17 -04:00
Andrew Branch
7be7cba050 Fixes binding well known symbol assignment via element access (#33687)
* Fix binding well-known symbols by element access

* Add navigationBar test

* Revert settings.json change

* Accept baselines

* Actually make it bind

* Accept API baselines

* Dont use internal name in API
2019-09-30 16:14:07 -07:00
Wenlu Wang
7c50bccec2 nullish coalescing commit (#32883)
* migrate nullish coalescing commit

* add more test case

* add branch type check test

* add more tests

* fix nullish precedence

* update public api

* add rescan question question token to fix regression

* update public api baseline

* Added tests that emit for nullish coalescing operator conforming with grammar restrictions when assertions are used.

* Fixed emit to hoist temporary variables (they previously went undeclared).
Added tests to ensure calls and property accesses are only called once.

* use not equal to null

* rename factory

* add grammar check

* fix more cases

* Fix handling of nullish coalescing oprator in expando objects.

* Fixed classifier to support ?? operator.

* update baseline

* accept baseline

* fix review

* update emitter and more testcase

* update control flow

* make linter happy

* update libs

* avoid unnecessary assert

* fix typooo

* Fixes for control-flow analysis
2019-09-30 15:33:50 -07:00
Wesley Wigham
9a7fdade07 Fix crash in contextual typing of defaulted element access declarations (#33686) 2019-09-30 14:42:55 -07:00
Wesley Wigham
98cf317005 Add error message for set accessor vsibility issues (#33683) 2019-09-30 13:12:40 -07:00
Andrew Branch
f89de95955 Allow special element access assignments to create declarations (#33537)
* Start enabling element access special assignment

* Treat element access assignment as special assignment in JS

* Make declarations for bindable element access expressions

* Fix navigationBar crash

* Add multi-level test for JS

* Propagate element access expressions to more code paths

* Fix property access on `this`

* Add quick info test

* Uhhh I guess this is fine

* Fix module["exports"] and property access chained off element access

* Add test for this property assignment

* Add test for and fix prototype property assignment

* Fix teeeest???

* Update APIs

* Fix element access declarations on `this`

* Fix go-to-definition

* Add declaration emit to tests

* Reconcile with late-bound symbol element access assignment

* Fix baselines

* Add JS declaration back to tests

* Fix JS declaration emit of non-late-bound string literal property names

* Revert accidental auto-format

* Use `isAccessExpression`

* Add underscore escaping member to test

* Fix and test navBar changes
2019-09-30 15:08:44 -05:00
Ron Buckton
fcd9334f57 Add support for Optional Chaining (#33294)
* Add support for Optional Chaining

* Add grammar error for invalid tagged template, more tests

* Prototype

* PR feedback

* Add errors for invalid assignments and a trailing '?.'

* Add additional signature help test, fix lint warnings

* Fix to insert text for completions

* Add initial control-flow analysis for optional chains

* PR Feedback and more tests

* Update to control flow

* Remove mangled smart quotes in comments

* Fix lint, PR feedback

* Updates to control flow

* Switch to FlowCondition for CFA of optional chains

* Fix ?. insertion for completions on type variables

* Accept API baseline change

* Clean up types

* improve control-flow debug output

* Revert Debug.formatControlFlowGraph helper
2019-09-30 12:33:28 -07:00
Anders Hejlsberg
7ce793c5b8 Merge pull request #33678 from microsoft/fix33617
Property handle recursive type references in type inference
2019-09-30 11:15:27 -07:00
Wesley Wigham
7f3c03d441 Implement declaration emit for accessors in the js declaration emitter (#33649)
* Implement declaration emit for accessors in the js declaration emitter

* Use `or`
2019-09-30 11:09:35 -07:00
Anders Hejlsberg
ff5d38a94b Merge pull request #33622 from microsoft/fix33580
Error when assertion function calls aren't CFA'd
2019-09-30 10:57:26 -07:00
Sheetal Nandi
1a614a27d1 Fix issue when types installed after watch/editor is opened for auto type reference that is for global types not being detected
Fixes #32285
2019-09-30 09:58:33 -07:00
Anders Hejlsberg
ed497c4149 Properly handle recursive type references in type inference 2019-09-30 08:54:02 -07:00
Anders Hejlsberg
02395a9b27 Fix error message 2019-09-27 15:17:49 -07:00
Sheetal Nandi
20e2be1e1a Merge pull request #33642 from microsoft/undoListFiles
Undo showing redirected files in --listFiles
2019-09-27 15:10:24 -07:00
Anders Hejlsberg
4648d6aeb2 Revise error messages + related spans + no errors on never-returning functions 2019-09-27 15:05:13 -07:00
Max Heiber
c80d565bc5 Enable forceConsistentCasingInFileNames by default in newly generated configs (#39) (#33614)
*Issue number of the reported bug or feature request: #17542*

**Describe your changes**
Enabled `forceConsistentCasingInFileNames` in newly generated `tsconfig.json`s created by `tsc --init`.

**Testing performed**
The configuration option changed in the related tests.

**Additional context**
n/a


Signed-off-by: Prakash Lalwani <plalwani4@bloomberg.net>
2019-09-27 14:42:30 -07:00
Sheetal Nandi
f713668abe Undo showing redirected files in --listFiles 2019-09-27 14:26:38 -07:00
Wesley Wigham
293816875c Support some late-bound special property assignments (#33220)
* Support some late-bound special property assignments

* Integrate PR feedback

* PR feedback

* Enable declaration on core tests

* Specialize type of binary expression used for late binding, speculative fix to navigation bar, merge check and type for elem/property accesses

* Add test showing current nav bar behavior (specifically the lack thereof)
2019-09-27 13:54:50 -07:00
Andrew Branch
304fcee09b Updated: Only auto-import from package.json (#32517)
* Move package.json related utils to utilities

* Add failing test

* Make first test pass

* Don’t filter when there’s no package.json, fix scoped package imports

* Use type acquisition as a heuristic for whether a JS project is using node core

* Make same fix in getCompletionDetails

* Fix re-exporting

* Change JS node core module heuristic to same-file utilization

* Remove unused method

* Remove other unused method

* Remove unused triple-slash ref

* Update comment

* Refactor findAlias to forEachAlias to reduce iterations

* Really fix re-exporting

* Use getModuleSpecifier instead of custom hack

* Fix offering auto imports to paths within node modules

* Rename things and make comments better

* Add another reexport test

* Inline `symbolHasBeenSeen`

* Simplify forEachAlias to findAlias

* Add note that symbols is mutated

* Symbol order doesn’t matter here

* Style nits

* Add test with nested package.jsons

* Fix and add tests for export * re-exports

* Don’t fail when alias isn’t found

* Make some easy optimizations

* Clean up memoization when done

* Remove unnecessary semicolon

* Make getSymbolsFromOtherSourceFileExports pure

* Cache auto imports

* Revert "Cache auto imports"

This reverts commit 8ea4829587.

* Handle merged symbols through cache

* Be safer with symbol declarations, add logging

* Improve cache invalidation for imports and exports

* Check symbol presence first

* Only run cache invalidation logic if there’s something to clear

* Consolidate cache invalidation logic

* Fix reuseProgramStructure test

* Add more logging

* Only clear cache if symbols are different

* Refactor ambient module handling

* Start caching package.json stuff

* Support package.json searching in fourslash

* Move import suggestions cache to Project

* Start making more module specifier work available without having the importing file

* Going to backtrack some from here

* Get rid of dumb cache, fix node core modules stuff

* Start determining changes to a file have invalidated its own auto imports

* Move package.json related utils to utilities

* Add failing test

* Make first test pass

* Don’t filter when there’s no package.json, fix scoped package imports

* Use type acquisition as a heuristic for whether a JS project is using node core

* Make same fix in getCompletionDetails

* Fix re-exporting

* Change JS node core module heuristic to same-file utilization

* Remove unused method

* Remove other unused method

* Remove unused triple-slash ref

* Update comment

* Refactor findAlias to forEachAlias to reduce iterations

* Really fix re-exporting

* Use getModuleSpecifier instead of custom hack

* Fix offering auto imports to paths within node modules

* Rename things and make comments better

* Add another reexport test

* Inline `symbolHasBeenSeen`

* Simplify forEachAlias to findAlias

* Add note that symbols is mutated

* Symbol order doesn’t matter here

* Style nits

* Add test with nested package.jsons

* Fix and add tests for export * re-exports

* Don’t fail when alias isn’t found

* Make some easy optimizations

* Clean up memoization when done

* Remove unnecessary semicolon

* Make getSymbolsFromOtherSourceFileExports pure

* Cache auto imports

* Revert "Cache auto imports"

This reverts commit 8ea4829587.

* Handle merged symbols through cache

* Be safer with symbol declarations, add logging

* Improve cache invalidation for imports and exports

* Check symbol presence first

* Only run cache invalidation logic if there’s something to clear

* Consolidate cache invalidation logic

* Fix reuseProgramStructure test

* Add more logging

* Only clear cache if symbols are different

* Refactor ambient module handling

* Finish(?) sourceFileHasChangedOwnImportSuggestions

* Make package.json info model better

* Fix misplaced paren

* Use file structure cache for package.json detection when possible

* Revert unnecessary changes in moduleSpecifiers

* Revert more unnecessary changes

* Don’t watch package.jsons inside node_modules, fix tests

* Work around declaration emit bug

* Sync submodules?

* Delete unused type

* Add server cache tests

* Fix server fourslash editing

* Fix packageJsonInfo tests

* Add node core modules cache test and fix more fourslash

* Clean up symlink caching

* Improve logging

* Function name doesn’t make any sense anymore

* Move symlinks cache to host

* Fix markFileAsDirty from ScriptInfo

* Mark new Project members internal

* Use Path instead of fileName

* Rename AutoImportSuggestionsCache

* Improve WatchType description

* Remove entries() from packageJsonCache

* Fix path/fileName bug

* Also cache symlinks on Program for benefit of d.ts emit

* Let language service use Program’s symlink cache
2019-09-27 13:38:31 -07:00