autocomplete-paths
autocomplete-paths copied to clipboard
Allow completions for arbitrary strings
There are many use cases where path completions are desired which are not in require/import statements, e.g.
@Component({
...
templateUrl: './please-complete-me.html',
})
Allowing completions in the above case and others would be very useful. Depending on the performance impact it could be enabled/disabled through an option.
That would mean that autocomplete-paths would trigger every time you create a string, which would be very annoying. We would need more specific rules for this.
Happy to hear your thoughts and merge a PR that provides this feature
I was thinking closer to VSCode's behavior, which starts path completion when there is a slash, instead of on an empty string.
You are right that triggering on any string would be annoying, so perhaps the above approach would make more sense, as it would be much more likely the user wants path completion when typing './
or '/
As for me, I would like to have a functionality to manually open autosuggestions by hotkey.
Autosuggestion by hotkey makes more sense imho, because you don't always want suggestions when typing /
or ./
. Not sure if this is possible though - would have to investigate.
@joefitzgerald Is it possible to only provide suggestions when a hotkey is pressed? How would one go about implementing this?
Forgive me if I'm wrong, but wasn't that the previous behavior? I would love for a toggle to reenable that.
Edit: "that" meaning enabling the autocompletion when the string looks like a path (ie /
or ./
)
Correct, that was the previous behavior. autocomplete-paths 2.0 is a complete rewrite though, so simply re-enabling it doesn't work.
I didn't mean simply re-enabling it, I just meant I like the behavior and would like if it were possible again rather than using a hotkey.
But I think I'll use a fork of 1.0 of this package in addition to the current version of this one, so that I can use this package which is undoubtedly better in a scope but occasionally also autocomplete arbitrary paths.
Thanks!
If the auto-completion only triggers when typing /
inside a quoted string, I think it would be acceptable. autocomplete-plus
has a selector
option which might help with implementing this. It probably shouldn't be used width the prefixes though.