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

Autocomplete Feature Missing #230

Open
ThunderCls opened this issue Jul 9, 2024 · 8 comments
Open

Autocomplete Feature Missing #230

ThunderCls opened this issue Jul 9, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@ThunderCls
Copy link

Is it me or autocompletion is missing? I'm using v0.7.2 and nothing is shown when I try to access an entity property or function, or try to use anything like LINQ

@tareqimbasher
Copy link
Owner

Hello @ThunderCls. NetPad does have autocompletion and should work out of the box. When you first start NetPad it downloads then starts OmniSharp which powers a number of editor features like autocompletion, syntax highlighting, code lens...etc. If you find that these features do not work for you, can you take a look at the log files, there's a good chance the issue would be logged there. The easiest way to get to them is to open Settings (F12) and then click the "Open App Data Folder" button and check the Logs folder.

@ThunderCls
Copy link
Author

It's really weird. These logs are sticking out tho

2024-07-11T14:22:38.9940315-04:00 [WRN] (PID: 12796|OmniSharp.Stdio.Host) ************ Request ************
{
  "Command": "/completion",
  "Seq": 196,
  "Arguments": {
    "CompletionTrigger": 1,
    "TriggerCharacter": null,
    "Line": 1,
    "Column": 25,
    "Buffer": null,
    "Changes": null,
    "ApplyChangesTogether": false,
    "FileName": "C:\\Users\\user\\AppData\\Local\\Temp\\NetPad\\OmniSharp\\a67e5ebc-61d3-4003-ac8a-ded77e8a0bb5\\User_Program.cs"
  }
}
2024-07-11T14:22:38.9940693-04:00 [ERR] (PID: 12796|OmniSharp.Stdio.Host) ************  Response (20.2601ms) ************ 
{
  "Request_seq": 196,
  "Command": "/completion",
  "Running": true,
  "Success": false,
  "Message": "\"System.IndexOutOfRangeException: Index was outside the bounds of the array.\\r\\n   at Microsoft.CodeAnalysis.Text.StringText.get_Item(Int32 position)\\r\\n   at Microsoft.CodeAnalysis.Completion.CommonCompletionUtilities.GetWordSpan(SourceText text, Int32 position, Func`2 isWordStartCharacter, Func`2 isWordCharacter, Boolean alwaysExtendEndSpan)\\r\\n   at Microsoft.CodeAnalysis.Completion.CommonCompletionUtilities.GetWordSpan(SourceText text, Int32 position, Func`2 isWordStartCharacter, Func`2 isWordCharacter)\\r\\n   at Microsoft.CodeAnalysis.CSharp.Completion.Providers.CompletionUtilities.GetCompletionItemSpan(SourceText text, Int32 position)\\r\\n   at Microsoft.CodeAnalysis.CSharp.Completion.CSharpCompletionService.GetDefaultCompletionListSpan(SourceText text, Int32 caretPosition)\\r\\n   at Microsoft.CodeAnalysis.Completion.CompletionService.GetCompletionsAsync(Document document, Int32 caretPosition, CompletionOptions options, OptionSet passThroughOptions, CompletionTrigger trigger, ImmutableHashSet`1 roles, CancellationToken cancellationToken)\\r\\n   at OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService.Handle(CompletionRequest request, Boolean forceExpandedCompletionIndexCreation) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Completion\\\\CompletionService.cs:line 95\\r\\n   at OmniSharp.Endpoint.EndpointHandler`2.GetFirstNotEmptyResponseFromHandlers(ExportHandler`2[] handlers, TRequest request) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 200\\r\\n   at OmniSharp.Endpoint.EndpointHandler`2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 229\\r\\n   at OmniSharp.Endpoint.EndpointHandler`2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 130\\r\\n   at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Stdio\\\\Host.cs:line 218\"",
  "Body": null,
  "Seq": 242,
  "Type": "response"
}
2024-07-11T14:22:41.1894018-04:00 [WRN] (PID: 12796|OmniSharp.Stdio.Host) ************ Request ************
{
  "Command": "/completion",
  "Seq": 218,
  "Arguments": {
    "CompletionTrigger": 1,
    "TriggerCharacter": null,
    "Line": 1,
    "Column": 28,
    "Buffer": null,
    "Changes": null,
    "ApplyChangesTogether": false,
    "FileName": "C:\\Users\\user\\AppData\\Local\\Temp\\NetPad\\OmniSharp\\a67e5ebc-61d3-4003-ac8a-ded77e8a0bb5\\User_Program.cs"
  }
}
2024-07-11T14:22:41.1897958-04:00 [ERR] (PID: 12796|OmniSharp.Stdio.Host) ************  Response (15.4087ms) ************ 
{
  "Request_seq": 218,
  "Command": "/completion",
  "Running": true,
  "Success": false,
  "Message": "\"System.IndexOutOfRangeException: Index was outside the bounds of the array.\\r\\n   at Microsoft.CodeAnalysis.Text.StringText.get_Item(Int32 position)\\r\\n   at Microsoft.CodeAnalysis.Completion.CommonCompletionUtilities.GetWordSpan(SourceText text, Int32 position, Func`2 isWordStartCharacter, Func`2 isWordCharacter, Boolean alwaysExtendEndSpan)\\r\\n   at Microsoft.CodeAnalysis.Completion.CommonCompletionUtilities.GetWordSpan(SourceText text, Int32 position, Func`2 isWordStartCharacter, Func`2 isWordCharacter)\\r\\n   at Microsoft.CodeAnalysis.CSharp.Completion.Providers.CompletionUtilities.GetCompletionItemSpan(SourceText text, Int32 position)\\r\\n   at Microsoft.CodeAnalysis.CSharp.Completion.CSharpCompletionService.GetDefaultCompletionListSpan(SourceText text, Int32 caretPosition)\\r\\n   at Microsoft.CodeAnalysis.Completion.CompletionService.GetCompletionsAsync(Document document, Int32 caretPosition, CompletionOptions options, OptionSet passThroughOptions, CompletionTrigger trigger, ImmutableHashSet`1 roles, CancellationToken cancellationToken)\\r\\n   at OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService.Handle(CompletionRequest request, Boolean forceExpandedCompletionIndexCreation) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Completion\\\\CompletionService.cs:line 95\\r\\n   at OmniSharp.Endpoint.EndpointHandler`2.GetFirstNotEmptyResponseFromHandlers(ExportHandler`2[] handlers, TRequest request) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 200\\r\\n   at OmniSharp.Endpoint.EndpointHandler`2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 229\\r\\n   at OmniSharp.Endpoint.EndpointHandler`2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 130\\r\\n   at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Stdio\\\\Host.cs:line 218\"",
  "Body": null,
  "Seq": 296,
  "Type": "response"
}

