Comments (4)
Not sure if this is relevant, but we might need to make PiranhaJS aware of variable scope here. Without this, the following code
{ var featureFlag = "feature1-flag"; } // scope 1
// ...
{ var featureFlag = "feature2-flag"; } // scope 2
will be refactored incorrectly when cleaning up one of the flags. For example, when cleaning up "feature1-flag"
, featureFlag
will be replaced by "feature1-flag"
everywhere.
from piranha.
Not sure if this is relevant, but we might need to make PiranhaJS aware of variable scope here.
Good point... this is some of the magic I hand-waved away 😄
from piranha.
The escope library can be helpful for variable scopes:
https://github.com/estools/escope
from piranha.
@atrakh we can now perform this kind of cleanup in polyglot piranha.
However, on-boarding JS of Polyglot Piranha is pending.
I am closing this issue for now, since polyglot piranha allows developers to support for such cleanups.
Feel free to reopen this issue if you have further questions.
from piranha.
Related Issues (20)
- Enum scope not supported in Kotlin or Java
- Report error diagnosis for not parseable tree-sitter queries
- Cannot create dummy rule from python api
- [bug] [PiranhaAgent] error thrown after applying the inferred rule to the sample before/after snippet in the doc HOT 3
- [PiranhaAgent] support for TS HOT 3
- PiranhaObjC : Can I use it in the enable modules project ? HOT 4
- Facing issue while creating binary for polygot piranha HOT 1
- Too many logs
- Make concrete syntax agnostic to trailing commas
- can we add string with double quotes in treated function HOT 6
- Do you have any plans to support OpenFeature?
- Is there anyway to add the multiple flag names in pom.xml compilerArgs HOT 1
- [WIP] Proper grammar for concrete syntax
- Test
- [PiranhaJS] Proposals for Enhancing PiranhaJS: Tree Sitter Integration, Support for Stage 2 Proposals, and Class Variable Cleanup HOT 2
- delete_all_statements_after_return isn't cleaning up multiple lines after return HOT 3
- PiranhaConfigurationException: Piranha:FlagName is missing HOT 1
- [Kotlin] Returning a lambda with multiline code creates syntax errors HOT 7
- Various styles of flag definitions
- Treatment of enum based feature flags HOT 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 piranha.