Commit Graph

2647 Commits

Author SHA1 Message Date
Andy
d2dc2e6d48 Don't copy trivia when implementing an interface (#23343)
* Don't copy trivia when implementing an interface

* Use an `includeTrivia` flag instead of a separate function
2018-04-12 11:47:42 -07:00
Andy
d36f83a98d Remove TODO: GH#18795 comments (#23337) 2018-04-11 16:23:04 -07:00
Andy
b0552b089d Don't include "/index" in import from @types even with classic resolution (#23347) 2018-04-11 16:22:10 -07:00
Andy
f6b206a75a When testing references, also test documentHighlights respects filesToSearch (#23306)
* When testing references, also test documentHighlights respects filesToSearch

* Fix handling for redirects and move assertion inside getDocumentHighlights

* Add another assert
2018-04-11 14:07:22 -07:00
Wenlu Wang
9c0671d661 add refactor of convert private field to getter and setter (#22143)
* add refactor of convert private field to getter and setter

* fix refactor

* stash

* refactor accessor generate

* revert merge union type

* refeactor and accept baseline

* add support of PropertyAssignment and StringLiteral

* add support for js file

* allow static modifier in js file
2018-04-10 11:51:41 -07:00
Andy
ce5d22fef0 Fix bug: don't insert a semicolon when inserting a FunctionDeclaration (#23240) 2018-04-09 15:03:24 -07:00
Andy
98a5e5cc0d Prioritize spelling fix over add-missing-member fix (#23268) 2018-04-09 13:23:11 -07:00
Andy
998beadba2 Support goto-definition for index signatures (#23220)
* Support goto-definition for index signatures

* Use checker.getIndexInfoOfType

* Handle undefined info.declaration
2018-04-09 12:48:41 -07:00
Andy
9762598775 findAllReferences: forEachRelatedSymbol can always include shorthand destructuring (#23223)
* findAllReferences: forEachRelatedSymbol can always include shorthand destructuring

* Update rename tests
2018-04-06 16:30:55 -07:00
Andy
70682b7799 Clean up code for nonrelative path completions (#23150)
* Clean up code for nonrelative path completions

* Remove unnecessary test and simplify based on that

* More code review

* Call getCompletionEntriesFromTypings unconditionally
2018-04-06 12:19:08 -07:00
Andy
05cd784230 Remove unnecessary test file (#23214) 2018-04-06 10:45:01 -07:00
Andy
2b59c9a0d7 Don't add import completion for re-export with different name (#23211) 2018-04-06 10:05:38 -07:00
Andy
aa8631de98 findAllReferences: Share code between populateSearchSymbolSet and getRelatedSymbol (#23028) 2018-04-05 15:00:14 -07:00
Andy
24842b4002 When --noUnusedLocals/--noUnusedParameters is disabled, add suggestions instead of errors (#22361)
* When --noUnusedLocals/--noUnusedParameters is disabled, add suggestions instead of errors

* Improve performance: do not add unused suggestion diagnostics unless asking for a suggestion

* Add "unused" flag to diagnostics

* Code review

* reportsUnused -> reportsUnnecessary

* Fix test
2018-04-05 12:33:00 -07:00
Andy
f61f12613c findAllReferences: Be consistent how we handle unions in root symobls (#23002) 2018-04-05 10:55:55 -07:00
Andy
7520f9578b Fix bug: <div a="1" b/**/ > is not a jsx initializer (#23138) 2018-04-05 08:30:02 -07:00
Nathan Shively-Sanders
dca3a94f88 Print js-constructor function type names (#23089)
* Print js-constructor function type names

Instead of printing them as a type literal, which is scary.

* Use assigned name for functions and classes

That otherwise have no name. This helps quick info for javascript a
*lot*. Typescript mainly benefits when printing the type of class
expressions.

* Improve names of functions in binding elements

Also fix some fourslash baselines
2018-04-04 15:43:41 -07:00
Andy
4aeb295e3a completions: Properly handle preferences.includeCompletionsWithInsertText (#23092) 2018-04-04 08:36:48 -07:00
Mohamed Hegazy
db74229a89 Merge pull request #19317 from igelbox/fix-insert-space-after-function-generic
Fixed incorrect insertSpaceBeforeFunctionParenthesis behavior on funtions with type-arguments
2018-04-03 16:11:30 -07:00
Mohamed Hegazy
84548d5c9b Merge pull request #22049 from Kingwl/spelling-fix
replace element access if suggession is not a valid identifier
2018-04-03 13:29:43 -07:00
Wesley Wigham
a81a645128 Enable member completions for import types (#23085)
* Enable member completions for import types

* Add missing semicolon

* Compact statements

* Ye doth compacteth too much

* Handle class accesibility
2018-04-03 11:53:01 -07:00
王文璐
414266cc32 Merge branch 'master' into spelling-fix 2018-04-03 10:51:40 +08:00
Andy
1e04bd4168 Support completions for members with symbol names (#23091) 2018-04-02 18:08:00 -07:00
Wesley Wigham
fd553df3a6 Path completions for import types (#23082)
* Path completions

* Add missing flag to test

* Minify test, fix lint
2018-04-02 16:15:50 -07:00
Andy
8e14ac7d51 Improve string literal completions from a signature (#23062) 2018-04-02 13:01:31 -07:00
Nathan Shively-Sanders
d3e0929b14 Mark js-assignment functions' symbols as methods (#23078)
This make display more accurate:
1. The functions now print as methods
2. When the type of the function references the class, the type of the
function itself is now printed correctly instead of as `any`.
2018-04-02 12:17:35 -07:00
Andy
d5142a7f45 Don't offer import completions in non-module files unless "--module" is set (#22951)
* Don't offer import completions in non-module files unless "--module" is set

* Even smarter shouldOfferImportCompletions
2018-04-02 10:21:14 -07: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
ea65f21677 textChanges: Don't crash when inserting type annotation on function with no parens (#23034) 2018-04-02 08:41:22 -07:00
Andy
86a8e269fa Add 'getNameFromPropertyName' helper (#23036) 2018-04-02 08:14:15 -07:00
Arthur Ozga
9dd3ef4205 Merge pull request #22849 from aozgaa/dev/aozgaa/cSharpObjLiteralFormatting
CSharp Style Object Literal Formatting
2018-03-30 15:45:46 -07:00
Mohamed Hegazy
b47c1fd5a1 Merge pull request #22593 from Kingwl/module-spelling-fix
add spelling suggestion support for module
2018-03-29 16:56:43 -07:00
Arthur Ozga
95a69cbeb4 Merge branch 'master' into dev/aozgaa/cSharpObjLiteralFormatting 2018-03-29 16:10:33 -07:00
Arthur Ozga
5fb5ff7bf3 add option for object literal indent 2018-03-29 15:40:23 -07:00
Andy
4309c0e7f8 Fix bug: ClassDeclaration not guaranteed to be first declaration of a class (#22983)
* Fix bug: ClassDeclaration not guaranteed to be first declaration of a class

* fix test
2018-03-29 14:55:22 -07:00
Sheetal Nandi
5472ca9ed8 Merge pull request #22963 from Microsoft/incrementalEditWithJsDocNode
Correct the incremental parsing when there is jsDoc node
2018-03-28 15:42:18 -07:00
Sheetal Nandi
33e9ef60c4 Correct the incremental parsing when there is jsDoc node
Fixes #22924
2018-03-28 14:32:46 -07:00
Andy
6ec13bb945 Use getAllSuperTypeNodes in more places (#22718) 2018-03-28 13:33:20 -07:00
Andy
659dc03f68 completions: isNewIdentifierLocation = false for string literal where all legal values are known (#22933) 2018-03-27 19:36:54 -07:00
Andy
4f1656035b findAllReferences: Consistently use getTextSpan (#22847)
* findAllReferences: Consistently use getTextSpan

* Remove initializer
2018-03-27 19:36:16 -07:00
Andy
b518120883 findAllReferences: Respect search file set searching for references to an exported symbol (#22657)
* findAllReferences: Respect search file set searching for references to an exported symbol

* Remove debugging code
2018-03-27 18:48:27 -07:00
Andy
3e32e15895 Add 'fixAllDescription' property to CodeFixAction (#22616)
* Add 'fixAllDescription' property to CodeFixAction

* Code review

* Add to protocol

* Make fixAllDescription be just a string
2018-03-27 18:21:21 -07:00
Andy
2cbad6ab06 Support completion details for string literal completions (#22664) 2018-03-27 17:02:04 -07:00
Andy
b9f48c1d5d refactorConvertToEs6Module: Preserve quote style of imports (#22929) 2018-03-27 17:01:31 -07:00
Andy
6ef4d7774a Always test replacementSpan, and don't provide if it would just be an identifier (#22918) 2018-03-27 15:15:50 -07:00
Andy
21cd68dd04 Test for isNewIdentifierLocation, and make true for type with index signature (#22910) 2018-03-27 13:05:41 -07:00
Arthur Ozga
6786d7473d fix test 2018-03-26 16:53:20 -07:00
Arthur Ozga
b86b923aef Merge branch 'master' into dev/aozgaa/cSharpObjLiteralFormatting 2018-03-26 16:45:19 -07:00
Arthur Ozga
d41070a966 more tests 2018-03-26 16:37:55 -07:00
Andy
ced4c00522 importFixes: Distinguish when we need to import JSX constructor or JSX namespace (#22828) 2018-03-26 14:05:03 -07:00