TypeScript/tests/cases/compiler/declarationMapsOutFile.ts
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

22 lines
405 B
TypeScript

// @declaration: true
// @declarationMap: true
// @module: amd
// @outFile: bundle.js
// @filename: a.ts
export class Foo {
doThing(x: {a: number}) {
return {b: x.a};
}
static make() {
return new Foo();
}
}
// @filename: index.ts
import {Foo} from "./a";
const c = new Foo();
c.doThing({a: 42});
export let x = c.doThing({a: 12});
export { c, Foo };