Commit Graph
5258 Commits
Author SHA1 Message Date
Nathan Shively-Sanders 383286ff53 Add type parameter inference
It's a smeary copy of the checker's type parameter, so I feel bad about
duplicating that code. Not sure what the solution is, architecturally.
2019-08-30 13:44:06 -07:00
Nathan Shively-Sanders 37150d9cb5 Turn on findBuiltinTypes
Type parameter inference is special-cased, just moved from its previous
place with no improvement.
2019-08-29 12:40:33 -07:00
Nathan Shively-Sanders 945d423ef5 Fix bugs in combineUsages/getSignatureFromCalls 2019-08-28 14:12:21 -07:00
Nathan Shively-Sanders c93f9193ce Merge branch 'master' into infer-from-usage/similarity-to-builtins 2019-08-28 12:57:22 -07:00
Nathan Shively-Sanders 13e1ccdd01 goto-def should treat constructor functions as functions (#33109)
* goto-def:special handling for constructor functions

* Just treat constructor functions like functions

* Even simpler fallback
2019-08-27 16:22:22 -07:00
Nathan Shively-Sanders d347b08a42 Copied from old branch
1. Everything explodes! Out of stack space!
2. Results aren't used yet.
3. But call and construct use the new getSignatureFromCalls, so I expect
some baseline changes after I get the infinite recursion fixed.
2019-08-27 13:13:58 -07:00
Nathan Shively-Sanders 4fc12d7b03 Close over common variables in inferTypeFromReferences (#33095)
Also lots of renaming
2019-08-27 09:02:58 -07:00
Wenlu Wang 9942c6052f add completion for promise context (#32101)
* add completion for promise context

* check insert text inside add symbol helper

* fix incorrect branch

* avoid completions with includeCompletionsWithInsertText perferences

* avoid useless parameter
2019-08-26 15:26:25 -07:00
Nathan Shively-Sanders e9073a863d Improve names in infer-from-usage (#33090)
Basically, drop "Context" from all names, because it just indicates that
it's an implementation of the State monad.
2019-08-26 13:20:42 -07:00
Armando Aguirre 5008c9cc3e Merge pull request #33064 from armanio123/FixNavbarMultilineUnterminated
Added optional trailing slash to navigation bar regex
2019-08-26 12:06:36 -07:00
Nathan Shively-Sanders 21f192367a Fix infer from usage prop assignment (#33088)
* Add test case

* Fix infer from usage property assignment

Property assignment and shorthand property assignment were incorrectly
treated differently; both have ObjectLiteralExpression as a parent, but
the code previously assumed that property assignments had
ObjectLiteralExpression as parent.parent.

Also make fourslash directives case insensitive and less whitespace
sensitive.

* Add "incorrect 3-slash" error to fourslash parsing.
2019-08-26 10:42:17 -07:00
Armando Aguirre a0c29fe4e5 Added optional trailing slash regex 2019-08-23 15:42:03 -07:00
Armando Aguirre 25f609b3a2 Merge pull request #32672 from armanio123/FixNavbarMultiline
Fixed issue for navbar when having multi-line string literals
2019-08-23 15:02:25 -07:00
Armando Aguirre f76e3b59b2 Make trailing slash required on cleanText regex 2019-08-23 13:51:53 -07:00
Andrew Casey e3690c3a07 Use the in operator 2019-08-23 13:10:32 -07:00
Andrew Casey 00d37268e8 Make triple-slash comment classification more restrictive
It was overly permissive and ended up making a mess of C#-style
comments:

`/// <summary>Text</summary>`

Now it checks the element name.  Attribute names remain unchecked.
2019-08-23 12:55:10 -07:00
Ryan Cavanaugh 016884d48c Add assert comments in CodeFixes and Refactors (#33016)
* Add comments to assert calls

* Add comments to assert calls in codefixes

* So linty
2019-08-21 14:22:17 -07:00
Andrew Branch 5d04250ea8 Improve “Add missing await” fix-all (#32922)
* Improve codeFixAll for add missing await

* Improve add missing await for initializers and fix-all

* Fix when only one side of a binary expression can have its initializer fixed
2019-08-20 16:53:28 -07:00
Ron Buckton 1bf218291f Fix default behavior for transpileModule when fileName not provided (#32982) 2019-08-19 18:13:39 -07:00
Hoang Pham 46b7972885 Add JSX codefix if available (#32281)
* Add JSX codefix if available

* Update react jsx.

* Update diagnostic code.
2019-08-16 12:46:55 -07:00
Armando Aguirre 428e8d0cb1 Fixed navigationbar regex 2019-08-15 13:49:11 -07:00
Andrew Branch 2217f0b859 Fix export=global auto import exclusion (#32898) 2019-08-14 15:50:25 -07:00
Daniel Rosenwasser c8d937ecd3 Merge pull request #32726 from fuafa/completion-after-private
Fix completion disappear after a property declaration with a private modifier
2019-08-13 11:09:32 -07:00
Orta 2a2866c3a9 Merge pull request #32563 from orta/fix_31298
Handle namepaths inside JSDoc type expressions a bit better
2019-08-09 16:15:50 -07:00
Ron BucktonandWesley Wigham 98b6db81d9 Allow accessors in ambient class declarations (#32787)
* Allow accessors in ambient class declarations

* Update src/compiler/transformers/declarations.ts

Co-Authored-By: Wesley Wigham <wewigham@microsoft.com>
2019-08-09 16:11:25 -07:00
Sheetal Nandi 825d8bb1dc Merge pull request #32791 from microsoft/documentHighlightsFilesToSearch
Ignore unknown files to search from in document highlights
2019-08-09 15:34:05 -07:00
Andrew Casey 816e7b0567 Merge pull request #32789 from amcasey/FileNotFoundError
Correct string template
2019-08-09 15:16:23 -07:00
Sheetal Nandi b7e49d1d1c Ignore unknown files to search from in document highlights 2019-08-09 15:06:51 -07:00
Andrew Casey 8c6612b31e Tweak message text 2019-08-09 14:50:24 -07:00
Andrew Casey a02735e1fb Merge pull request #32785 from amcasey/FileNotFoundError
Include fewer paths in exception
2019-08-09 14:28:32 -07:00
Andrew Casey 6c19c13094 Use an explicit type 2019-08-09 14:04:04 -07:00
Ron Buckton 9133e7ad0e Use defaults for transpileModule (#31563) 2019-08-09 14:04:01 -07:00
Andrew Casey 6122e92802 Restore logging of the program file list 2019-08-09 12:34:40 -07:00
Andrew Casey d9780cd7ba Include fewer paths in exception
It's sufficient to append them to the log.
2019-08-09 10:27:02 -07:00
Armando Aguirre 209ca0749f Fixed lint issues 2019-08-08 14:29:03 -07:00
Armando Aguirre 98729b4462 Truncate to 150 chars and added unit tests 2019-08-07 13:50:18 -07:00
Orta 79598af113 Merge pull request #31980 from sisisin/fix/typo-comment-at-import-tracker
chore(tsserver): fix typo
2019-08-07 11:16:24 -04:00
Orta Therox 487e2ffe2a Merge master 2019-08-06 15:34:06 -04:00
xiaofa e1bca8ff2a Fix class member completion disappear after a property declaration with a private modifier 2019-08-06 08:35:34 +08:00
sisisin 33a6509751 Fixes export destructured variables reference (#32007)
* Add basic test for current behavior

* Fixes getting destructured variables references(#31922)

* Add test case that renames destructured property

* Fixes missing nested object destrucuturing variable references
2019-08-05 12:00:06 -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
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
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
Armando Aguirre ce133ec2dd Fixed issue for navbar when having multiline string literals 2019-08-01 17:21:29 -07: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
Orta Therox 3145656f6a Merge branch 'master' of https://github.com/microsoft/typescript into 30246 2019-07-31 17:08:45 -04:00
Sheetal Nandi c25e7dd873 Wire in compilerOptions of the program in to the host's resolveModuleNames and resolveTypeReferenceDirectives api
Fixes #31056
2019-07-31 12:01:49 -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