Giter Site home page Giter Site logo

Comments (3)

DanTup avatar DanTup commented on August 16, 2024 1

I expect that we're going to move away from the notion of "library augmentations" and use part files (in one form or another) instead. If that happens, then there won't be any notion of a library augmentation

Ah yes, good points. In that case, let's close this one as there's potentially nothing to do for library augmentations and no doubt there will be further discussions about navigation around macros in dart-lang/sdk#54742 when the details are clearer. Thanks!

from dart-code.

DanTup avatar DanTup commented on August 16, 2024

I expect it to be shown under the annotation.

I think there are two different (but related) things here.

The "Go to Augmentation" CodeLens we have today is to jump from a declaration to its augmentation. It doesn't know anything about macros, it's just a way to jump between a declaration and an augmentation (or from an augmentation back to the augmented declaration).

We do not currently support this on libraries, but for consistency we probably should on the library declaration:

[ Go to Augmentation ]
library;

But this leaves two questions:

  1. What should we do if there is no library keyword? Should we use put the CodeLens at offset 0 of the doc?
  2. Should we do this for all augmentations or only those implicitly imported by macros (eg. if a file already contains import augment 'main_augmentation.dart'; is the CodeLens a little redundant?).

(@bwilkerson any opinions on this? I feel like for consistency we should probably always have one if a library has an augmentation and use offset 0 if there's no library keyword?).

I think the request here also touches on something different though, which is about navigating from around a macro application annotation. We don't currently have anything for this. While in many cases the Go to Augmentation CodeLens will do just this, it's also possible it'll take you to an augmentation produced by a completely different macro because it's only looking at resulting declarations and not at the macro application that happened to be adjacent to the CodeLens in the editor.

I think we should have something here (and maybe dart-lang/sdk#54742 is a good place for discussion of ideas about it).

from dart-code.

bwilkerson avatar bwilkerson commented on August 16, 2024

We do not currently support this on libraries, but for consistency we probably should on the library declaration

I expect that we're going to move away from the notion of "library augmentations" and use part files (in one form or another) instead. If that happens, then there won't be any notion of a library augmentation, so this feature won't make sense. And given that specification is likely to move in that direction, I don't think it makes sense for us to implement a feature that will likely soon need to be removed.

I don't know what the final specification for macros will look like, but if it doesn't include explicit part directives for macro generated files, then I agree that we ought to look at ways to support navigating to the implicitly included files. But given that one of the proposals is to allow part files to include other parts (nesting arbitrarily deep), it isn't clear to me at this point what the navigation requirements will end up being.

from dart-code.

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.