@@ -3766,14 +3766,17 @@ package body LSP.Ada_Handlers is
37663766 Request : LSP.Messages.Server_Requests.Workspace_Symbols_Request)
37673767 return LSP.Messages.Server_Responses.Symbol_Response
37683768 is
3769+ use type LSP.Messages.Search_Kind;
3770+ use type VSS.Strings.Character_Count;
3771+
37693772 procedure On_Inaccessible_Name
37703773 (File : GNATCOLL.VFS.Virtual_File;
37713774 Name : Libadalang.Analysis.Defining_Name;
37723775 Stop : in out Boolean);
37733776
37743777 Names : LSP.Ada_Completions.Completion_Maps.Map;
37753778
3776- package Canceled is new LSP.Generic_Cancel_Check (Request, 127 );
3779+ package Canceled is new LSP.Generic_Cancel_Check (Request' Access , 127 );
37773780
37783781 procedure Write_Symbols is
37793782 new LSP.Ada_Completions.Generic_Write_Symbols
@@ -3818,6 +3821,16 @@ package body LSP.Ada_Handlers is
38183821 (Is_Error => False);
38193822
38203823 begin
3824+ if Pattern.Get_Kind /= LSP.Messages.Start_Word_Text
3825+ and then Pattern.Get_Canonical_Pattern.Character_Length < 2
3826+ then
3827+ -- Do not process too small pattern because
3828+ -- this produces a huge response that is useless
3829+ -- and costs a while.
3830+
3831+ return Response;
3832+ end if ;
3833+
38213834 for Context of Self.Contexts.Each_Context loop
38223835 Context.Get_Any_Symbol
38233836 (Pattern => Pattern,
@@ -3968,9 +3981,10 @@ package body LSP.Ada_Handlers is
39683981
39693982 C := Self.Contexts.Get_Best_Context (Item.data.Value.uri);
39703983 Node := Get_Node_At
3971- (Self => C.all ,
3972- Document => null ,
3973- Position => LSP.Messages.TextDocumentPositionParams'
3984+ (Self => C.all ,
3985+ Document => null ,
3986+ Project_Only => False,
3987+ Position => LSP.Messages.TextDocumentPositionParams'
39743988 (textDocument => (uri => Item.data.Value.uri),
39753989 position => Item.data.Value.span.first));
39763990
0 commit comments