Comments (2)
The problem here is the variable t
you have.
Your input looks like this:
String test() {
return '''
_FutureBuilderError{
error: Instance of 'WhatIfGodSmokedCannabisError',
stackTrace:
123123
123123
}
'''.unindent();
}
so the result you get works as expected.
If you control the t
variable, try something like this:
String t = '123123\n123123'.indent(10).trim();
before passing it into your input string. The value is not necessarily 10
, so you might have to play around with it a little.
from indent.
Yes, you are right. But your soultion actually doesn't work since code indentation can change from time to time but it generally should not make me change code itself. Your solution assumes that I have to change code everytime I change formatting which is not good.
I assumed that it may be in the scope of this package to correctly determine and put right amount of indentation. I think that it would require some kind of placeholders like:
'''
_FutureBuilderError{
error: Instance of 'WhatIfGodSmokedCannabisError',
stackTrace:
?
}
'''.unindent([t]); // Replaces first ? in string prefixing it with right amount of spaces
from indent.
Related Issues (2)
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 indent.