diff --git a/src/serverprotocol/PasLS.ClientProfile.pas b/src/serverprotocol/PasLS.ClientProfile.pas index ce841bc..dab2a40 100644 --- a/src/serverprotocol/PasLS.ClientProfile.pas +++ b/src/serverprotocol/PasLS.ClientProfile.pas @@ -34,7 +34,8 @@ interface cfExcludeInterfaceMethodDecls, // Don't include method/function/procedure declarations from interface section cfExcludeImplClassDefs, // Don't include class definitions from implementation section cfNullDocumentVersion, // Use nil instead of 0 for document version - cfFilterTextOnly // Only set filterText in completion, not label + cfFilterTextOnly, // Only set filterText in completion, not label + cfUseSecondaryText // Use secondaryText field in completion items ); TClientFeatures = set of TClientFeature; @@ -78,7 +79,8 @@ implementation 'excludeInterfaceMethodDecls', 'excludeImplClassDefs', 'nullDocumentVersion', - 'filterTextOnly' + 'filterTextOnly', + 'useSecondaryText' ); function TryStrToFeature(const S: string; out F: TClientFeature): Boolean; diff --git a/src/serverprotocol/PasLS.Completion.pas b/src/serverprotocol/PasLS.Completion.pas index dabf8c9..445780f 100644 --- a/src/serverprotocol/PasLS.Completion.pas +++ b/src/serverprotocol/PasLS.Completion.pas @@ -66,8 +66,8 @@ procedure TCompletionItemHelper.SetPrimaryText(text: string); procedure TCompletionItemHelper.SetSecondaryText(text: string); begin - if not TClientProfile.Current.HasFeature(cfFilterTextOnly) then - &label := text; + if (not TClientProfile.Current.HasFeature(cfFilterTextOnly)) and TClientProfile.Current.HasFeature(cfUseSecondaryText) then + &label := &label + ' ' + text; end;