-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to always show word based suggestions #21611
Comments
After looking into this, I don't think JavaScript has word based suggestions in your example either. The result you see in the js case is actually a suggestion entry returned by TypeScript, not one provided by VSCode's word based suggestions. The root cause: the word based suggestion completion item provider is less specific than the JS and TS completion item providers. Our suggest logic only looks at the most specific completion provider that return a valid result: /~https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/suggest/common/suggest.ts#L66 This suggest logic is not specific to JavaScript or TypeScript and I can trigger the same sort of behavior in languages like python as well. @jrieken and @alexandrudima: Is the lack of word based suggestions when a more specific suggestion provided returns results the designed behavior? I could see word based suggestions cluttering up the list in most cases where a language suggestion provider exists, but wanted to confirm that the current behavior is as-designed |
Interesting, thanks for investigating. In my case the most specific provider returns no results, so in this case at least it should fallback to the word based provider? |
Yes, but this is a good sample of it going wrong. The idea is that each provider gets a score based on its language selector, in short a full selector like This works well for cases like word-based suggestions in comments or when typing the name of a declaration because TS usually doesn't return anything then. The problem with the sample above is that TypeScript returns many suggestions after Not yet sure what to do here... |
Why don't you keep asking the word-based provider to complete the list of suggestions? The 'smart' provider is not always so smart, and word-based suggestions are enough most of the time. In this case there would still be some word-based suggestions even if the smart provider does not give any. Just the same way you always add the snippets provider: /~https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/suggest/common/suggest.ts#L52 This seems to affect every suggestion provider, not only TS/JS: timmhirsens/vscode-elixir#56 |
It would result in many duplicates |
I suggest to add option for allow word-based with compiler provider it's possible to enable this at this moment only to modify find |
I have the same problem in my extension plsql. |
Just wanted to comment to say that justnonamenoname's solution worked for me. I was able to make that change to the core code and it is now working perfectly for PHP files, etc. I am now trying to figure out how to make this adjustment permanently until it gets fixed in the core base. |
As an extension writer I would very much like to be able to fallback to word based suggestions. It is going to take me a long time to be able to provide full smart completion, so it would be nice to be able to supplement the word based completion, not replace it. |
You can do that, simply return |
Thanks for your answers. |
It should be possible to specify when returning in |
It would be great if an extension could get the default word-based suggestion list and filter/modify it. |
I would also greatly appreciate if this could be implemented somehow. I haven't looked at the code, but wouldn't it be possible to either filter out duplicates in the suggestion list before presenting it to the user or not add a new entry if it's already in the list? I find myself wanting to autocomplete function and variable names from the code I'm working on more often than those in the language itself, but I still want to use language extensions for syntax highlighting, etc., so I would even be happy with an option to toggle an extension's autocomplete off altogether and just use word suggestions. |
TabNine can also provide alphabet result ( it can provide strings based on what you have in your workspace), but it also suffered from this bug: I think the reason behind this issue and that bug is the same, somehow extensions registered provider be overwritten by some other extension's registered provider. SO this is a bug in VSCode. |
This comment has been minimized.
This comment has been minimized.
If this issue be fixed,js project completion experience will be improved greatly. |
This issue is not exclusive to js/ts, right? I do have the same issue with the C++ auto-completion. Sometimes semantic auto-completion takes quite a bit of time in larger C++ code-bases. Most of the time, I'd be happy with just word-based completion. However, like this issue points out, they don't seem to be merged into the same suggestion list. |
This comment was marked as spam.
This comment was marked as spam.
Thanks, after all I can do my own document filtering. |
My usecase for always wanting word-based completion: when writing code, I'll reference functions that don't exist, but which I am going to define later. When I do this, I need to type the function name twice, or copy and paste it. It would be great if I could auto-complete it! def some_complex_function(x):
tmp = some_utility_function(x)
# ...other stuff...
def some_ut # it would be cool if this would autocomplete to `some_utility_function` |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Don't wait. Folks are still in VisualBasic IDE mode. |
Steps to Reproduce:
fooBarBaz
fooBa
Expected result: word based quick suggestions should show.
Actual result: no quick suggestions. Ctrl+space shows a popup with content 'No suggestions'.
Try the same in a JavaScript file and it works.
I would like IntelliSense and word based suggestions for my TypeScript.
The text was updated successfully, but these errors were encountered: