Comments (1)
To answer your question directly, you need to provide the SrcSpan
of the expression to attach the comment to. For two reasons,
- The only way to insert comments is by attaching them to something. (and placing them in the annotations map)
- The
SrcSpan
might not be the actual location of the expression, it is used as a key so we can continue to refer to the same expression as it moves around.
So saying that, it doesn't make sense to provide an operation which allows you to insert a comment at a specific location because at the transformation stage all that information is lost.
I will answer more about comments on the other issue you opened.
from apply-refact.
Related Issues (20)
- The suggestion "Avoid lambda" does not add parenthesis around code blocks when it should HOT 1
- Comments are sometimes not placed at the right position after refactoring
- Build failure on GHC 9.0.1 on macOS HOT 3
- Remove redundant parens in class constraint removes only ending one HOT 4
- Build failure on GHC 9.2 HOT 6
- Missing upper bounds on `ghc` on hackage HOT 4
- Unexpected replacement while mixed infix and parenthesis
- Refactoring of monadic code results in code that is parenthesized erroneously HOT 2
- Missing brackets when replacing flip(:)
- Fails to install on Mac M1
- Build failure on GHC 9.4 HOT 6
- Replacing return with pure unindents
- Apply-refact shouldn't hardcode `GHC.Paths.libdir` in `parseModuleWithArgs` HOT 1
- Migrate from `ghc-paths` to `hie-bios` for obtaining the libdir of ghc at run-time
- Comment is repeated. HOT 1
- when -> unless refactor drops parens HOT 1
- Allow apply refactorings to an already parsed module HOT 8
- Apply hint: use guards remove comments above HOT 1
- Apply hint: eta reduce breaks where block identation HOT 2
- Apply hint: redundant lambda breaks block identation HOT 10
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 apply-refact.