Commit graph

903 commits

Author SHA1 Message Date
David Sherret 7e0ed5ec4d Fix createProgram js docs. 2018-06-01 23:29:05 -04:00
Sheetal Nandi b0f039c9e2 Make suggestion diagnostics to wire cancellationToken
This especially needed if its a js file without the ts-check, the file wont be typechecked in getSemanticDiagnostics
Fixes part of #19458
2018-05-31 10:47:17 -07:00
Sheetal Nandi 51058b56e5 Do not trigger invalidation if emitted file is in declarationDir 2018-05-24 13:36:52 -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 7106a587cc
Add type for diagnostics where location is defined (#23686)
* Add type for diagnostics where location is defined

* getSemanticDiagnostics may return global diagnostics

* Reduce array creation
2018-05-22 11:01:18 -07:00
Alex Ryan 01351d43e4
Fix comment typo in program.ts 2018-05-08 14:36:32 -07:00
Wesley Wigham 8ab5be9a86
Add hook for adding transforms into the declaration emit pipeline after the main one (#23946)
* Add hook for adding transforms into the declaration emit pipeline after the main one

* Fix lint
2018-05-08 11:20:48 -07:00
Ryan Cavanaugh ffa0ccba2a Project References Core support 2018-05-07 15:12:50 -07:00
Sheetal Nandi 4e6586deb8 PR feedback 2018-05-04 10:45:46 -07:00
Sheetal Nandi 15f9ea3d14 Merge branch 'master' into requireJson 2018-05-03 15:35:54 -07:00
Ron Buckton 56648ad0f1
Merge pull request #20763 from Microsoft/vfs
Update harness to use single robust virtual file system for tests.
2018-05-03 10:25:20 -07:00
Armando Aguirre 1d593fd81e
Merge pull request #23191 from armanio123/AddVueSupport
Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExte…
2018-05-02 18:13:34 -07:00
Ron Buckton d62a11ffc0 Merge branch 'master' into vfs 2018-05-01 18:58:31 -07:00
Ron Buckton 1dff0af646 More path cleanup 2018-05-01 18:53:54 -07:00
Mohamed Hegazy 2c956af927
Merge pull request #23664 from a-tarasyuk/feature/strictPropertyInitialization-can-not-be-used-without-strictNullChecks
Add warn that user can not use --strictPropertyInitialization without --strictNullChecks
2018-04-30 12:10:54 -07:00
Sheetal Nandi 579748bc2b Merge branch 'master' into requireJson 2018-04-30 11:44:09 -07:00
Daniel Rosenwasser 9672116d8c Merge remote-tracking branch 'origin/master' into importDotMeta 2018-04-25 22:21:56 -07:00
Alexader a20e59cae4 Add warn that user can not use --strictPropertyInitialization without --strictNullChecks 2018-04-24 21:48:46 +03:00
Andy 5c94bef0e1
Add 'renameFile' command to services (#23573)
* Add 'renameFile' command to services

* renameFile -> getEditsForFileRename

* Support `<reference path>` directives
2018-04-20 13:43:09 -07:00
Wesley Wigham 238ed7a94c
Visit EOF to collect jsdoc import types (#23521)
* Visit EOF to collect jsdoc import types

* Add flag to prevent jsdoc import types from influencing compilation set
2018-04-18 19:52:34 -04:00
Armando Aguirre 9923003ee6 Merge branch 'master' into AddVueSupport 2018-04-16 13:45:34 -07:00
Sheetal Nandi ce08af4dfe Merge branch 'master' into requireJson 2018-04-13 15:26:16 -07:00
Ryan Cavanaugh df95de3231 Merge branch 'master' into referencesDogfood_1 2018-04-11 16:17:38 -07:00
Ryan Cavanaugh 8294259ec2 Remove all reference comments from compiler/ 2018-04-11 15:38:26 -07:00
Andy a004571d3e
Update outdated comments (#23320) 2018-04-11 07:56:42 -07:00
Daniel Rosenwasser 9e2bbb6f8a Basic parsing/emitting support for 'import.meta'. 2018-04-10 12:55:43 -07:00
Armando Aguirre 50eb512566 Added deferred ScriptKind and renamed JsFileExtensionInfo to FileExtensionInfo 2018-04-05 17:30:04 -07:00
Sheetal Nandi a14396320b Resolve json modules only when --resolveJsonModule is specified 2018-04-05 15:37:13 -07:00
Sheetal Nandi 9f724156be Merge branch 'master' into requireJson 2018-04-05 15:18:21 -07:00
Mohamed Hegazy e6fa4e4415
Merge pull request #23043 from alan-agius4/feature/compiler-host-falsy-file
fix: `CompilerHost.getSourceFile` is being called for odd filenames
2018-04-02 17:08:31 -07:00
Alan Agius 7e482b27fb fix: CompilerHost.getSourceFile is being called for odd filenames besides the one being compiled
Ignore falsy file names from `getDefaultLibraryFileName`

Closes: #13629
2018-04-02 20:58:37 +02: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 5cef6274c3
Remove duplicate helper function (#23001) 2018-03-29 15:43:31 -07:00
Sheetal Nandi a0fe072fa7
Merge pull request #22613 from Microsoft/configFileErrors
Make config file parsing errors available through program and expose API
2018-03-29 13:08:03 -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
Wesley Wigham a909000b62
Parse and check type arguments on JSX opening and self-closing tags (#22415)
* Parse and check type arguments on JSX opening like elements

* Fix nits
2018-03-22 15:07:36 -07:00
Sheetal Nandi b4e0062b41 Merge branch 'master' into requireJson 2018-03-16 14:46:34 -07:00
Andy 28ff6b6ef3
Store import nodes in SourceFile.imports instead of StringLiteral nodes (#22495)
* Store import nodes in SourceFile.imports instead of StringLiteral nodes

* Change SourceFile#imports storage back

* Code review

* StringLiteral -> StringLiteralLike
2018-03-16 14:01:00 -07:00
Sheetal Nandi 7329eb1ab1 Make sure config file parsing errors are available through program
Fixes #22570, #21940
2018-03-15 14:58:50 -07:00
Sheetal Nandi 2d9af0b95c Merge branch 'master' into requireJson 2018-03-09 16:51:05 -08:00
Martyn Janes bcf6e342f1 Fix typo in emitDeclarationOnly error message for declaration required 2018-03-09 22:37:10 +03:00
Sheetal Nandi 2071466420 Merge branch 'master' into requireJson 2018-03-08 13:24:59 -08:00
Andy fa4619c5c1
Add 'info' diagnostics (#22204)
* Add 'info' diagnostics

* Code review
2018-02-28 11:16:32 -08:00
Sheetal Nandi 4257c2fa04 Resolve the .json file only if module name contains the extension 2018-02-23 17:27:17 -08:00
Sheetal Nandi a790a92f7d Parse all json values at root 2018-02-23 14:00:30 -08:00
Sheetal Nandi ca590d6fed Need allowJs to be true to use the json module resolution 2018-02-23 14:00:23 -08:00
Sheetal Nandi ee2e267d38 Replace usage of jsonObject on JsonSourceFile 2018-02-23 13:59:47 -08:00
Sheetal Nandi 5771adbbe7 Resolve Json file when module resolution strategy is node 2018-02-23 13:54:39 -08:00
Alex Eagle 2e66e74e14 fix --pretty output when context is multi-line
Fixes #22097
2018-02-22 22:56:00 -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