Commit Graph

11027 Commits

Author SHA1 Message Date
Oleksandr T
39c653cd83 fix: omit inlay hints for setters (#45228) 2021-08-02 16:27:22 -07:00
Daniel Rosenwasser
975aabe788 Ensure all SortText entries have the same length (#45292)
* Ensure all `SortText` entries have the same length.

* Update Baselines and/or Applied Lint Fixes

* Update the exact same enum to the exact same values in fourslash. 🙄

* Make `SortTextId` a const enum, switch to use an explicit offset in `SortTextId`.

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-08-02 16:27:01 -07:00
Andrew Branch
d2f324b389 Add test for intersection narrowing bug (#45296) 2021-08-02 16:12:09 -07:00
Oleksandr T
c23abc8957 fix(45192): show implement interface QF for re-exported types (#45245) 2021-08-02 15:19:19 -07:00
Andrew Branch
bfd5b2f7f0 Fix decorator metadata references to type-only-imported namespaces (#44915)
* Add test

* Fix metadata references to type-only-imported namespaces

* Use `!!` instead of `|| false`
2021-08-02 14:18:15 -07:00
Wesley Wigham
7669bfba15 Actually instantiate the type of the annotation used for contextual types (#45285) 2021-08-02 12:44:56 -07:00
Oleksandr T
fcf7bafd57 fix(44812): add outlining spans for comments inside blocks (#44847) 2021-07-30 15:56:32 -07:00
Armando Aguirre
76d754329e Fix bigInt completions (#45059)
* Fix bigInt completions

* Added regresion test
2021-07-30 14:40:50 -07:00
Wenlu Wang
8cdcec4454 Avoid provide hints for binding patterns (#44961)
* Avoid provide hints for binding patterns

* Rename as 56
2021-07-30 09:43:20 -07:00
Gabriela Araujo Britto
db0f7938dd Allow narrowing for any left-hand in operand (#45152)
* allow narrowing for any left-hand in operand
2021-07-29 14:06:45 -07:00
Gabriela Araujo Britto
366e9de264 Fix compiler crash on property symbols without declarations (#45190)
* don't track computed name if symbol has no declaration

* add compiler test

* add non serializable property declaration emit error

* don't track computed name if symbol has no declaration

* fix small stuff

* rebase: add non serializable property declaration emit error

* use symbolToString instead of symbolName
2021-07-29 12:42:54 -07:00
Andrew Branch
62773051e7 Fix import statement completions for export= in JS files (#45128) 2021-07-29 10:28:47 -07:00
Oleksandr T
c79ec7bfbb fix(45225): do not show add missing member QF for libraries files (#45231) 2021-07-29 10:22:27 -07:00
Eli Barzilay
7e8bba6908 Fix template string refactoring and nodeFactory bug
Instead of letting `createTemplate*` generate a broken raw string from
the cooked one, grab the source code for it.

Also, add a missing bit to `\`-quote `$`s.  As the comment in the code
says, it could just `\`-quote `${` since other `$`s are valid, but I
think that it's less confusing to always quote $s (but the change is in
the comment if minimalism is preferred).

Also, a small-but-confusing bug in `getCookedText()`.

Many tests for all of this.

Fixes #40625
2021-07-29 04:23:06 -04:00
Oleksandr T
7c197becb6 feat(45210): add inlay hints for getters and setters (#45214) 2021-07-28 14:52:37 -07:00
Oleksandr T
b81eb6cfe1 fix(45182): allow property access in arrow function (#45193) 2021-07-27 09:46:17 -07:00
Oleksandr T
85e0e5ad07 fix(44837): add graceful recovery for require completions (#45151) 2021-07-26 15:26:43 -07:00
Andrew Branch
9334a15f5f Add transitive pnpm import statement completions test (#45186) 2021-07-26 14:24:59 -07:00
Wenlu Wang
9665bc6199 Supress hints for access expr too (#45121) 2021-07-26 11:59:14 -07:00
Oleksandr T
11c7daef62 fix(45114): throw an error when using '#' as an identifier (#45124) 2021-07-26 11:39:17 -07:00
Oleksandr T
ba226167bc fix(45157): omit error after property declaration without semicolon (#45165) 2021-07-26 09:57:58 -07:00
Andrew Branch
f029a8266c Filter auto imports by symbol flags before resolving module specifiers (#45168)
* Filter auto imports by symbol flags before resolving module specifiers

* Don’t filter types out of import statement completions
2021-07-23 15:56:34 -07:00
Oleksandr T
e064817371 feat(42639): allow narrowing type in 'in' operator with the identifier on the left side (#44893) 2021-07-21 09:10:32 -07:00
Ron Buckton
365b25693c Fix and validate post-increment/decrement in module emit (#44968) 2021-07-19 13:34:42 -07:00
Andrew Branch
476054ea57 Fix auto import crashes caused by unrelocatable symbols (#45055)
* Add failing test

* Fix auto import crashes caused by unrelocatable symbols

* Use util for testing if symbol is an external module
2021-07-19 10:32:47 -07:00
Andrew Branch
36225c3260 Detect preference for Unode:-prefixed node core modules (#45080) 2021-07-19 09:56:24 -07:00
Oleksandr T
ba2e2600c8 fix(44701): allow renaming string literal in rhs/lhs of equality (#44708) 2021-07-16 14:45:06 -07:00
Anders Hejlsberg
193b7494d0 Properly propagate silentNeverType in intersections (#45073)
* Properly propagate silentNeverType in intersections

* Add regression test
2021-07-16 11:20:04 -07:00
Wesley Wigham
d0efe9065e Dont swallow declaration emit errors when issued on nodes without names (#44995) 2021-07-16 10:30:22 -07:00
Oleksandr T
00596e19f5 fix(44168): exclude adding export to existing exported identifier (#44755) 2021-07-16 09:40:17 -07:00
Oleksandr T
23ebe04563 fix(44902): resolve members in Union or Intersection types (#44904) 2021-07-16 09:07:52 -07:00
Wesley Wigham
8268f2adec Avoid bogus circularity error on context sensitive constructor property assignments (#44601)
* Avoid bogus circularity error on context sensitive constructor property assignments

* Add JS case and ensure its fixed
2021-07-15 17:06:56 -07:00
Andrew Branch
6d3772f357 Fix auto import require of CJS module with module:es2015+ and allowSyntheticDefaultExports (#44955) 2021-07-15 16:08:05 -07:00
Josh Goldberg
541e553163 Specific diagnostic suggestions for unexpected keyword or identifier (#43005)
Error message improvement for unexpected tokens in the following situations:

* A word was parsed that seems to have a low edit distance from a known common keyword
* A word was parsed that seems to be a known common keyword and a name _without_ a space in-between
* Parsing in a particular type of node (mostly a class property declaration) got a different word or token than expected

___

* Specific diagnostic suggestions for unexpected keywords or identifier

* Don't reach into there, that's not allowed

* Improved error when there is already an initializer

* Specific module error message for invalid template literal strings

* Skip 'unexpected keyword or identifier' diagnostics for declare nodes

* Improve error for function calls in type positions

* Switch class properties to old diagnostic

* Corrected errors in class members and reused existing textToKeywordObj map

* Corrected more baselines from the merge

* Update src/compiler/parser.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Mostly addressed feedback

* Clarified function call type message

* Split up and clarified parsing vs error functions

* Swap interface name complaints back, and skip new errors on unknown (invalid) tokens

* Used tokenToString, not a raw semicolon

* Inline getExpressionText helper

* Remove remarks in src/compiler/parser.ts

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-07-14 13:50:55 -07:00
Gabriela Araujo Britto
3358f137c6 Fix namespace name conflict detection in "Convert named imports to namespace import" action (#45019)
* fix namespace conflict detection
2021-07-14 11:07:12 -07:00
Jean Pierre
40ec8392a1 Fixes JSDoc @type function with variable args is interpreted incorrectly (#44864)
* Fixes #44386

* Add test

* Move test from fourslash to conformance
2021-07-13 17:17:24 -07:00
caojoshua
acdf62fa1e Fix "Union types are not being narrowed down correctly in 4.3 #44401" (#44771)
* Fix "Union types are not being narrowed down correctly in 4.3 #44401"

* On undefined constraint, add the original type to constraints.
2021-07-13 11:02:18 -07:00
Ron Buckton
66c3063b06 Add collision check for 'Reflect' when using super in static initializers (#44876)
* Add collision check for 'Reflect' when using super in static initializers

* PR feedback

* Accept baseline for new failing test
2021-07-10 12:48:54 -07:00
Oleksandr T
a15030ff6f fix(35050): Decorator emit incorrect within try block (#41951)
* fix(35050): fix decorated block-scoped class emit

* Only use internal name when targeting ES5/3

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-07-08 10:48:02 -07:00
Andrew Branch
e881a69939 Detect circularities printing recursive conditional types (#43733) 2021-07-08 09:19:58 -07:00
Ron Buckton
8590f0db40 Fix decorator emit regression for static fields (#44933) 2021-07-07 16:58:36 -07:00
Eli Barzilay
bb7de99e5a Improve "Convert to template string" with template-strings
Fixes #44396
2021-07-06 18:14:58 -04:00
Anders Hejlsberg
8e01a86c01 Consistently ignore attributes with hyphenated names in JSX (#44873)
* Consistently skip attributes with hyphenated names in JSX

* Add regression test

* Accept new baselines

* Fix tests

* Accept new baselines
2021-07-06 10:29:51 -10:00
Oleksandr T
fc5c765f81 fix(44868): handle import type in shorthand assignment (#44881) 2021-07-06 09:29:09 -06:00
Ron Buckton
8b496ed34c Fix class name reference in class expr (#44877) 2021-07-02 18:37:23 -07:00
Daniel Rosenwasser
248b2c3fc1 Further optional delete corrections (#44862)
* Add more tests.

* Accepted baselines.

* Switch to testing the symbol's flags.

* Accepted baselines.
2021-07-01 18:44:22 -07:00
Oleksandr T
e402c1d464 feat(44799): allow auto import codefix for shorthand property assignment (#44827) 2021-06-30 16:09:42 -05:00
Zzzen
813ddf7909 ensure export modifier is used before default modifier (#44570)
* ensure export modifier is used before default modifier

* gracefully handle `default function`

* Revert "gracefully handle `default function`"

This reverts commit 1d8e288754.

* give better error message on default without leading export
2021-06-30 09:43:14 -07:00
Oleksandr T
5c8d76347c fix(44448): disallow 'delete' operator for optional properties (#44612) 2021-06-29 16:56:45 -07:00
Anders Hejlsberg
4c19873b64 Validate symbol-named properties against symbol index signatures (#44815)
* Validate symbols against both symbol and string index signatures

* Add tests

* Accept new baselines
2021-06-29 11:53:07 -10:00