Comments (1)
Now that we have NodePath
information for the .original
AST, the only place we use the .original.parentNode
property anymore is in the getIndent
function in
Line 108 in 9c025d4
I think we should be able to compute that indentation information in the LocationFixer
, and store it as .original.loc.indent
, similar to how we store .original.loc.lines
here:
Line 56 in 1ddd828
Since we only ever call getIndent
on original nodes, we should be able to replace getIndent(node)
with node.loc.indent
in the Patcher
code, and get rid of getIndent
once and for all.
cc @spicyj
from recast.
Related Issues (20)
- Cannot handle "SpreadElement" ? HOT 2
- `b.functionExpression.from(functionDeclaration)` is failing on Windows HOT 1
- Local identifier from an import specifier is ignored HOT 1
- `recast.print` modifies original source adding brackets around some statements HOT 2
- Original indentation gets lost when printing non-file node
- About the problem of using babel as a parser mentioned in the document
- Error: did not recognize object of type "TSInstantiationExpression" HOT 9
- Consider removing usage of Node.js builtins HOT 3
- Line breaks being swallowed when fed to prettier HOT 4
- Extra parens inserted around JSX after attributes are added HOT 12
- recast parse typescript Error HOT 2
- > ```TSX HOT 1
- Strange not not found error HOT 5
- Comments moved after recast print HOT 1
- Additional leading/trailing newline when printing constructed node with comment HOT 1
- TS `satisfies` operator can't be parsed HOT 2
- How to get the parent node?
- Feature request: option to pass our own ast-types fork to recast
- `Directive` has incorrect `end` value HOT 1
- babel parser cannot preserve formatting for parts in some case but Esprima does
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recast.