Feature: Autocomplete sort by scope #168
Replies: 4 comments
-
@Krzysztof-Cieslak to me this one is the most useful out of the ones I created, happy to help work on it as well if you believe it's possible to implement it with the current tooling. |
Beta Was this translation helpful? Give feedback.
-
@kontomondo, I will generally response here to all suggestion, and go into details for each later. First of all, thanks for all suggestions. Really love them. For autocomplete suggestions, unfortunately, I'm not sure if we can realistically implement any of it - for multiple reasons (lack of features FCS, potential performance problems, limiting VSCode API). I'll try to go over all suggestions and check what are potential road blocks for them (or maybe I'll find some which can be implemented). But it can take some time (couple of days) before I have time to look deeper into it. For #170 and #169. I think those are possible to implement (would probably require adding some additional commands to FsAutoComplete, but we can easily do this). Would probably not use Tab as key shortcut triggering it but something else (maybe ctrl + tab, or something). They could also be implemented as |
Beta Was this translation helpful? Give feedback.
-
@Krzysztof-Cieslak Thanks! As I mentioned I'll gladly help out where I can. Perhaps someone from the F# team can help us out with FCS. Maybe we could create an issue https://github.com/fsharp/FSharp.Compiler.Service/issues for them to advise us on these things? |
Beta Was this translation helpful? Give feedback.
-
This feature requires a change to FCS, the symbol based completion function in FCS currently orders in a fixed manner I think there are several sorts and removal of several constructs, it should be possible to add a new function that specifies some form of ordering preference, alternatively you can reorder the returned list inside FSAC. This is the method that was used in MonoDevelop/VS4Mac where ordering is based on depth of inheritance, which is quite useful at times(Most specific type overloads shown first with a category showing the type they are from etc) |
Beta Was this translation helpful? Give feedback.
-
Would be nice if the autocomplete list when autocompleting on local scope (and not on foreign modules and/or class members) would be sorted by the scope. At the top would be values/variables/methods from the current scope, then followed by outer, then the outer of that, etc.
This way the completion data becomes immediately relevant to the data in the current function/type/module/etc.
Example:
Invoking autocomplete at the cursor would present the following autocomplete list (separating the data in the scopes from "general one"):
innerValue
input
someValue
removeStopWords
process
outerValue
outer
abs
abstract
AbstractClassAttribute
...
Note that technically for the case where no text has been typed (ie. invoking auto-complete on a blank space) one wouldn't even need the "general" list (abs, abstract, etc.) at all, as it's too long anyway to be useful.
Beta Was this translation helpful? Give feedback.
All reactions