Made some adjustments to source maps#466
Merged
Perryvw merged 3 commits intosource-mapsfrom Mar 6, 2019
Merged
Conversation
lolleko
reviewed
Mar 3, 2019
src/LuaAST.ts
Outdated
| export interface Node { | ||
| kind: SyntaxKind; | ||
| parent?: Node; | ||
| tsOriginal?: ts.Node; |
Member
There was a problem hiding this comment.
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) { |
Member
There was a problem hiding this comment.
I had a TODO in the original PR. it should be investigated why node.tsOriginal.getSourceFile() can return undefined instead of catching that case.
Member
Author
There was a problem hiding this comment.
From what I could see working on this, it is probably because we create some ts nodes ourself in the transformer.
lolleko
approved these changes
Mar 6, 2019
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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