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

[BUG] Cannot accept override suggestion #6246

Closed
arkalyanms opened this issue Aug 28, 2023 · 9 comments
Closed

[BUG] Cannot accept override suggestion #6246

arkalyanms opened this issue Aug 28, 2023 · 9 comments
Assignees
Milestone

Comments

@arkalyanms
Copy link
Member

From vscode-dotnettools created by NamelessPerson: microsoft/vscode-dotnettools#434

Describe the Issue

When typing "override" in a class, suggestions for methods to override appear but after accepting them, the code does not appear.

Steps To Reproduce

On windows with unity project with C# Dev Kit enabled.
Inside class that inherits from another class with an overideable method
Type "override"
Get suggestions for overideable methods
Accept suggestion

Expected Behavior

Accepted suggested fills in code

Environment Information

  • Windows
  • C# Dev Kit v0.4.6
  • Behavior does not change whether or not Unity or IntelliCode for C# pacakges are installed
@Sanerins
Copy link

I would also want to add that this problem is not necessary linked to the Unity projects. Here is my gif showing that exact problem with Godot project. I have specifically turned off two Godot extensions I use which are not made by microsoft. Also it's worth noting that putting brackets even after typing out function manually deletes the typed letters back to the point when suggestion was made, as shown on the GIF I made:
problem

@arkalyanms
Copy link
Member Author

@Sanerins thanks for reporting! Would it be possible to get a minimal repro project from you?

@xwlwx
Copy link

xwlwx commented Sep 4, 2023

I am experiencing the same/similar issue. A little more detail from me:

Fresh vscode install with C# and dotnet runtime install tool extensions only

Fresh Godot project with a Node2D and CanvasItem2D sprite

Script attached to base Node2D Scene

Code complete works in some method call cases (see gif)

Code suggestion works, but code complete doesn't work with creating a method override no matter using tab, click, enter (see gif)

Code repo: https://github.com/xwlwx/CodeCompletionFailureDemo

Code.Completion.Failure.Demo.mp4

@Sanerins
Copy link

Sanerins commented Sep 4, 2023

@arkalyanms Sorry for a long wait, here is the exact project I showed in my gif https://github.com/Sanerins/vscode-bug-showcase
The particular file in question is https://github.com/Sanerins/vscode-bug-showcase/blob/master/scripts/levels/main_menu.cs
Though I do believe xwlwx has a pretty similar situation and our projects will be more or less exact same

@arkalyanms
Copy link
Member Author

arkalyanms commented Sep 5, 2023

Thank you @Sanerins for the repo. Unfortunately I do not have a repro with either just the C#(v2.0.436) or C# + C# Dev Kit. @genlu in case he can deduce something from the latest comments here. The cursor location after the autofill does seem like another bug though.

overridecompletion

@Sanerins
Copy link

Sanerins commented Sep 5, 2023

@arkalyanms thank you for a gif, I reread my previous problem once again and noticed that I said that target file was main_menu.cs, but actually in my gif it was not main_menu.cs, but in fact base_paddle.cs (link to a file).
I tried to replicate the bug I encountered in main_menu.cs and in fact everything worked normally just like on the gif you provided!
But auto completion in base_paddle.cs file still seems to behave wrongly, just as I've shown in my gif! Most peculiar situation indeed! And I'm very sorry that I was mistaken and forgot the exact file I encountered a problem in initially, since I didn't think it would be of much importance, while now it seems to me that it could be a key to determining the core cause of the bug
@arkalyanms if you are able, can you please check base_paddle.cs file and confirm whether you can recreate bug in it or not?
Autocompletion also seems not to work in base_brick.cs and base_ball.cs files for me, while main_menu.cs, strangely, works just fine

@arkalyanms
Copy link
Member Author

Sure, I hit success on the other files as well though.

oc

oc2

@Sanerins
Copy link

Sanerins commented Sep 5, 2023

@arkalyanms Thanks for a swift answer!

I want to dig to the bottom of it, so I thought for a bit what might be causing all of this like a Sherlok and come to the conclusion that all of the complaints from all of the three people have one thing in common - files were created not in vscode itself, but rather via different program (Godot in @xwlwx and my case, Unity in NamelessPerson case).

So I started to try to proof or deny my theory, and so far it seems like it might actually be the case. If I create new file, e.g new_paddle.cs via VS code - auto correction works just fine. But if I try to create new file using external tool, e.g godot, everything seems to behave just like in the first gif shown by me.

There are also additional abnormality, that even if I delete the cs file created by external program and then create new file with vscode, it still won't work normally

Here is a showcase of this very experience. Now I'm not sure whether it's a c# extention bug, since it's caused by third-party software, but on the other hand I'm not sure why creation of a file with Godot or Unity would result in such behaviour, considering that other ides e.g Rider seem not to have similar problems handling files created that way.

2023-09-05.22-47-05.mp4

@genlu
Copy link
Member

genlu commented Sep 9, 2023

Might be fixed by #6315
If not, we'd have more info to investigated with additional logging from #6325

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

No branches or pull requests

4 participants