Skip to content

Conversation

dibarbet
Copy link
Member

@dibarbet dibarbet commented Apr 9, 2025

@dibarbet dibarbet requested a review from a team as a code owner April 9, 2025 01:34
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 9, 2025
@@ -14,11 +16,50 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api;
/// </summary>
internal abstract class VSTypeScriptSignatureHelpProviderBase : ISignatureHelpProvider
{
public ImmutableArray<char> TriggerCharacters
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the easiest way I could come up with to avoid a dual insertion.

once we have packages I'll submit a PR to TS to switch to the new properties, then we can delete the hardcoded characters.

/// <summary>
/// Hard coded from https://github.com/dotnet/fsharp/blob/main/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs#L708
/// </summary>
public ImmutableArray<char> TriggerCharacters => _newProvider is not null ? _newProvider.TriggerCharacters : ['(', '<', ',', ' '];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the easiest way I could come up with to avoid a dual insertion.

once we have packages inserted I'll submit a PR to F# to switch to the new properties, then we can delete the hardcoded characters.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup. this makes sense to me.

@@ -66,7 +74,12 @@ public ServerCapabilities GetCapabilities(ClientCapabilities clientCapabilities)
TriggerCharacters = triggerCharacters,
};

capabilities.SignatureHelpProvider = new SignatureHelpOptions { TriggerCharacters = ["(", ","] };
var signatureHelpTriggerCharacters = _signatureHelpProviders.SelectMany(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main part of the fix. rest is basically just updating based on the interface changes

@@ -28,20 +28,17 @@ namespace Microsoft.CodeAnalysis.CSharp.SignatureHelp;
[ExportSignatureHelpProvider("ElementAccessExpressionSignatureHelpProvider", LanguageNames.CSharp), Shared]
internal sealed class ElementAccessExpressionSignatureHelpProvider : AbstractCSharpSignatureHelpProvider
{
private static readonly ImmutableArray<char> s_triggerCharacters = ['[', ','];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could remove and do TriggerCharaacters { get; } = ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is used in a bunch of static classes and methods - found it easier to do this than change the rest of the callers

Comment on lines 39 to 49
Public Overrides ReadOnly Property TriggerCharacters As ImmutableArray(Of Char)
Get
Return ImmutableArray.Create(" "c, ","c)
End Get
End Property

Public Overrides ReadOnly Property RetriggerCharacters As ImmutableArray(Of Char)
Get
Return ImmutableArray(Of Char).Empty
End Get
End Property
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Public Overrides ReadOnly Property TriggerCharacters As ImmutableArray(Of Char)
Get
Return ImmutableArray.Create(" "c, ","c)
End Get
End Property
Public Overrides ReadOnly Property RetriggerCharacters As ImmutableArray(Of Char)
Get
Return ImmutableArray(Of Char).Empty
End Get
End Property
Public Overrides ReadOnly Property TriggerCharacters As ImmutableArray(Of Char) = ImmutableArray.Create(" "c, ","c)
Public Overrides ReadOnly Property RetriggerCharacters As ImmutableArray(Of Char) = ImmutableArray(Of Char).Empty

@dibarbet dibarbet merged commit 31c7de9 into dotnet:main Apr 9, 2025
25 checks passed
@dibarbet dibarbet deleted the fix_signature_help_trigger_chars branch April 9, 2025 20:03
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Apr 9, 2025
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show hint for generic type parameter
4 participants