File tree Expand file tree Collapse file tree 3 files changed +18
-22
lines changed
testsuite/ada_lsp/workspace_symbol Expand file tree Collapse file tree 3 files changed +18
-22
lines changed Original file line number Diff line number Diff line change @@ -3751,14 +3751,17 @@ package body LSP.Ada_Handlers is
37513751 Request : LSP.Messages.Server_Requests.Workspace_Symbols_Request)
37523752 return LSP.Messages.Server_Responses.Symbol_Response
37533753 is
3754+ use type LSP.Messages.Search_Kind;
3755+ use type VSS.Strings.Character_Count;
3756+
37543757 procedure On_Inaccessible_Name
37553758 (File : GNATCOLL.VFS.Virtual_File;
37563759 Name : Libadalang.Analysis.Defining_Name;
37573760 Stop : in out Boolean);
37583761
37593762 Names : LSP.Ada_Completions.Completion_Maps.Map;
37603763
3761- package Canceled is new LSP.Generic_Cancel_Check (Request, 127 );
3764+ package Canceled is new LSP.Generic_Cancel_Check (Request' Access , 127 );
37623765
37633766 procedure Write_Symbols is
37643767 new LSP.Ada_Completions.Generic_Write_Symbols
@@ -3803,6 +3806,16 @@ package body LSP.Ada_Handlers is
38033806 (Is_Error => False);
38043807
38053808 begin
3809+ if Pattern.Get_Kind /= LSP.Messages.Start_Word_Text
3810+ and then Pattern.Get_Canonical_Pattern.Character_Length < 2
3811+ then
3812+ -- Do not process too small pattern because
3813+ -- this produces a huge response that is useless
3814+ -- and costs a while.
3815+
3816+ return Response;
3817+ end if ;
3818+
38063819 for Context of Self.Contexts.Each_Context loop
38073820 Context.Get_Any_Symbol
38083821 (Pattern => Pattern,
Original file line number Diff line number Diff line change 2323with LSP.Messages.Server_Requests ;
2424
2525generic
26- Request : LSP.Messages.Server_Requests.Server_Request'Class;
26+ Request : access constant LSP.Messages.Server_Requests.Server_Request'Class;
2727 -- A request to check cancelation
28+
2829 Max_Skip_Count : Natural;
2930 -- How much checks to skip before make a real atomic flag check
3031
3132package LSP.Generic_Cancel_Check is
3233
33- function Has_Been_Canceled return Boolean
34- with Inline ;
34+ function Has_Been_Canceled return Boolean with Inline;
3535
3636end LSP.Generic_Cancel_Check ;
Original file line number Diff line number Diff line change 7171 "id" :" wsSymbol" ,
7272 "method" :" workspace/symbol" ,
7373 "params" :{
74- "query" :" "
74+ "query" :" Test "
7575 }
7676 },
7777 "sortReply" : {"result" :" name" },
7878 "wait" :[{
7979 "id" : " wsSymbol" ,
8080 "result" : [
81- {
82- "name" : " Main" ,
83- "kind" : 12 ,
84- "location" : {
85- "uri" : " $URI{main.adb}" ,
86- "range" : {
87- "start" : {
88- "line" : 0 ,
89- "character" : 10
90- },
91- "end" : {
92- "line" : 0 ,
93- "character" : 14
94- }
95- }
96- }
97- },
9881 {
9982 "name" : " Test1" ,
10083 "kind" : 12 ,
You can’t perform that action at this time.
0 commit comments