Commit Graph
67 Commits
Author SHA1 Message Date
AndyandGitHub b183418124 Fix bug: Don't go to *any* constructor signature for jsx element (#26715) 2018-08-28 11:06:14 -07:00
AndyandGitHub 794f3a5e76 goToTypeDefinition: Go to function return type (#25952)
* goToTypeDefinition: Go to function return type

* Add more tests

* If a function returns 'void' or some other type with no definition, just return the function definition.
2018-08-07 12:54:19 -07:00
AndyandGitHub 0e5af11625 Fix bugs for go-to-definition on mapped type method (#25991) 2018-07-26 17:26:41 -07:00
AndyandGitHub 673ae746da Simplify and inline getPropertySymbolsFromType (#25940)
* Simplify and inline getPropertySymbolsFromType

* Combine lambdas
2018-07-26 11:52:22 -07:00
AndyandGitHub f12e9a8389 Minor refactor in goToTypeDefinition (#25951) 2018-07-25 17:10:06 -07:00
AndyandGitHub d60f4988a6 In getPropertySymbolsFromContextualType, use union discriminant to filter types (#25914) 2018-07-25 11:53:20 -07:00
AndyandGitHub 5f4a03c408 Ensure TypeChecker#getTypeAtLocation returns a defined result (#25583)
* Ensure TypeChecker#getTypeAtLocation returns a defined result

* Update additional baseline
2018-07-11 16:33:56 -07:00
AndyandGitHub 5c57e14000 goToDefinition: Don't go to jsx constructor signature (#25382) 2018-07-02 17:18:07 -07:00
AndyandGitHub a1746d4cfe Use helper functions in a few more places (#21308)
* Use helper functions in a few more places

* Fix typo

* Update API (#24966)
2018-06-29 20:07:42 -07:00
AndyandGitHub 9aa60f27eb goToDefinition: Don't add duplicate definitions for PropertyAssignment and ArrowFunction at m: () => {} (#24995)
* goToDefinition: Don't add duplicate definitions for PropertyAssignment and ArrowFunction at `m: () => {}`

* Just use !isCallLikeExpression
2018-06-25 11:33:47 -07:00
AndyandGitHub 7df81311ac goToDefinition: Don't add duplicate definitions for VariableDeclaration and ArrowFunction at f = () => {} (#24863) 2018-06-11 11:20:34 -07:00
Ron BucktonandGitHub fbeb58a147 Merge pull request #23893 from Microsoft/libReference
Adds 'lib' reference directives
2018-06-04 16:14:52 -07:00
AndyandGitHub b3a4b72a16 Always include Jsdoc comment in getTouchingPropertyName (#23379) 2018-06-04 14:15:41 -07:00
AndyandGitHub a641e6f85f goToDefinition: Put variable definition before signature definition (#24649)
* goToDefinition: Put variable definition before signature definition

* Fix lint
2018-06-04 14:13:27 -07:00
Ron Buckton fb09aeb23d Remove debugger statement 2018-06-04 13:42:31 -07:00
Ron Buckton 7de55fbb7e PR Feedback 2018-05-31 09:50:51 -07:00
AndyandGitHub e53e56cf82 Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
AndyandGitHub 724e656acb Don't show a definition at a 'require' call (#23822) 2018-05-03 08:02:56 -07:00
AndyandGitHub 59765e2d86 goToDefinition: Also add definitions for symbol if it does not match the signature symbol (#23657) 2018-04-24 09:41:47 -07:00
AndyandGitHub f6510bd6b9 goToDefinition: Remove isSignatureDeclaration, use isFunctionLike (#23475) 2018-04-17 11:53:41 -07:00
AndyandGitHub 0c17a2b2a8 goToDefinition: Reduce duplicate code around createDefinitionInfo (#23473)
* goToDefinition: Reduce duplicate code around createDefinitionInfo

* Use '[]' instead of 'emptyArray'

* Remove comment
2018-04-17 11:28:12 -07:00
AndyandGitHub 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
AndyandGitHub 1e227c6d77 Add type predicate helper functions to Type (#23066) 2018-04-04 08:10:09 -07:00
AndyandGitHub a564912d9a Apply 'no-unnecessary-qualifier' lint rule (#22009) 2018-03-01 14:20:18 -08:00
AndyandGitHub 790f65d15b Simplify isJumpStatementTarget and isLabelOfLabeledStatement users using type predicates (#22100) 2018-02-22 13:22:34 -08:00
AndyandGitHub 16f3b93ffd Simplify TextSpan creation (#21306)
* Simplify TextSpan creation

* Rename 'start' to 'pos' where possible
2018-02-08 13:51:10 -08:00
Sheetal Nandi dab0dbe6f0 Avoid the class declaration not found assert when the new expression doesnt contain construct signature 2018-02-07 13:30:58 -08:00
Sheetal Nandi 35450d3451 Construct signature is valid signature declaration
Fixes #21501
2018-02-07 13:29:47 -08:00
AndyandGitHub dcfd634559 in goToDefinition, use array helpers and clean up code (#21304)
* in goToDefinition, use array helpers and clean up code

* fix lint
2018-01-19 13:03:53 -08:00
AndyandGitHub f34de1a1ca Support find-all-references starting from a reference path or reference types comment (#21007) 2018-01-08 11:33:14 -08:00
Armando Aguirre f3059ce698 Addressed PR comments. 2017-10-24 16:08:23 -07:00
Armando Aguirre 7f577dcef3 Added triple slash support 2017-10-24 14:02:02 -07:00
Armando Aguirre 16c3255988 Updated an incredible amount of tests. 2017-10-18 15:49:46 -07:00
Armando Aguirre 8004fec2ce Addressed PR comments: added simplified/full version, changed design 2017-10-18 14:48:06 -07:00
AndyandGitHub e2141ad469 Mark some arrays as readonly (#17725)
* Mark some arrays as readonly

* Avoid unnecessary allocations and style changes

* Fix lint
2017-08-24 09:55:01 -07:00
YuiandWesley Wigham d352e3b03f [Master] fix 16407 - LS in binding element of object binding pattern (#16534)
* wip-try get symbol of bindingelement in objectBindingPattern first

* Add fourslash tests

* Update .types baselines

* Update .symbols baselines

* Revert checker changes

* Actually lookup type for binding property name definition

* More succinct check, clarify yui's comment
2017-08-11 11:14:59 -07:00
AndyandGitHub eadd084c82 Add 'name' property to Identifier (#17329)
* Add 'name' property to Identifier

* Rename to unescapedText

* Rename 'id.text' to 'id.escapedText'

* Rename 'id.unescapedText' to 'id.text'

* Make escapeIdentifier and unescapeIdentifier do nothing
2017-07-25 13:16:34 -07:00
AndyandGitHub 194c2bc2ca Make NodeArray readonly (#17213)
* Make NodeArray readonly

* Fix bug: use emptyArray instead of undefined

* Fix bug: Don't expose MutableNodeArray

* Undo trailing whitespace changes
2017-07-18 10:38:21 -07:00
AndyandGitHub e7dc2a67ca Enable "object-literal-shorthand" lint rule (#16987) 2017-07-07 07:26:58 -07:00
Wesley WighamandGitHub 4e6b2f3c93 Created a branded type for identifier-escaped strings (#16915)
* Created a branded type for escaped strings

Then flowed it throughout the compiler, finding and fixing a handful of
bugs relating to underscore-prefixed identifiers in the process.
Includes a test for two cases noticed - diagnostics from conflicting
symbols from export *'s, and enum with underscore prefixed member emit.

* Correctly double underscores WRT mapped types

* Add fourslash tests for other fixed issues

* use function call over cast

* Update forEachEntry type accuracy

* Just use escaped names for ActiveLabel

* Remove casts from getPropertyNameForPropertyNameNode

* This pattern has occurred a few times, could use a helper function.

* Remove duplicated helper

* Remove unneeded check, use helper

* Identifiers list is no longer escaped strings

* Extract repeated string-getting code into helper

* Rename type and associated functions

* Make getName() return UnderscoreEscapedString, add getUnescapedName()

* Add list of internal symbol names to escaped string type to cut back on casting

* Remove outdated comments

* Reassign interned values to nodes, just in case

* Swap to string enum

* Add deprecated aliases to escapeIdentifier and unescapeIdentifier

* Add temp var

* Remove unsafe casts

* Rename escaped string type as per @sandersn's suggestion, fix string enum usages

* Reorganize double underscore tests

* Remove jfreeman from TODO

* Remove unneeded parenthesis
2017-07-06 14:45:50 -07:00
AndyandGitHub 3cd9f3d2d4 Support services for @typedef (#16087)
* Support services for @typedef

* Ensure JSDocTypeReference has SemanticMeaning.Type

* Get SemanticMeaning right
2017-05-26 09:52:46 -07:00
Andy Hanson b1e100e494 Merge branch 'master' into kind 2017-05-23 07:02:30 -07:00
andy-ms b162097c3c Make ScriptElementKind and HighlightSpanKind string enums 2017-05-20 07:56:24 -07:00
Andy Hanson d646c727e7 Merge branch 'master' into jsdoc 2017-05-19 08:18:18 -07:00
AndyandGitHub 38ece3b703 Merge pull request #15737 from Microsoft/findAllRefs_module
Support find-all-references for a module specifier
2017-05-19 08:11:56 -07:00
Andy Hanson dc40f5d6b9 Merge branch 'master' into jsdoc 2017-05-17 07:17:32 -07:00
Andy Hanson 38784b761a Support for JSDoc in services 2017-05-15 14:45:30 -07:00
Andy Hanson aaf6b83cb5 Don't goto aliased symbol with no declarations; and update tests 2017-05-12 10:26:39 -07:00
Andy Hanson d6fa91edcd goToDefinition: Skip default and = imports 2017-05-11 15:49:30 -07:00
Andy Hanson f05a85d56f Fix bug for goto-definition on a TSX constructor using an alias declaration 2017-05-10 15:49:40 -07:00