Code Monkey home page Code Monkey logo

Comments (3)

lgrammel avatar lgrammel commented on June 21, 2024 1

I agree - the perfect activation ranges are still an open question to me. There is a tradeoff between the activation ranges not being available where you'd want/expect them, and refactorings showing up when they are clearly not intended at that position.

Currently the default is the full AST match, but that quickly gets tricky in particular for nested functions. However, for e.g. the "move intialization" refactoring, when there are constants on the right hand side (e.g. "some value"), then activating on them might be nice, but it could lead to UX inconsistencies which can be confusing.

I think it'll come down to a lot of experimentation and refinement before I can generalize, but maybe there is some general good way to do this that I just don't see yet.

For this particular case here, I ended up changing the activation range to the left hand side, the = and the first 3 characters of the right hand side, so it's readily availalbe but not showing in unwanted places.

v1.111.2 with the change should be available soon :) Thanks again

from js-assistant.

lgrammel avatar lgrammel commented on June 21, 2024

Thanks for reporting! I'll probably keep the activation on the left side of the expression as well (= might be too small), so you could activate the refactoring on public readonly aField = , but not on the right hand side. Would that work for you?

from js-assistant.

hediet avatar hediet commented on June 21, 2024

Yep, left side and = is also good!

Generally, you probably just shouldn't report refactorings for the parent in arbitrary nested expressions or statements.

from js-assistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.