2

My VSCode editor suddenly stopped listing suggestion when am running import statements.

ie.

from django.shortcuts import render, redirect, get_object_or_404, get_list_or_404, HttpResponse

normally when I type:

from django.

it should suggest all packages in django or when I type

from django.shortcuts import

it again should suggest render, get_object_or_404 etc.

But this is not more happening. I have to painstakingly type these out myself.

please any help would be highly appreciated. Thanks a lot.

prynet
  • 53
  • 6
  • the latest PyLance needs VSC v1.50 – rioV8 Mar 07 '21 at 11:45
  • See this https://stackoverflow.com/a/53070679/6505847 – AzyCrw4282 Mar 07 '21 at 16:54
  • @prynet -Which extensions did you use? Could you please provide us with the content of your settings file "settings.json"? Since python's auto-completion function is provided by the "Python" extension, please try to reinstall it. – Jill Cheng Mar 08 '21 at 02:46

2 Answers2

1

That should change with VSCode 1.71 and issue 53715 which describes a similar problem:

Intellisense completions in VSCode are only shown after typing the first letter of a method.
But I don't always remember this - I often only remember some other parts of a name.

Example: If I type

import os 
os.dir

I would like to get "mkdir" or "makedirs" as a suggestion. This works as expected in VS Community2017 (or other IDEs like pycharm):

https://user-images.githubusercontent.com/19992955/42380505-74e7b554-812e-11e8-83bc-ece31654ee40.png

In VSCode 1.25.0 (with python extension 2018.06) I only get this:
https://user-images.githubusercontent.com/19992955/42380531-84cd182e-812e-11e8-887f-c752623cd53d.png

Only if I enter "os.m" I get suggestions for "mkdir" or "makedirs".

It's nice that after the initial letter I can enter any string so that "os.md" shows the suggestions I want but I don't always remember the first letter of a method.

This is fixed with PR 152292

Add an option to expose the allowMidWordMatch as a setting

editor.suggest.matchOnWordStartOnly

When enabled IntelliSense filtering requires that the first character matches on a word start, e.g c on Console or WebContext but not on description.

When disabled IntelliSense will show more results but still sorts them by match quality.

This is released to VScode Insiders today.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
-3

I reinstalled VScode and was quite careful with extension installation. Everything is working fine now guys, thanks.

prynet
  • 53
  • 6