If you could make any changes to D, what would they look like?
Paul Backus
snarwin at gmail.com
Sun Oct 24 20:04:05 UTC 2021
On Sunday, 24 October 2021 at 19:47:10 UTC, Basile B. wrote:
> I believe it's partly a problem of lazyness, e.g "I want to
> type less. I want to be proposed `filter` when I CTRL+SPACE
> after `arr.fi` ".
>
> That case can be solved by doing a word split on the current
> document and by adding the results to the "good" completions
> when they are requested. If you have selective imports at the
> top of the module, for filter, map, each etc. then they are
> proposed as well.
Yeah, this is basically how Vim's built-in completion works. I
sometimes use it to save typing on long identifiers, or to avoid
spelling mistakes. But if I have to fall back to typing something
out manually, it's not that big of a deal.
Maybe it's programmers who [can't touch-type][1] who rely heavily
on tooling support? I know if I had to hunt-and-peck every letter
of an identifier like `formattedWrite`, I'd be a lot more
motivated to use code completion everywhere I could.
[1]:
https://steve-yegge.blogspot.com/2008/09/programmings-dirtiest-little-secret.html
> The other part of the problem is that completion can be used to
> overcome the lack of knowledge of an API, for example. In this
> case the word split does not help.
Yeah, in that situation having an easy way to view the docs is
really helpful. I have a shortcut set up in Vim that opens the
[dpldocs.info][2] search page with the identifier under the
cursor, which works pretty well for the standard library and ok
for dub packages, but a language server could probably do a
better job.
[2]: http://dpldocs.info/
More information about the Digitalmars-d
mailing list