Just to add a little bit more of context if it matters. I'm creating a new script with the following settings:

  • SDK: .NET 8
  • Kind: C# Program
  • Optimize: Debug
  • Connection: None
    I'm also on Windows 10 Pro 22H2 build 19045.2728

@rkttu
Copy link

rkttu commented Jul 12, 2024

This seems to be a problem that occurs when upgrading to a new version while using an older version. I wanted to restore functionality right away, so I deleted the Application Data directory and ran NetPad again to confirm that IntelliSense was working normally again.

@rkttu
Copy link

rkttu commented Jul 12, 2024

However, after changing the settings and referencing the NuGet package that I use every day, the problem occurred again. I'm also attaching the log file and App Data directory for verification.

https://1drv.ms/u/s!Aj231qrFhIQxquxS-y7B0bzmll4GKQ?e=YtWeyR

Log File: log20240712.txt

I tested the NetPad v0.7.2 on the Apple M2 macbook Air (macOS Sonoma 14.5)

@tareqimbasher
Copy link
Owner

Thank you for that info, I will take a look!

@tareqimbasher
Copy link
Owner

@rkttu @ThunderCls can you try the new version and let me know if you're still seeing the same problem? Thank you

@rkttu
Copy link

rkttu commented Oct 2, 2024

Hmm... Since it's been a while since I ran it, I deleted the existing data directory, then replace the existing app with new app, and ran it, but it seems like the IntelliSense feature has more limitations than before. (IntelliSense for local variables is barely usable, and appears to be available only to the extent of hinting for well-known static methods like Console.WriteLine.)

I'm recording the current situation and uploading it as a video.

intellisense-degraded.mov

@tareqimbasher tareqimbasher added the bug Something isn't working label Oct 2, 2024
@bbilginn
Copy link

bbilginn commented Nov 25, 2024

Same here :(

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants