Code Monkey home page Code Monkey logo

Comments (9)

DanTup avatar DanTup commented on June 7, 2024 1

@sethladd It really needs support from the Analyzer, I was unable to do it myself. If it gets added, I'll implement it pretty quick; it's my biggest annoyance writing Dart (esp. as I don't know the APIs at all compared to others!).

from dart-code.

DanTup avatar DanTup commented on June 7, 2024

This isn't possible without a new feature in the Analyzer:

https://groups.google.com/a/dartlang.org/forum/#!topic/analyzer-discuss/Abh1vi1CwDA

from dart-code.

DanTup avatar DanTup commented on June 7, 2024

@devoncarew Do you have this functionality in Atom? If so, how to do you do it?

This is the biggest remaining annoyance for me when trying to write Dart in Dart Code. I've been trying to use Hovers to get the info but failing (it's hard to know where to issue the Hover command without understanding the surrounding Dart).

from dart-code.

devoncarew avatar devoncarew commented on June 7, 2024

We don't support something like this. I don't know what the best options are. I think it would be a while until support for this comes to the analysis server. Two practical solutions might be to live w/o it, or to see if a heuristic w/ hovers can return info for many simple cases?

from dart-code.

DanTup avatar DanTup commented on June 7, 2024

I've started trying to use hover, but held off putting too much time into it without knowing if it'd be done in the analysis server. Brian confirmed it's likely to be a while, so I'll get back to it. I think the complications are:

  1. The hover info is unstructured (just a string for all params)
  2. Need to know where to send the hover request for

I think 1 will be easy to handle except in the case where there are arguments that are themselves functions. I think 2 is probably just a case of walking back to the first paren that has an alphanumeric before it (need to check if whitespace is allowed there).

The idea of forking the AS and building our own snapshot crossed my mind too, but I've not looked at the code at all to see how easily I could implement it myself using the existing stuff on the server side. Probably would be hard for me, but always an option.

I'll play with the easier options first anyway and see where I get. Now we have args in the completion info it's a little better than it was; but I'll have to sit down to try and write something to get a better idea of how much I'll miss this.

from dart-code.

DanTup avatar DanTup commented on June 7, 2024

Haven't gotten anywhere trying to use the hover stuff yet (figuring out the correct offset to send is non-trivial), so bumping this to 0.11.

from dart-code.

DanTup avatar DanTup commented on June 7, 2024

I did have a go at this, but the problem is figuring out where to send the getHover request for, eg.:

myFunc((1 * 2), (fr|ed));

If the cursor is at | we need to know to send the getHover for myFunc.

from dart-code.

DanTup avatar DanTup commented on June 7, 2024

This is the related SDK case:

dart-lang/sdk#27034

from dart-code.

sethladd avatar sethladd commented on June 7, 2024

Would love to see this. It really helps exploring and using the APIs if I know what to pass into a method :) Thanks for helping make it happen!

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.