Skip to content
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

Word based suggestions not working in functions/quotes #139559

Closed
kanlukasz opened this issue Dec 21, 2021 · 12 comments
Closed

Word based suggestions not working in functions/quotes #139559

kanlukasz opened this issue Dec 21, 2021 · 12 comments
Assignees
Labels
snippets suggest IntelliSense, Auto Complete
Milestone

Comments

@kanlukasz
Copy link

Does this issue occur when all extensions are disabled?:
Yes

VS Code and OS Version:

Version: 1.63.2
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:40:02.816Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19044

Steps to Reproduce:
777

@jrieken
Copy link
Member

jrieken commented Jan 5, 2022

Please provide all files in source, no GIFs!

Also retry without extensions enabled. Select 'Extensions View > ... > Disable all Installed Extensions' and try again. Thanks.

screen shot 2018-05-09 at 08 45 10

@kanlukasz
Copy link
Author

Steps to Reproduce:

  1. Download fresh VSCode portable from official source

  2. Unpack, create empty data directory, run

  3. Select Extensions View > ... > Disable all Installed Extensions (either way, nothing is installed because it's a fresh install)

  4. Reload Window

  5. Open empty folder

  6. Create two files - from.php & to.php

  7. The contents of the from.php file:

<?php

$name = 'Bartholomew';

function getName(string $name): string
{
    return $name;
}
  1. The contents of the to.php file:
<h1></h1>

<?php

getName('');

$name2 = '';
  1. VSCode Settings:
{
    "editor.quickSuggestions": {
        "other": true,
        "comments": true,
        "strings": true
    },
    "editor.wordBasedSuggestionsMode": "allDocuments"
}
  1. Now let's open and leave both files open and try to start typing the name 'Bartholomew' in the blanks in the file to.php.
    As you will notice, autosuggestion will work between the h1 tag, but will not work in getName(''); function and in the $name2 = ''; variable

Above I have written everything in the form of text and sources, but for the sake of clarity, I am attaching a short GIF with the result of these actions again:
vsvsvs22

@jrieken
Copy link
Member

jrieken commented Jan 5, 2022

Select Extensions View > ... > Disable all Installed Extensions (either way, nothing is installed because it's a fresh install)

No, you need to use --extensions-dir <folder> because user data is separate from extensions. So, please do that and confirm if you still see this. I don't, e.g I don't see Bartholomew being suggested inside the h1-tag nor the string. This is likely because another extension provides completions which are then all filtered. In that case you don't see textual suggestion (see #21611)

@kanlukasz
Copy link
Author

I'm not sure if I understand correctly what you mean user data is separate from extensions.

I run VSCode from command line with:
"C:\Users\username\Desktop\vscode\Code.exe" --extensions-dir="C:\Users\username\Desktop\vscode\data\extensions"
but nothing has changed


image


image


PS.:

My portable installation looks like this:
image


In the data directory that I created, I have:
image
The above directories were created automatically


Extenions directory is empty:
image


If you want, I can install VSCode using the System Installer on another computer that has never had VsCode installed and check it again 🤷‍♂️

@jrieken
Copy link
Member

jrieken commented Jan 5, 2022

Sorry, I misread the very first step. You are doing it right but I still don't understand why I am not seeing any word suggestions...

@kanlukasz
Copy link
Author

Do your VSCode settings look the same as mine? I mean:

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

@jrieken
Copy link
Member

jrieken commented Jan 5, 2022

Yes, this is what I see ⬇️ So, basically I always get suggestions from the built-in php extension and that mutes word bases suggestions

Screen.Recording.2022-01-05.at.11.51.13.mov

@kanlukasz
Copy link
Author

Thanks for sharing the screen.
Note that you are typing Bar or bart between h1. I can confirm that it doesn't actually prompt in this case, but if you type Bart it will work

See on my screen below:
vsvsvs2233

@jrieken
Copy link
Member

jrieken commented Jan 5, 2022

Note that you are typing Bar or bart between h1. I can confirm that it doesn't actually prompt in this case, but if you type Bart it will work

Thanks for clarifying - indeed with the bart prefix it works. It seems that the builtin php extension doesn't something with any shorter prefix which suppresses word based suggestions.

I wasn't always able to reproduce what you see but after starring at the code I found a race condition - sometimes snippets would suppress completions (which isn't meant to ever happen). I will push a change now and would ask you to try again with next/tomorrows insiders build

sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Jan 5, 2022
…ets happened, microsoft/vscode#139559

Commit: 7046a368fb98b136457118a67a2b453d42ad693f
@jrieken jrieken added suggest IntelliSense, Auto Complete and removed info-needed Issue requires more information from poster labels Jan 5, 2022
@jrieken jrieken added this to the January 2022 milestone Jan 5, 2022
@jrieken
Copy link
Member

jrieken commented Jan 7, 2022

@kanlukasz Can you give this a try this with VS Code Insiders?

@Ciantic
Copy link

Ciantic commented Jan 7, 2022

This happened to me too, but it works in the insiders!

However it still shows those two #region things there, even though I have php.suggest.basic: false:

image

I don't know where it pulls those ones.

@jrieken
Copy link
Member

jrieken commented Jan 7, 2022

Ok, thanks for clarifying. Closing. Too eager snippets are tracked here: #140039

@jrieken jrieken closed this as completed Jan 7, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
snippets suggest IntelliSense, Auto Complete
Projects
None yet
Development

No branches or pull requests

4 participants