28 Commits

Author SHA1 Message Date
Ron Buckton
611b77f2e6 Migrate more places to use Map/Set 2020-06-26 10:15:53 -07:00
Sheetal Nandi
f0da6d1203
Some changes to tsc baselines for clarity (#38850)
* Baseline programs in tsc -b and tsc -incremental mode as well

* Refactor outFile

* Tests

* Distinct input and output

* Add helper to baseline serialized invocations of tsc on incremental edits

* Input and output in watch mode

* Update src/testRunner/unittests/tsbuild/helpers.ts

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
2020-06-02 11:49:21 -07:00
Sheetal Nandi
502e711235
Dont use sourcemap if it contains inlined sources (#36384)
Fixes #35014
2020-01-29 11:21:42 -08:00
Sheetal Nandi
f7ea0bab60 Refactoring 2019-07-01 14:33:39 -07:00
Sheetal Nandi
da9260c013 Create original project when location is in source of project reference redirect 2019-06-27 10:38:52 -07:00
Sheetal Nandi
012ecdacde Add sourceOf project reference redirect to filesByName list for redirect path so that module symbol is correctly resolved 2019-06-26 14:56:21 -07:00
Sheetal Nandi
3dc0d5a77c Watch missing map file and update the source mapping accordingly 2018-12-06 15:22:44 -08:00
Sheetal Nandi
d0976509c9 Add tests and fix DocumentPositionMapper creation on updates to d.ts, source file, map file etc 2018-12-06 15:22:43 -08:00
Sheetal Nandi
0113f43632 Fix the edits clamping from #28583 after rebasing to master 2018-12-06 15:22:43 -08:00
Sheetal Nandi
56a39b754c Keep alive declaration script info and map file info if source file info is alive 2018-12-06 15:22:42 -08:00
Sheetal Nandi
afdf1e90ec Dont depend on project in document position mapper so that we can unload or remove projects independently 2018-12-06 15:22:40 -08:00
Sheetal Nandi
12428d45c0 Add method on host to get DocumentPositionMapper so it can be cached. 2018-12-06 15:22:39 -08:00
Sheetal Nandi
0dad79e8b3 Handle source and generated files more gracefully 2018-12-06 15:22:38 -08:00
Sheetal Nandi
1db8bb062c Use file names instead of paths for reading files 2018-12-06 15:22:38 -08:00
Sheetal Nandi
0a8c47bd45 Refactoring to createSourceMapperHost 2018-12-06 15:22:38 -08:00
Sheetal Nandi
86857d5b09 Use program directly to get the sourceFile of source position 2018-12-06 15:22:38 -08:00
Sheetal Nandi
c65e43e85e Do not close over program in getSourceFileLike 2018-12-06 15:22:37 -08:00
Ron Buckton
151dc074a8 Merge branch 'master' into sourceMapGenerator 2018-11-09 11:50:51 -08:00
Sheetal Nandi
ab4be8da42 Fix the issue with file being included in the referencing project on rename when it wasnt included earlier
Fixes #28307
2018-11-07 11:30:39 -08:00
Sheetal Nandi
efe5dd6b6d Handle case sensitivity correctly in source map decoder 2018-10-31 15:14:08 -07:00
Ron Buckton
b006287cb1 Refactor and clean up sourcemap decoder 2018-09-04 17:50:06 -07:00
Ron Buckton
173b5dfcfb Refactor sourcemap emitter 2018-08-22 12:42:36 -07:00
Andy
93722c8942
findAllReferences/rename: Search in all open projects (#25648)
* findAllReferences/rename: Search in all open projects

* Avoid needing a dummy location when location is unused

* Remove Program#getDeclarationEmitPath

* Only iterate over enabled projects
2018-07-20 16:53:59 -07:00
Andy
64555aa6a9
navigateTo: Collect results from all referenced projects. (#25283)
* navigateTo: Collect results from all referenced projects.

* Don't use project references, just source maps

* Move more code to session

* Test when implementation file is deleted

* Use tsserver tests instead of fourslash tests to ensure session is used

* Support find-all-references

* Restore fourslash tests

* Update emit baselines (added missing newline)

* Support rename

* @weswigham code review

* Don't open/close files

* Avoid growing `toDo` too eagerly

* @sheetalkamat code review

* Also get symlinked projects for originalLocation

* Update API (#24966)

* More @sheetalkamat code review

* Remove unnecessary test

* Update API (#24966)
2018-07-05 15:39:03 -07:00
Wesley Wigham
2a1503610b
Stop generating sectional sourcemaps (#24917)
* Generate normal 1-part sourcemaps (at increased processing cost), since tools dislike sectional ones

* Add semicolon

* Accept sad baselines]

* Forward along sourcesContent if available

* Supress lint since the API actually calls for null here

* Fix concatenated sourcemap paths

* Accept bad baselines :(

* Add overloads

* Accept api update

* Fix lint
2018-06-13 18:52:23 -07:00
Wesley Wigham
212cd9b218
Use correct search order for position location (#24886) 2018-06-11 17:12:06 -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
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