Vscode: TS/JS Path Quick Suggestion IntelliSense Does Not Work Unless QuickSuggestions.strings is enabled

Created on 6 Apr 2017  路  17Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.11.0
  • OS Version: Windows 7

Steps to Reproduce:

  1. type import or require statement
  2. autocompletion works for keywords
  3. begin to type relative directory in quotes, but receive no suggestions
bug javascript typescript verified

Most helpful comment

@ZhangPuXi Can you try setting:

"editor.quickSuggestions": {
        "other": true,
        "comments": false,
        "strings": true
    }

I suspect the default "strings" setting may be disabling these automatic suggestions for ts/js imports

Can you also confirm that you can manually trigger suggestions and do see the file/directory completion items. ctrl+space is the normal keybinding but yours may be different. Look for what is bound to editor.action.triggerSuggest

All 17 comments

@Syllinger can you give us an example project that doesn't work for you. I just opened the vscode source workspace on Win7 and I get file path completion proposals:

screen shot 2017-04-05 at 4 45 58 pm

The problem persists across projects. It's as though path autocompletion in intellisense is disabled. Updated to the latest version, and it suddenly no longer works.

@Syllinger Could you attach a small sample project that reproduces the problem?

I have this same problem. Can you guys please fix this. This is a nightmare developing with a large Angular 2 project. This happened after the update when I open VSCode about an hour ago. Not sure how much more info I can contribute. What is said above pretty much nails the problem down.

This is happening on my MAC, not Windows.

screen shot 2017-04-05 at 7 20 40 pm

Thank you in advance.

I also met this problem, you can just create two js file named a and b, an in file a requires b, there is no tip.

I'm also unable to reproduce this in a simple project like @ZhangPuXi describes. Both import and require show completions for both files and directories

To help investigate, please:

  • Disable all extensions to make sure one of them is not causing problems. Just launch code with the --disable-extensions flag to do this
  • Share a small example project and your settings with us
  • Describe the repo steps and the expected behavior in detail, such as:

    hit ctrl+space in require('./|') inside of the file xyz.js and completions for abc.js and folder1 are shown

You can also try collecting the TSServer trace:

  1. Set "typescript.tsserver.trace": "verbose"
  2. Restart VSCode
  3. Try to trigger the completion
  4. Go to the output panel and share the output from the TypeScript section

Thanks

I have no extensions, and the ctrl+space is used by input method switch. In the last version, I don't need to hit ctrl+space, completions are shown automatically

@ZhangPuXi Can you try setting:

"editor.quickSuggestions": {
        "other": true,
        "comments": false,
        "strings": true
    }

I suspect the default "strings" setting may be disabling these automatic suggestions for ts/js imports

Can you also confirm that you can manually trigger suggestions and do see the file/directory completion items. ctrl+space is the normal keybinding but yours may be different. Look for what is bound to editor.action.triggerSuggest

Thanks for your time and patience, I have confirmed, I set the editor.action.triggerSuggest to Ctrl + T, it works, but the problem is even though I set the quickSuggestions as you said, the automatic suggestions doesn't work. Please help me the VSCode is my favorite editor. ^-^

The setting

{
  "other" : true,
  "comments" : false,
  "strings" : true
}

works well. Maybe you should modify the default value to this, thanks a lot.

@jrieken, let me know if you have any thoughts on enabling quick suggestions selectively for js/ts imports. Perhaps a special string token scope that does not get disabled with other strings?

I updated my settings and now it works. Thank you.

Thanks, setting "strings" in "editor.quickSuggestions" to true works. My question is: why did quick suggestions work before without that setting but not after this update?

@IRCraziestTaxi Before QuickSuggestions was a binary on/off setting. 1.11 allows finer grained control so that you can disable or enable them just in comment and strings. Since js import paths are just strings, the default setting will disable disable suggestions for these as well

@mjbvz: worked for me as well. Thank you!

I'm also experiencing this issue since April releases. I've changed the settings and "sort of" works. Autocompletion for paths now works when I type the first letter. However, the editor used to suggest possibilities as soon as I typed each forward slash "/". So I still need to go to the folder to see what the options are.

Any chance of getting the old behaviour back?

I got it back!!! I updated the Path Intellisense extension and it's now back to normal

Was this page helpful?
0 / 5 - 0 ratings