Skip to content

Made some adjustments to source maps#466

Merged
Perryvw merged 3 commits intosource-mapsfrom
source-map-adjustments
Mar 6, 2019
Merged

Made some adjustments to source maps#466
Perryvw merged 3 commits intosource-mapsfrom
source-map-adjustments

Conversation

@Perryvw
Copy link
Copy Markdown
Member

@Perryvw Perryvw commented Mar 2, 2019

Adjusted the branch with the suggestions I put on your PR, plus a bunch of extra fixes that make source maps a bit more functional :D

@Perryvw Perryvw requested a review from lolleko March 2, 2019 21:18
src/LuaAST.ts Outdated
export interface Node {
kind: SyntaxKind;
parent?: Node;
tsOriginal?: ts.Node;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already discussed this with @tomblind a while ago. I think it is better not to keep TS types in the AST, at least from a design point of view.

src/LuaAST.ts Outdated
node = node.parent;
}

if (node.tsOriginal !== undefined && node.tsOriginal.getSourceFile() !== undefined && node.tsOriginal.pos >= 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a TODO in the original PR. it should be investigated why node.tsOriginal.getSourceFile() can return undefined instead of catching that case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I could see working on this, it is probably because we create some ts nodes ourself in the transformer.

@lolleko lolleko self-requested a review March 6, 2019 10:52
@Perryvw Perryvw merged commit 7e918f6 into source-maps Mar 6, 2019
@Perryvw Perryvw deleted the source-map-adjustments branch March 6, 2019 10:58
Perryvw pushed a commit that referenced this pull request Apr 2, 2019
* Added initial support for sourcemaps

* Made some adjustments to source maps (#466)

* Made some adjustments to source maps

* Fixed tests

* Removed tsOriginal field from AST nodes

* Fixed package issues

* Inline source maps

* Added sourcemap lualib function

* Added override for traceback (#490)

* Added override for traceback

* Improved sourcemap override

* Removed obsolete argument

* put traceback override at start of the file after headers

* changed 2 underscore identifiers

* Added test for sourceMapTraceback

* don't enforce prettier linting

* use debug.getinfo for file names

* Trying to diagnose test issue

* No longer check filename in sourcemap test

* Another stab at fixing tests

* Added sourcemap test, simplified API

* Added back dependency that got lost in the merge

* Fix prettier complaining

* Made appveyor lint

* Fixed bug in setNodeOriginal and added test to detect it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants