9377 Commits

Author SHA1 Message Date
Ron Buckton
62264392d2 Support accessors in interfaces in the language service 2019-08-08 17:58:05 -07:00
Ron Buckton
4e8ffd8e4f Add basic test cases for accessors in interfaces and ambient classes 2019-08-07 16:26:08 -07:00
Wesley Wigham
f333684179
Fix unicode escapes in jsx identifiers and extended unicode characters in jsdoc (#32716)
* Fix unicode escapes in jsx identifiers and extended unicode characters in jsdoc

* Support unicode escapes in JSDoc

* Add tests for extended escapes
2019-08-06 15:14:32 -07:00
Nathan Shively-Sanders
480b73915f
Improve excess property checking for intersections (#32582)
* Improve excess property checking for intersections

Still a draft, the implementation needs improvement

* Use mutable isIntersection in checkTypeRelatedTo

This makes parameter lists a lot shorter. Seems like a slight
improvement, although I can revert if I change my mind.

* Fix semicolon lint

* Remove TODOOOO

* Revert "Use mutable isIntersection in checkTypeRelatedTo"

This reverts commit b8dccff2a25495867cff070b94601015e689b8ff.
2019-08-06 15:03:24 -07:00
Wesley Wigham
d00056f096
Support extended unicode escapes in identifiers, per es6 spec (#32725) 2019-08-06 14:43:41 -07:00
Nathan Shively-Sanders
269c3d3a56
Suggestions now use diagnosticCollection (#32740)
Previously they used multiMaps, unlike all the other diagnostics. This
prevents duplicate suggestions, like other kinds diagnostics.

Fixes #28710
2019-08-06 11:15:06 -07:00
Wesley Wigham
7adc175dfc
Adjust isIdentifierText to skip multiple characters when a code point is multiple chars long (#32720)
* Adjust isIdentifierText to skip multiple characters when a code point is multiple chars long

* Add a few examples with mixed unicode characters

* for posterity, add some unicode cursive script characters

* Test some more planes more explicitly
2019-08-05 23:37:26 -07:00
Ron Buckton
e3f4979736
Fix emit for object rest on a module export (#32699)
* Fix emit for object rest on a module export

* Add tests for exports of empty object/array binding patterns

* Add delay for exec to ensure diff tool has enough time to start
2019-08-05 16:53:21 -07:00
Wesley Wigham
3b54ffcf0e
Preserve const enums should keep import refs (#28498)
* Preserve const enums should keep import refs

for exported const enums exported via export default

Move some functionality around, small cleanup

Remove unneeded const enum check

* Only mark const enums as references with preserveConstEnums on in export assignments

* Limit change to declarations and preserveConstEnums mode
2019-08-05 16:47:29 -07:00
Andrew Branch
c1e0db7953
Escape apparent substitution in synthesized NoSubstitutionTemplateLiterals (#32580)
* Add failing test

* Escape apparent substitution in synthesized NoSubstitutionTemplateLiterals
2019-08-05 09:31:59 -07:00
Andrew Branch
e82d0af554
Fix readonly occurrences highlighting (#32583)
* Fix readonly occurrences highlighting

* Rename function

* Rename again

* Apply suggestions from code review

Remove unused function
2019-08-02 18:24:46 -07:00
Wesley Wigham
6b4f730535
Fix binding of jsdoc typedefs with no in-comment name attached to an expression statement (#32610)
* Fix binding of jsdoc typedefs with no in-comment name attached to an expression statement

* Check toplevel flag before bind

* Small renames
2019-08-02 16:14:19 -07:00
Andrew Branch
62f65a7884
Make auto-imports more likely to be valid for the file (including JS) & project settings (#32684)
* Add failing tests

* Use default import or namespace import for import fixes when compiler options allow

* Don’t do import * for export=, ever

* Only do import default for export equals if nothing else will work

* Never do import/require in a JavaScript file

* Update tests for changes in master

* Add const/require fix for JS and select based on usage heuristic

* Fix JS UMD import
2019-08-02 15:58:10 -07:00
Andrew Branch
725321f08c
Prioritize “property names” over punctuation in smart select (#32687)
* Prioritize “property names” over punctuation in smart select

* Update doc comment
2019-08-02 15:57:44 -07:00
Wesley Wigham
acdbd10626
Amend scanner to support astral characters in identifiers when parsing es6+ (#32096)
* Amend scanner to support astral characters in identifiers when parsing es6+

* Use charSize helper rather than one-off maybe advance helper

* Update script to emit informative comment, run in unicode 12.1 environment

* Add suggested change
2019-08-02 13:15:51 -07:00
Orta
4a26271b63
Merge pull request #32663 from orta/fix_31195
Ensure that the comma is removed when all named imports are removed via moveToFile
2019-08-02 10:29:51 -04:00
Orta
78e03848a4
Merge pull request #31946 from orta/30246
Don't let the additional property setting on an object show up as a definition to tsserver
2019-08-02 10:29:34 -04:00
Orta Therox
c337f046fb Ensure that the comma is removed when all named imports are removed via moveToFile - fixes #31195 2019-08-01 15:01:52 -04:00
Andrew Branch
33f362abaf
Don’t issue used-before-initialization errors in declaration files (#32579) 2019-08-01 11:24:04 -07:00
Andrew Branch
73bef22f0b
A merged interface with an inherited member should satisfy an abstract base class member (#32539)
* A merged interface with an inherited member should satisfy an abstract base class member

* Tighten up comments and names
2019-08-01 09:34:11 -07:00
Andrew Branch
b377e99958
Prevent infinite recursion resolving nested conditional types with import types in them (#32097)
* Prevent infinite recursion resolving conditional types

* Use push/popTypeResolution and issue error

* Add failing test

* Fix the actual problem

* Revert unnecessary changes
2019-08-01 08:37:43 -07:00
Orta Therox
3145656f6a Merge branch 'master' of https://github.com/microsoft/typescript into 30246 2019-07-31 17:08:45 -04:00
Sheetal Nandi
1d18b4941e Store already known not parenthesized arrow expression positions for faster exit in case of deep parsing
Fixes #31987
2019-07-31 11:12:01 -07:00
Andrew Casey
dbe9e3d237
Merge pull request #32565 from amcasey/TripleSlashClassification
Support classification of triple-slash references
2019-07-29 12:27:55 -07:00
Anders Hejlsberg
4cc6618fc2
Merge pull request #32558 from microsoft/fix32247
Infer between closely matching types in unions and intersections
2019-07-29 11:34:14 -07:00
Anders Hejlsberg
a717d3ab44 Add regression test 2019-07-28 09:05:57 -07:00
Andrew Branch
3d09010dc8
Intersect 'this' types in union signatures (#32538)
* Intersect this types in union signatures

* Actually update baselines
2019-07-26 14:56:03 -07:00
Wesley Wigham
2a4930f4ec
Bind a jsdoc enum as SymbolFlags.TypeAlias and not SymbolFlags.Enum (#32520)
* Bind a jsdoc enum as SymbolFlags.TypeAlias and not SymbolFlags.Enum

* Actually include an @enum tag as a declaration

* Add enum tag refs into a couple more syntax kind lists

* accept symbol baseline update
2019-07-26 13:57:22 -07:00
Anders Hejlsberg
ec38799e2a Add more tests 2019-07-26 13:17:00 -07:00
Andrew Casey
9647506d8c Support classification of triple-slash references
Note: not restricted to the element and attribute names that actually
bind
2019-07-25 15:59:17 -07:00
Anders Hejlsberg
b9d27c0f2c Add regression tests 2019-07-25 11:52:08 -07:00
Nathan Shively-Sanders
772bee5e84
Property assignment uses parent type annotation (#32553)
* Property assignment uses parent type annotation

First draft, will write full explanation later.

Also makes sure that jsdoc is ignored in TS. It was not before.

* Update baselines
2019-07-25 10:23:03 -07:00
Andrew Branch
aa12ec440c
Fix smart select on last blank line of file (#32544)
* Fix SmartSelection on last blank line of file

* Add baseline
2019-07-25 09:47:57 -07:00
Sheetal Nandi
e8966ce033
Merge pull request #32531 from microsoft/importFixCompletion
When the exported symbol is merged symbol from declaration use that name
2019-07-24 10:46:50 -07:00
Anders Hejlsberg
34dd4b8da5
Merge pull request #32386 from microsoft/fix32349
Instantiate contextual types for return expressions
2019-07-23 17:33:25 -07:00
Wesley Wigham
40fd4efdf6
Strip more kinds of timestamps and versions from dockerfile output (#32519)
* Strip more kinds of timestamps and versions from dockerfile output, rewrite office-ui-fabric dockerfile to use new lerna build system

* Add another filter for just output

* Update user baselines (#23)

* Update user baselines (#24)

* Strip only maybe-present timestamps

* More lenient timestamp filter

* Update user baselines (#25)

* Simplify and enhance vscode dockerfile to use nightly ts in ts extension, too

* Update user baselines (#26)

* Update user baselines (#27)
2019-07-23 17:14:50 -07:00
Sheetal Nandi
b8e779d89a When the exported symbol is merged symbol from declaration use that name to verify quality
Fixes #27880
2019-07-23 16:31:59 -07:00
Anders Hejlsberg
742cabaac4 Merge branch 'master' into fix32349 2019-07-23 10:31:46 -07:00
Anders Hejlsberg
6b29060111 Merge branch 'master' into fix32434 2019-07-20 12:09:03 -07:00
Anders Hejlsberg
d96d16e10b Add additional test 2019-07-20 10:01:59 -07:00
Nathan Shively-Sanders
e543d8bc5a
Fix type keyword completions (#32474)
* Fix type keyword completions

1. In functions, type keywords were omitted.
2. In All context, no keywords were omitted.

(1) fixes #28737
(2) removes 17 keywords that should not be suggested, even at the
toplevel of a typescript file:

* private
* protected
* public
* static
* abstract
* as
* constructor
* get
* infer
* is
* namespace
* require
* set
* type
* from
* global
* of

I don't know whether we have a bug tracking this or not.

* Change keyword filter in filterGlobalCompletion

Instead of changing FunctionLikeBodyKeywords

* Add more tests cases

* Make type-only completions after < more common

Because isPossiblyTypeArgumentPosition doesn't give false positives now
that it uses type information.
2019-07-19 15:22:04 -07:00
Anders Hejlsberg
ae1add7210 Update tests 2019-07-17 15:02:20 -07:00
Anders Hejlsberg
7d4259ba9f Update tests 2019-07-17 14:57:26 -07:00
Andrew Branch
387c917765
Revert "Proposal: If there’s a package.json, only auto-import things in it, more or less (#31893)" (#32448)
This reverts commit 60a1b1dc1a93ca792cf12bb0432cf7bc134c3ad1.
2019-07-17 14:02:18 -07:00
Ron Buckton
049618f7da
Get contextual type of yield from contextual signature of containing function (#32433)
* Get contextual type of yield from contextual signature of containing function

* Add missing baseline
2019-07-16 17:16:21 -07:00
Sheetal Nandi
607c9c5e26 Fix missing tokenToString for the backtick
Fixes #32073
2019-07-16 13:30:38 -07:00
Sheetal Nandi
664671cf49
Merge pull request #32377 from minajevs/fix29666
Fix completion lists for 'readonly' and 'const' keywords
2019-07-16 10:17:52 -07:00
Nathan Shively-Sanders
1de76cd605
Control flow for element access expressions (#31478)
* Control flow for element access expressions

Draft version, just want to see how performance is

* Add baselines

* Fix cast lint

* Cleanup to share code path

* Fix errant diffs
2019-07-16 10:10:58 -07:00
Dmitrijs Minajevs
7608dc2306 Merge branch 'master' into fix29666 2019-07-16 10:52:26 +03:00
Dmitrijs Minajevs
9a37ef8667 typeAssertionKeywords tests 2019-07-16 10:04:14 +03:00