1

I'm trying to prioritize path intellisense over my user snippets, or just group them with other non-user snippets really. The current behaviour is user snippets -> paths -> other snippets as seen in the screenshot:

enter image description here

I need to navigate paths I don't know the structure but each level I have to scroll down to the suggestion and it's very annoying. I have disabled some snippets, but it's still annoying and it's not worth to turn off custom snippets just because of this.

Some settings I tried are "editor.snippetSuggestions": "inline" and "editor.quickSuggestions": { "strings": false" }. Also tried most popular path autcomplete extensions.

Am I the only one annoyed by this? Is this the default behaviour or did I messed up my config? Thanks in advance.

Sagyo
  • 23
  • 3
  • You might get better behaviour if you use `./css' in the path. So start with a `./` it seems better to me. – Mark Feb 24 '22 at 16:02
  • @Mark just tried it but I'm still getting the same behaviour. It works for the first directory, but as soon as I accept the suggestion the next list includes the snippets. Thanks for the suggestion. – Sagyo Feb 24 '22 at 16:11
  • I'm suffering from the same problem did you find any solution to this? – Flamingo Aug 23 '23 at 19:22
  • @Flamingo not really, this happens to me on HTML files (like in ). In Vue or React I need to install [Path Intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense) extension which kind of has the same issue inside HTML attributes. In other languages or outside the templates it works alright. – Sagyo Aug 24 '23 at 21:07
  • Just tried [Path Autocomplete](https://marketplace.visualstudio.com/items?itemName=ionutvmi.path-autocomplete) extension and works properly until you lose focus on the suggestions or enter an invalid path then it has the same issues. – Sagyo Aug 24 '23 at 21:16

1 Answers1

0

For HTML

I have managed to find three workarounds for this issue:

  1. One option is to utilize the down arrow on the keyboard to navigate from the end of the snippet list. In the provided example, the last snippet is the path autocomplete suggestion, see it in action :

https://i.imgur.com/9s6rhCf.gif

  1. Another method involves deleting the slash using the backspace key and then typing it again.

enter image description here

  1. A third approach is to simply type a second slash after the initial one.

enter image description here

For JavaScript/TypeScript

For other languages like JavaScript or TypeScript, I use the path-intellisense extension (extension ID: christian-kohler.path-intellisense) with the following settings in the user JSON configuration:

"typescript.suggest.paths": false,
"javascript.suggest.paths": false,
"path-intellisense.autoTriggerNextSuggestion": false,
"path-intellisense.autoSlashAfterDirectory": false,
"path-intellisense.absolutePathToWorkspace": true

By adjusting these settings, I ensure that the extension is used instead of the default path autocomplete feature in Visual Studio Code for JavaScript and TypeScript.

The autoSlashAfterDirectory setting prevents automatic addition of a slash after a directory, and autoTriggerNextSuggestion ensures that the suggestion widget doesn't appear automatically until a slash is entered manually from the keyboard.

This configuration produces the desired result, as demonstrated here :

enter image description here

Flamingo
  • 322
  • 1
  • 11