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

Intellisense inside interpolated strings does not appear in some cases #5297

Open
Spartan322 opened this issue Jul 2, 2022 · 4 comments · May be fixed by microsoft/vscode#232772
Open

Intellisense inside interpolated strings does not appear in some cases #5297

Spartan322 opened this issue Jul 2, 2022 · 4 comments · May be fixed by microsoft/vscode#232772
Assignees
Labels
Milestone

Comments

@Spartan322
Copy link

Issue Description

When I'm typing a first part of a variable name in an interpolated string expression, the intellisense will not trigger, the exception to this so far has been when I try to access an already named variable inside it will trigger the intellisense properly.

Steps to Reproduce

Inside a function put in:

var initial_testing_variable = "";
var demonstration_variable = $"{}";

Type initial_ into the interpolated string.

Expected Behavior

An intellisense completion list for initial_.

Actual Behavior

No list spawned, just reports a syntax error.

Logs

OmniSharp log

Starting OmniSharp server at 7/2/2022, 7:49:18 PM
    Target: /home/homedirectory/Projects/godot/SPID Graphical Tool/SPID Graphical Tool.sln

OmniSharp server started with Mono 6.13.0.
    Path: /home/homedirectory/.vscode-oss/extensions/ms-dotnettools.csharp-1.25.0/.omnisharp/1.39.0/omnisharp/OmniSharp.exe
    PID: 57518

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on arch 0.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to /usr/share/dotnet/dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: Mono 16.10.1 - "/usr/lib/mono/msbuild/Current/bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 16.10.1 - "/usr/lib/mono/msbuild/Current/bin"
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/home/homedirectory/Projects/godot/SPID Graphical Tool'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Did not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/home/homedirectory/Projects/godot/SPID Graphical Tool/SPID Graphical Tool.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLib.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/homedirectory/Projects/godot/SPID Graphical Tool/SPID Graphical Tool.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/homedirectory/Projects/godot/SPID Graphical Tool'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Did not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/home/homedirectory/Projects/godot/SPID Graphical Tool' on host 56956.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLib.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLib.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLib.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/homedirectory/Projects/godot/SPID Graphical Tool/SPID Graphical Tool.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/home/homedirectory/Projects/godot/SPID Graphical Tool/SPID Graphical Tool.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/home/homedirectory/Projects/godot/SPID Graphical Tool/SPID Graphical Tool.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: SpartansLib
[info]: OmniSharp.MSBuild.ProjectManager
        Found referenced project outside root directory: /home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLibTask/SpartansLibTask.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLibTask/SpartansLibTask.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLibTask/SpartansLibTask.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: SPID Graphical Tool
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLibTask/SpartansLibTask.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/home/homedirectory/Projects/godot/SPID Graphical Tool/SpartansLib/SpartansLibTask/SpartansLibTask.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: SpartansLibTask
Received response for /quickinfo but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /v2/getcodeactions but could not find request.

C# log

No output

Environment information

VSCode version: 1.68.1
C# Extension: 1.25.0

Mono Information OmniSharp using mono :6.13.0
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.301 Commit: 43f9b18481

Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /usr/share/dotnet/sdk/6.0.301/

Host (useful for support):
Version: 6.0.6
Commit: 7cca709db2

.NET SDKs installed:
3.1.120 [/usr/share/dotnet/sdk]
6.0.301 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.NETCore.App 3.1.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
better-comments aaron-bond 3.0.0
csharp ms-dotnettools 1.25.0
csharp-format-usings gaoshan0621 0.0.4
csharpextensions kreativ-software 1.7.0
docomment k--kato 0.1.31
gdscript jjkim 0.0.2
githistory donjayamanne 0.6.19
gitignore codezombiech 0.7.0
godot-tools geequlim 1.3.1
ilspy-vscode icsharpcode 0.13.1
mono-debug ms-vscode 0.16.2
open-in-browser techer 2.0.0
path-intellisense christian-kohler 2.8.0
sln-support logerfo 0.0.1
todo-tree Gruntfuggly 0.0.215
vscode-dotnet-runtime ms-dotnettools 1.2.0
vscode-icons vscode-icons-team 11.12.0
vscode-open-in-github ziyasal 1.4.1
vscode-solution-explorer fernandoescolar 0.4.7
vscode-todo-highlight wayou 1.0.5
@Spartan322 Spartan322 changed the title Intellisense inside interpolated strings does not appear in most cases Intellisense inside interpolated strings does not appear in some cases Jul 2, 2022
@explorest
Copy link

Any resolution yet ?? I still have this issue with the latest VSCode , C# Dev kit, and Omnisharp on Windows 11.

@explorest
Copy link

explorest commented Sep 2, 2023

Ok I found the solution for my case. Firstly , this is the default behavior ( to NOT auto-trigger intellisense inside strings). To access intellisense inside an interpolated string , the default way is to start typing and then press Ctrl+Space bar for intellisense (quick suggestions). If you want to change this behavior to auto-trigger then go to user settings (by any of the many routes -- like Ctrl+, ). Search for "quick suggestions" and then toggle "on" the "strings" setting in "Editor : Quick Suggestions" section. Then reload window to see the effect. {Note: I found the default behavior much better. Auto trigger inside strings can get annoying for long strings).

@dibarbet
Copy link
Member

dibarbet commented Oct 31, 2024

There is an issue in the C# textmate support - the interpolation token type is getting marked as a string by VSCode, so completion will only show up there if completion is enabled in strings (hence why it shows up if you adjust the Editor : Quick Suggestions behavior for strings).

However, code inside the curly braces shouldn't be getting interpreted as a string. The fix for that issue is here - microsoft/vscode#232772

@dibarbet dibarbet added Bug and removed OmniSharp labels Oct 31, 2024
@dibarbet dibarbet added this to the November2024 milestone Oct 31, 2024
@dibarbet dibarbet self-assigned this Oct 31, 2024
@explorest
Copy link

Wonderful. Thanks.

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

Successfully merging a pull request may close this issue.

3 participants