Commit Graph
4239 Commits
Author SHA1 Message Date
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
Andy e14964169a Combine getDocumentationComment implementations (#22722) 2018-03-30 09:43:12 -07:00
Andy a5df301dec Simplify getPropertySymbolsFromBaseTypes (#23004) 2018-03-30 09:42:49 -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
Wesley Wigham 1e5641ba8e Mangle comment for sorcery (#23006) 2018-03-29 16:05:31 -07:00
Andy 4a39caffd4 Use isExternalModuleImportEquals in one more place (#22417) 2018-03-29 15:40:25 -07:00
Arthur Ozga 5fb5ff7bf3 add option for object literal indent 2018-03-29 15:40:23 -07:00
Andy d5a7dc1053 fixAddMissingMember: Remove special-casing for 'this' (#22987)
* fixAddMissingMember: Remove special-casing for 'this'

* Update type of 'call'
2018-03-29 12:54:17 -07:00
Andy 7d39b457f8 Simplify createChildren (#22270)
* Simplify createChildren

* Move 'getSourceFile()' call after early returns
2018-03-28 13:57:43 -07:00
Andy 6ec13bb945 Use getAllSuperTypeNodes in more places (#22718) 2018-03-28 13:33:20 -07:00
Andy e60348be46 Inline isParameterOfConstructorDeclaration (#22838) 2018-03-27 20:15:43 -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 6118f211d1 Add 'isParameterPropertyModifier' helper (#22841) 2018-03-27 19:36:42 -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
Andy ccd6a010e0 completions: Use keywordForNode helper instead of .getText() (#22751) 2018-03-27 12:56:30 -07:00
Andy 2bd66b3292 textChanges: Add insertCommentBeforeLine method (#22902) 2018-03-27 11:50:48 -07:00
Andy e9e1d0d70b textChanges: Use InsertNodeOptions instead of ChangeNodeOptions where possible (#22903) 2018-03-27 11:50:34 -07:00
Andy 85f11cc5e4 textChanges: Use replaceRange in more places (#22904) 2018-03-27 10:57:42 -07:00
Andy ea6740fa91 replaceNode: Always use non-adjusted end (#22519)
* replaceNode: Always use non-adjusted end

* Never adjust start position either

* Fix excess property checks, remove unnecessary arguments

* Make 'insertText' and 'newLineCharacter' private

* Use replaceNode in one more place now that it doesn't affect comments

* Update replaceNodeRange too

* Always ask for ChangeNodeOptions
2018-03-27 10:34:16 -07:00
Arthur Ozga 1ced600efe pass in sourceFile and revert child to TextRangeOfKind 2018-03-26 17:53:50 -07:00
Arthur Ozga b86b923aef Merge branch 'master' into dev/aozgaa/cSharpObjLiteralFormatting 2018-03-26 16:45:19 -07:00
Andy a9d65b8b00 textChanges: Clean up *Options interfaces (#22813) 2018-03-26 15:34:58 -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
Andy fa794f6ee1 Remove unnecessary 'forEachEntry' call (#22653) 2018-03-26 13:04:47 -07:00
Wesley Wigham 6af764c560 Declaration maps and transparent goto definition using them (#22658)
* Add compiler option to enable declaration sourcemaps

* Transparent goto definition for sourcemapped declaration files

* Post-rebase touchups

* Rename API methods

* Fix lints

* Fix typo in name XD

* Log sourcemap decode errors

* Share the cache more, but also invalidate it more

* Remove todo

* Enable mapping on go to implementation as well

* Allow fourslash to test declaration maps mroe easily

* more test

* Handle sourceRoot

* Add tests documenting current behavior with other sourcemapping flags

* Ignore inline options for declaration file maps, simplify dispatch in emitter

* Change program diagnostic

* Fix nit

* Use charCodeAt

* Rename internal methods + veriables

* Avoid filter

* span -> position

* Use character codes

* Dont parse our sourcemap names until we need to start using them

* zero-index parsed positions

* Handle sourceMappingURL comments, including base64 encoded ones

* Unittest b64 decoder, make mroe robust to handle unicode properly

* Fix lint

* declarationMaps -> declarationMap

* Even more feedback

* USE Mroe lenient combined regexp

* only match base64 characters

* Fix nit
2018-03-26 12:15:34 -07:00
Andy 9557e4ad96 Handle completions in interface / type literal similar to class (#22701)
* Handle completions in interface / type literal similar to class

* Code review
2018-03-23 16:04:29 -07:00
Arthur Ozga 3fc480c0bd cSharp-style formatting for multi-line object literals 2018-03-23 15:38:03 -07:00
uniqueiniquity 6ba4dbeae4 Make region outlining more sensitive to CRLF 2018-03-23 14:29:32 -07:00
Wesley Wigham 0736554db7 Alternate but more general token comment emit fix + organizeImports fix (#22836)
@amcasey: Preserve leading trivia when organizing imports

When organizing imports, we used to move the leading and trailing trivia
of each individual import with that import as it was repositioned or
deleted.  This had the unfortunate effect of repositioning or deleting
the header comment of the file.

Our new approach is to leave the leading trivia of the first import
ahead of the resulting block of imports (i.e. it no longer follows the
first import as it is repositioned or deleted).  Trailing trivia on the
first import and trivia on subsequent imports are treated as before.
2018-03-23 14:13:40 -07:00
Andy 02ee11c357 Refactor tryGetGlobalSymbols into list of things to try (#22704)
* Refactor `tryGetGlobalSymbols` into list of things to try

* Refactor to `||` expression
2018-03-23 08:44:21 -07:00
Andy e0ca8a5f39 organizeImports: Fix bug in reference-testing for renamed import (#22797) 2018-03-22 13:08:58 -07:00
Andy 6d82a20109 Combine getLastChild helpers (#22418) 2018-03-22 09:32:05 -07:00
Andy b6b51a4d38 convertFunctionToEs6Class: Combine deletes and deletedNodes (#22742) 2018-03-22 08:22:00 -07:00
Andy f2f2393f4b convertFunctionToEs6Class: Copy comments from constructor to class (#22738) 2018-03-22 08:12:02 -07:00
Andy effcf2ac56 Fix test for overlapping changes (#22741) 2018-03-22 08:11:27 -07:00
Andy 3a3f57acfd Remove unnecessary exports (#22739) 2018-03-22 08:10:52 -07:00
Andy cc3921323c Support services settings (#22236)
* Support services settings

* Code review

* More review

* Use different names for Options and GetCompletionsAtPositionOptions (todo: come up with better names)

* More renames

* More renaming

* Support quote style in importFixes

* Add `importModuleSpecifierPreference` option

* Support quote style for `throw new Error('Method not implemented.')` (#18169)

* options -> preferences
2018-03-20 13:07:59 -07:00
Andy 0df92a1ba1 Simplify isImplementation (#22660) 2018-03-19 11:59:22 -07:00
Andy c7215a181c findAllRefs: give entry for union its own definition (#22694) 2018-03-19 11:58:20 -07:00
Andy 5fd3ed2c10 Fix indent (#22662) 2018-03-16 15:54:52 -07:00
Andy 42c7aa85ce Clean up isNameOfExternalModuleImportOrDeclaration (#22659) 2018-03-16 14:54:41 -07:00