Commit Graph

67 Commits

Author SHA1 Message Date
Ron Buckton
b975dfa102 Write more useful types in .types test outputs (#48578) 2022-04-07 09:51:17 -07:00
Wesley Wigham
b5a3a058f5 Merge diagnosticsProducing and nonDiagnosticsProducing checkers into a single checker supporting lazy diagnostics (#36747)
* Merge diagnosticsProducing and nonDiagnosticsProducing checkers into a single checker supporting lazy diagnostics

* Fix lint
2022-03-23 16:21:06 -07:00
Ryan Cavanaugh
e00b5ecd40 Enable max-statements-per-line lint rule (#45475)
* Enable the rule

* Fix all the violations
2021-08-16 13:53:51 -07:00
Wesley Wigham
08e6bc20bb Trampolines for large binary expressions (#36248)
* WIP

* Test no longer crashes, but emit trampoline is incomplete and skips pipeline phases

* Fix lints, use non-generator trampoline in emit (still skips pipeline)

* Final version with emitBinaryExprssion work stack that is only used if possible

* Fix lints

* retarget to es2015 for testing

* Use bespoke state machine trampolines in binder and checker

* Remove now extraneous code in parser

* Adjust fixupParentReferences to use a depth first preorder traversal rather than breadth first

* Reintroduce incremental fast bail in fixupParentReferences

* Revert target to es5

* PR feedback

* Small edit for devops rebuild with updated definition

* Fix comment nits, add internally extraneous check back into transformer
2020-01-24 16:29:55 -08:00
Wesley Wigham
27616dd523 Move codefix types into services/types.ts (#35506)
* Move codefix types into services/types.ts

* Also split apart refactorProvider

* Move all meanings of DocumentHighlights into one file

* Use setter for object allocator

* Remove unneeded namespace reference

* Remove some shorthand references to nonlocal namespace variables

* Convert WatchType string enum to a structure that can be merged across modules

* Rename harness to harnessIO

* Move accidental globals into namespace

* Remove unused globals

* Suppress lints - these qualifiers are needed for the migration to go smoothly

* Hide global declaration
2019-12-05 10:51:31 -08:00
Alexander T
1b4dfbc7d6 Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/eslint 2019-07-29 18:39:29 +03:00
Wesley Wigham
2a4930f4ec Bind a jsdoc enum as SymbolFlags.TypeAlias and not SymbolFlags.Enum (#32520)
* Bind a jsdoc enum as SymbolFlags.TypeAlias and not SymbolFlags.Enum

* Actually include an @enum tag as a declaration

* Add enum tag refs into a couple more syntax kind lists

* accept symbol baseline update
2019-07-26 13:57:22 -07:00
Alexander T
f6a50067d3 @typescript-eslint/indent 2019-06-27 11:30:03 +03:00
Andy
12f3d0d54c Enable --strictPropertyInitialization (#27558)
* Enable --strictPropertyInitialization

* Code review
2018-11-16 16:02:23 -08:00
Wesley Wigham
d58b1f664b mark error type in baselines very not-aggressively (#26346) 2018-08-17 15:45:14 -07:00
Andy
1599ee2805 Always return a defined result from getTypeFromTypeNode (#26108) 2018-07-31 17:28:15 -07:00
Andy
b895614c55 Avoid trying to write the type of non-values (#25626) 2018-07-31 15:02:41 -07:00
Andy
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
Andy
55bffba5fd Use getTextOfNode over getTextOfNodeFromSourceText(getSourceFileOfNode(node)) (#22387) 2018-03-08 07:52:35 -08:00
Wesley Wigham
62185673fd Emit unqiue symbols with typeof if possible before issuing an error (#21403) 2018-02-28 15:44:12 -08:00
Sheetal Nandi
271b47ce93 Emit the symbol information for declaration names (could be string literals and more) 2018-02-01 14:30:32 -08:00
Andy
f4236ec5c8 Rename "isPartOfExpression" (#18469) 2017-10-31 08:05:39 -07:00
Andy
1f282f19e0 Fix "noStringLiteral" lint errors (#19310) 2017-10-19 08:15:48 -07:00
Wesley Wigham
5353475fce Always collect type and symbol baselines (#18621)
* Always generate type & symbol baselines

* Accept changed shadowed baselines

* Accept brand new type and symbol baselines

* Allow `getTypeAtLocation` to return undefined in the type writer

* Accept baselines which had missing type information

* Bind container for dynamically names enum members so they may be printed

* Accept type/symbol baselines for enums with computed members

* First pass at reducing typeWriter memory overhead

* Use generators to allow for type and symbol baselines with no cache

* Accept new baselines for tests whose output was fixed by better newline splitting

* Hard cap on number of declarations printed, cache declaration print text

* handle differing newlines better still to handle RWC newlines

* Lower abridging count, accept abridged baselines

* Limit max RWC error output size, limit RWC type and symbol baseline input size

* Move skip logic into type and symbol baseliner to streamline error handling

* Accept removal of empty baselines

* Canonicalize path earlier to handle odd paths in input files

* Do canonicalization earlier still, also ensure parallel perf profiles for different targets do not trample one another

* No need to pathify again
2017-09-22 15:52:04 -07:00
Andy
e7dc2a67ca Enable "object-literal-shorthand" lint rule (#16987) 2017-07-07 07:26:58 -07:00
Ron Buckton
8bf176ac3d Cleanup and reorganization of node tests 2016-02-04 16:41:58 -08:00
Wesley Wigham
8a93b48945 fix lint: prefer const 2015-11-04 14:51:36 -08:00
Ryan Cavanaugh
7280509058 Don't show lib.d.ts line numbers in symbol baselines 2015-10-05 16:37:45 -07:00
Arthur Ozga
e6809c30f1 Simplfied Return Values 2015-07-24 15:27:28 -07:00
Dan Quirk
cb4577e3e8 var->let and a few misc other fixes 2015-07-14 17:47:07 -07:00
Dan Quirk
7076e3c9dd Fix most tslint errors in the harness 2015-07-14 16:16:30 -07:00
Anders Hejlsberg
d71af8a3fb Addressing CR feedback 2015-06-17 13:28:39 -07:00
Anders Hejlsberg
e305de1403 Workaround to match previous type writer output 2015-06-16 06:54:10 -07:00
Cyrus Najmabadi
a2efe474cf Split symbol baselines from type baselines. 2015-04-15 16:44:20 -07:00
Cyrus Najmabadi
29f3f6fcae Merge branch 'master' into typeWriter 2015-04-13 14:29:37 -07:00
Cyrus Najmabadi
b5b9f517ce Include symbol information in the typewriter baselines. 2015-04-13 13:54:22 -07:00
Cyrus Najmabadi
592e2314d4 Simplify typewriter code. 2015-04-13 12:36:11 -07:00
Jason Freeman
d459c59028 Merge branch 'master' of https://github.com/Microsoft/TypeScript into iteratorSpreadDestructure 2015-04-08 16:14:24 -07:00
Cyrus Najmabadi
a1e18fc22b Introduce a new HeritageClauseElment type.
This type represents the expression+type arguments you can get in a class or interface
heritage clause section.  For class-implements clauses, or interface-extends clauses,
these expressions can only be identifiers or dotted names.  For class extends clauses,
these could be any expressions in the future.  However, for now, we only support identifiers
and dotted names.
2015-03-31 12:29:02 -07:00
Jason Freeman
3497e27d56 Add spread to typeWriter 2015-03-25 18:03:32 -07:00
Cyrus Najmabadi
124a77cc3a Remove 'ZeroBased' from all APIs, now that all APIs are zero based. 2015-02-16 19:35:45 -08:00
Cyrus Najmabadi
041b646004 Move typewriter over to using zero based math. 2015-02-16 19:06:47 -08:00
Cyrus Najmabadi
b3366ec8b4 name more line/char functions more clearly. Use zero based indexing in breakpoints. 2015-02-16 16:18:53 -08:00
Cyrus Najmabadi
11a9df2cc9 Expose zero-based helpers that code will be able to call. 2015-02-16 15:30:21 -08:00
Cyrus Najmabadi
b6d083fa40 Do not publicly expose a way on a Program instance to get typecheckers with differing behavior.
Now, you can only get the non-diagnostics, pull-type-checker from the Program instance.
If you want diagnostics, you simply ask the Program instance for the diagnostics you want.
2015-02-04 16:11:38 -08:00
Cyrus Najmabadi
b665323d45 Make the emitter no longer depend on the Program.
This breaks layering.  Also, it means the emitter depends on too large a surface area.
Now the emitter declares exactly what it needs, and only gets that.
2014-12-16 13:52:47 -08:00
Sheetal Nandi
a4ab192b6f Fix the merge conflicts 2014-12-04 13:38:51 -08:00
Sheetal Nandi
1939c7f2cd Fix the getSymbolInfo and getTypeOfNode entry points to resolve the context sensitive information before resolving the actual node 2014-12-03 14:47:13 -08:00
Cyrus Najmabadi
e4b543981c Updating syntax kind names. 2014-11-29 15:58:55 -08:00
Cyrus Najmabadi
e1011aa2f0 Rename syntax properties to match Roslyn/Fidelity naming. 2014-11-29 15:47:02 -08:00
Cyrus Najmabadi
6a4927cef7 Provide unique nodes for void/typeof/delete expressions. 2014-11-29 13:43:30 -08:00
Vladimir Matveev
a8e5aad6e8 use const enums in compiler 2014-11-03 23:31:38 -08:00
Daniel Rosenwasser
64097a3c6c Missed a use when fixing Debug.assert 2014-10-28 18:47:12 -07:00
Sheetal Nandi
58cfc985b9 Merge branch 'master' into symbolInfoFormatting 2014-10-08 18:25:42 -07:00
Sheetal Nandi
61994a7e62 Show the type information in places where there is no symbol associated 2014-10-03 15:50:38 -07:00