mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 17:27:54 -05:00
Add support for external file references in source maps
This commit is contained in:
@@ -732,6 +732,15 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
class SourceMapSourceObject implements SourceMapSource {
|
||||
lineMap: number[];
|
||||
constructor (public fileName: string, public text: string, public skipTrivia?: (pos: number) => number) {}
|
||||
|
||||
public getLineAndCharacterOfPosition(pos: number): LineAndCharacter {
|
||||
return ts.getLineAndCharacterOfPosition(this, pos);
|
||||
}
|
||||
}
|
||||
|
||||
function getServicesObjectAllocator(): ObjectAllocator {
|
||||
return {
|
||||
getNodeConstructor: () => NodeObject,
|
||||
@@ -742,6 +751,7 @@ namespace ts {
|
||||
getSymbolConstructor: () => SymbolObject,
|
||||
getTypeConstructor: () => TypeObject,
|
||||
getSignatureConstructor: () => SignatureObject,
|
||||
getSourceMapSourceConstructor: () => SourceMapSourceObject,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,10 @@ namespace ts {
|
||||
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
||||
}
|
||||
|
||||
export interface SourceMapSource {
|
||||
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an immutable snapshot of a script at a specified time.Once acquired, the
|
||||
* snapshot is observably immutable. i.e. the same calls with the same parameters will return
|
||||
|
||||
Reference in New Issue
Block a user