Skip to content

Best completion match for "Mathf.pi" should be "PI", not "PingPong" #3839

Closed as not planned

Description

Environment data

dotnet --info output:
.NET Command Line Tools (2.0.0-preview2-006127)

Product Information:
Version: 2.0.0-preview2-006127
Commit SHA-1 hash: 946ea7980a

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.0.0-preview2-006127\

Microsoft .NET Core Shared Framework Host

Version : 2.0.0-preview2-25319-02
Build : 7983b575ebcbdc3a825eea4b141ff7fb69d25f9d

VS Code version: 1.45.1
C# Extension version: 1.22.0

Steps to reproduce

In any Unity project type "Mathf.pi", but you could reproduce this with any struct where there is a similar set of fields. The Mathf class has a public const float PI and a static function PingPong.

Expected behavior

Since you typed the exact field name "pi" but just with the wrong case, it should prefer to autocomplete to the constant "PI".

Actual behavior

image

Omnisharp selects the method "PingPong", I really don't understand why but it's quite annoying since it happens every time. You have to either cancel the autocompletion every time you want pi or remember to type it with correct case otherwise it will autocomplete it to "PingPong".

In general I would suggest if you have typed the exact member name case-insensitively, you should prefer anything that matches that over something which requires adding additional characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions