Commit Graph
1341 Commits
Author SHA1 Message Date
Andy b90cdb2221 Reduce duplicate code for TextChange overlaps (#22278) 2018-03-02 10:22:52 -08:00
Andy a564912d9a Apply 'no-unnecessary-qualifier' lint rule (#22009) 2018-03-01 14:20:18 -08:00
Andy 928ffaa1b5 Fix type of isIterationStatement (#22065) 2018-03-01 13:12:18 -08:00
Wesley Wigham 32c63a2628 Add support for transpiling per-file jsx pragmas (#21218)
* Add support for per-file jsx pragmas

* Add error for using jsx factory pragma with fragments

* More tests, use different regex class for pragma capture

* Unify all pragma parsing machinery
2018-02-26 16:10:00 -08:00
Andrew Casey b31aa4e012 Merge pull request #22087 from amcasey/AmbientModuleImports
Organize imports in ambient modules
2018-02-23 17:43:28 -08:00
Wenlu Wang 30a96ba335 add support of codefix for Strict Class Initialization (#21528)
* add support of add undefined type to propertyDeclaration

* add support of add Definite Assignment Assertions to propertyDeclaration

* add support of add Initializer to propertyDeclaration

* remove useless parameter

* fix PropertyDeclaration emit missing exclamationToken

* merge fixes and fix

* fix unnecessary type assert
2018-02-23 07:25:50 -08:00
Andrew Casey 427e6ed3e6 Tidy isAmbientModule 2018-02-22 16:30:55 -08:00
Andy a299d2dd1c isDeclarationName: support ComputedPropertyName (#22123)
* isDeclarationName: support ComputedPropertyName

* update additional baseline
2018-02-22 15:53:49 -08:00
Andy 8a52eade2e Make getTextOfIdentifierOrLiteral and getEscapedTextOfIdentifierOrLiteral only accept Identifier | StringLiteralLike | NumericLiteral (#22002) 2018-02-21 11:05:43 -08:00
Andy b3edc8f9f4 Apply 'no-unnecessary-type-assertion' lint rule (#22005)
* Apply 'no-unnecessary-type-assertion' lint rule

* Fix type error

* Fix tsconfig.json

* Add --format back
2018-02-16 18:38:00 -08:00
Andy b70aa229c6 getTextOfPropertyName: Assert input value is a PropertyName (#21981) 2018-02-16 10:48:57 -08:00
Andy 8518343dc8 Add isStringLiteralLike helper (#21953) 2018-02-14 13:25:04 -08:00
Andy 2ee92948d8 Support @param tag on property declaration initializer (#21907)
* Support @param tag on property declaration initializer

* Update test

* Finish updating test
2018-02-14 10:12:38 -08:00
Andy 8c2756fdf6 Support getting string literal completions based on a type argument constraint (#21168)
* Support getting string literal completions based on a type argument constraint

* Fix bug: look for require call before argument info

* Code review

* @sandersn code review

* Remove test cast

* Reduce completions.ts diff

* @weswigham review

* Remove getTypeArgumentConstraint's dependence on checkTypeArgumentConstraints

* Remove TODO
2018-02-13 15:18:26 -08:00
Andy 74f01abfcf Clean up findPrecedingToken and avoid returning whitespace-only jsx text token (#21903) 2018-02-12 14:42:16 -08:00
jack-williams 67984c720e Fix #21848: Allows to mutate const with non-null assertion (#21873) 2018-02-12 10:57:59 -08:00
Mohamed Hegazy 4150a463e2 Fix #20805 (#21755)
* Add `-dev` to version patch number in master

* Refactor to handel non-identifier tokens for UMD modules

* Be more graceful handeling non-identifier tokens in import fixes

* Fix bad merge

* Remove check for isIdentifier
2018-02-08 10:32:08 -08:00
Wesley Wigham 871e71d4ef Move insertSorted from server to core, use for diagnostic collections (#21401)
* Move insertSorted from server to core, use for diagnostic collections

* All keep the overall list sorted, too

* Increase timeout for js verification

* Use knowledge of how diagnostics are sorted to make all diagnostic list creation lazy and more efficient

* Staunchly avoid array allocation in favor of resizing an existing array
2018-02-07 17:00:59 -08:00
Anders Hejlsberg 22cbfe3b1b Fix getConstrainedTypeParameter function 2018-02-07 14:48:13 -08:00
Andy c7b86e824f EntityNameExpression doesn't need to include ParenthesizedExpression (#21588) 2018-02-05 14:22:03 -08:00
Andy 14bd0a2d56 Detect and prevent creation of bad Identifier (#21581) 2018-02-05 09:13:38 -08:00
Anders Hejlsberg 7034d671db Merge branch 'conditionalTypes' into inferTypes 2018-02-03 08:41:54 -08:00
Anders Hejlsberg d4dc67aab2 Merge branch 'master' into conditionalTypes
# Conflicts:
#	src/compiler/checker.ts
2018-02-03 07:26:38 -08:00
Anders Hejlsberg 7c241ba2f7 Merge branch 'conditionalTypes' into inferTypes
# Conflicts:
#	src/compiler/checker.ts
#	tests/cases/fourslash/completionInJSDocFunctionNew.ts
#	tests/cases/fourslash/completionInJSDocFunctionThis.ts
2018-01-30 13:40:16 -08:00
Anders Hejlsberg 4f2b5f32f9 Merge branch 'master' into conditionalTypes 2018-01-30 06:42:14 -08:00
Andrew Casey 9bc0d33512 Move bug URLs into assert messages 2018-01-26 11:12:34 -08:00
Andrew Casey 8ec36e988d Add asserts upstream from #20809 2018-01-26 10:52:25 -08:00
Anders Hejlsberg d608941480 Implement type inference in conditional types 2018-01-25 12:25:00 -08:00
Andy 77c5529e93 Make error span for wrong type arguments be just <...>,d not f<...>(...) (#21390) 2018-01-24 10:58:41 -08:00
Philippe Voinov a7c53c70d2 Fix isTypeOfExpression in compiler API (#20875). (#20884) 2018-01-19 17:32:37 -08:00
Sheetal Nandi 8a51cdaf42 Merge branch 'master' into builderApi 2018-01-19 15:56:40 -08:00
Andy dffa8b1329 Add a TriviaKind type to allow more specific types (#21237) 2018-01-18 09:44:30 -08:00
Sheetal Nandi ed23ca582a Merge branch 'master' into builderApi 2018-01-17 16:11:44 -08:00
Sheetal Nandi 8e35c3103d Merge pull request #21244 from Microsoft/allowNonExistentInputInGetDirectories
Fix the invalid file/directory location when getting file system entries for caching the results
2018-01-17 15:39:49 -08:00
Sheetal Nandi 8281c7a137 Fix the invalid file/directory location when getting file system entry for caching read directory results
Fixes #20607
2018-01-17 15:00:22 -08:00
Anders Hejlsberg 4ec6fdd96f Merge branch 'master' into conditionalTypes
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/types.ts
#	tests/baselines/reference/api/tsserverlibrary.d.ts
#	tests/baselines/reference/api/typescript.d.ts
2018-01-17 13:12:36 -08:00
Ron Buckton 3c988e8f5a Merge pull request #21215 from Microsoft/fix20461
Fixes var declaration shadowing in async functions
2018-01-17 13:08:18 -08:00
Ron Buckton 5b45db7907 PR Feedback 2018-01-17 11:55:43 -08:00
Andy b363f4f9cd Log packageId in --traceResolution (#21233) 2018-01-17 11:41:23 -08:00
Ron Buckton afaa139475 Namespaces do not have the same 'var' scope 2018-01-17 11:30:48 -08:00
Ron Buckton 2ba29d8d9d Support labeled statement 2018-01-17 11:24:28 -08:00
Ron Buckton 1785d87fda Fix temp variable emit for names used in nested classes 2018-01-16 12:33:55 -08:00
Sheetal Nandi 5bd3f97b18 Merge branch 'master' into builderApi 2018-01-16 11:14:39 -08:00
Wesley Wigham 76d9524866 Fully deprecate the symbol display builder, reimplement in terms of node builder (#18860)
* Remove SymbolWriter, give methods to EmitTextWriter

* Unification of writers is done-ish

* Make node builder support more flags

* Write out mixins like we used to

* Accept prototype-free baselines

* Use instantiated constraint when building mapped type nodes

* Accept better mapped type baselines

* Report inaccessible this in node builder

* Turns out there was a bug in our codefix, too

* Symbol display builder usage falling

* Replace signatureToString with a nodeBuilder solution

* Replace the last internal usages of the symbol writer

* Accept semicolon additions

* Accept updated symbol baseline output

* Start using node builder for some LS operations

* Remove those pesky trailing semicolons on signatures

* Get signature printing much closer to old output

* Parameter lists should not be indented by default, especially when single-line

* Signatures up to snuff

* Type quickinfo emit is up to snuff

* Start of symbol writer replacement, needs a bit more for full compat

* Slightly mor accurate to old behavior

* Replicate qualified name type argument output correctly

* Bring back the old symbol baselines

* Mostly identical to old symbol emit now

* Perfectly matches old behavior thus far

* Replace another usage of the symbol builder

* Another usage removed

* Another usage removed

* Remove final uses of symbol display builder

* Remove implementation and types for unused symbol display builder

* Cleanup in the checker

* monomorphize new emitter code

* Replace emitWithSuffix

* Push space character to interface with writer

* List emit

* Fix lack of usage of emitExpression

* writeList, not printList

* Remove listy writes and replace with new printer calls

* Move ListFormat into types.ts

* Remove most new XToString functions in favor of node builder functions

* Accept API breaks

* Add getSymbolDisplayBuilder polyfill

* Accept updated API baseline

* Move definition to make diff easier to read

* Reinternalize some things

* Remove trailign whitespace

* Reorder for zero diff

* Remove newline

* Make shim mor eperfectly imitate old behavior

* Style feedback

* Rename reset to clear to maintain backcompat with SymbolWriter

* Fix quickfix

* Keep EmitTextWriter internal

* Remove EmitTextWriter from public API

* Mimic default name declaration emit fix

* Fix tests broken by merge

* use isFunctionLike

* Cleanup, sync TypeFormat and NodeBuilder flags

* Reorder Node initialization so pos and end are first, so a TextRange hidden class is made first to reduce future polymorphism

* Use variable instead of ternary

* Write helper for emitNodeWithWriter

* Emitter cleanup

* Cleanup whitespace, comment

* Reuse printer

* Raise error if display parts writer uses rawWrite

* Hide writer parameter through different function instead of overload, rename function in emitter

* Make less printer

* fix lint
2018-01-16 09:53:42 -08:00
Anders Hejlsberg 5094f7677c Remove 'T extends U' type constructor 2018-01-15 08:11:05 -08:00
Andy a77c6014b3 Parse comment on @property tag and use as documentation comment (#21119)
* Parse comment on @property tag and use as documentation comment

* Fix comment parsing bug -- back up after seeing `@` character

* Add test for indent

* Don't default comment to ""
2018-01-11 10:49:39 -08:00
Andy 8bce69e6bd Add refactoring to convert CommonJS module to ES6 module (#19916)
* Add refactoring to convert CommonJS module to ES6 module

* Code review

* includeGlobals -> excludeGlobals

* Improve handling of `module.exports = require("...")`

* Allow NoSubstitutionTemplateLiteral as argument to createLiteral
2018-01-09 13:15:47 -08:00
Sheetal Nandi 5bc78afcbb Merge branch 'master' into builderApi 2018-01-08 13:01:09 -08:00
Andy 6d361f89e3 Move isObjectLiteralElement to public utilities (#20605) 2018-01-08 12:29:21 -08:00
Andy 20c846d671 Add helper functions to simplify getCompletionEntryDisplayNameForSymbol (#20552) 2018-01-08 11:48:25 -08:00