Code Monkey home page Code Monkey logo

Comments (7)

DanTup avatar DanTup commented on September 27, 2024

I don't think we have many good options here. While we could add a general VS Code setting, it would be inconvenient to have to toggle it to change between these modes. We also don't have any control over the sort once you start typing (because VS Code takes over), and the initial list is ranked based on some heuristics (it's not clear that declared members are always the most likely choices).

I'm curious about exactly what the goal is - you said you "want to find out possible symbols on a member" but for what reason? Are you planning on using the code, or are you using the completion just to try and discover more about the class? If the latter, would something like the Outline or Breadcrumb be more useful for viewing the declared members?

from dart-code.

Number-3434 avatar Number-3434 commented on September 27, 2024

Basically, I've created a class that extends GetxController.

I have created two methods on that class, but I keep forgetting their names.

I expose an instance of that class (using singleton pattern) through GetX

If I use the suggest widget to try and find their names (which is easier than manually navigating to the source code), I get a lot of other suggestions (such as all the methods inherited from GetxController, extensions), and it is actually very hard to find the methods I actually declared.

from dart-code.

DanTup avatar DanTup commented on September 27, 2024

Thanks for the info. I think having a setting for this wouldn't work very well because it would be more effort to turn the setting on (and back off later) than navigating to the class. Out of interest, are these extra methods from GetxController things that you never want to see?

I ask because I wonder if extension types might be a good fit for this. My understanding is that you could create your own type that extends GetxController that exposes only the methods you want, and it just compiles away so there is no overhead (as there would be if you wrapped the controller with a real class).

(Edit: To be clear, Extension Types isn't stable yet, but I think it's coming in a future SDK release)

from dart-code.

Number-3434 avatar Number-3434 commented on September 27, 2024

No, I just want them grouped.

For example, all word-based suggestions are at the bottom, which is useful since you know that once you see word-based suggestions, you're at the end, and there are no more semantic suggestions.

It would be a nice feature if VSCode supported grouping in the suggest widget.

It could then indicate that some suggestions are inside a particular group, (e.g. declared), others (e.g. inherited or extensions).

In that case, declared groups would be sorted first, then inherited, then extensions.

from dart-code.

Number-3434 avatar Number-3434 commented on September 27, 2024

VSCode has Intellicode, which provides star completions that are in a custom order at the top.

Could this somehow be replicated to produce a similar effect with declared at the top, then inherited, the extensions?

from dart-code.

DanTup avatar DanTup commented on September 27, 2024

Unfortunately don't have control over the UI so we can't provide any groupings. We also can't control the ordering except for when there is no prefix typed (as soon as you type a character, VS Code re-ranks itself).

While we can set the ordering when there is no prefix typed, the goal is for the most likely items to be at the top (for example taking into account things like types) and I don't think pushing the declared items to the top would be the best experience. It works for Intellicode because those items are the ones it thinks are most likely to be used.

from dart-code.

Number-3434 avatar Number-3434 commented on September 27, 2024

@DanTup

We also can't control the ordering except for when there is no prefix typed

Well, that doesn't actually bother me.

I actually do prefer the current sorting strategy for empty suggests.

Basically, this only applies when there is an instance / type followed by a trailing member access operator (.).

For example:

// VALID (applies to these if suggest is triggered at the end of the line)
someInstance.
SomeType.
int.
someInstance.thing.
someEnum.

// INVALID (does not apply to any of these)
SomeType
int
someInstance.thing

All I need is for the suggestions to be at the top when I type ., since I can't actually remember the method I'm looking for.

I would therefore prefer it being sorted when there is no prefix typed (i.e. just someClass. instead of someClass.a), as that is my most usual use case, as I often use that to try and find possible symbols.

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.