@@ -91,10 +91,11 @@ package LSP.Ada_Contexts is
9191 procedure Find_All_References
9292 (Self : Context;
9393 Definition : Libadalang.Analysis.Defining_Name;
94- Callback : not null access procedure
95- (Base_Id : Libadalang.Analysis.Base_Id;
96- Kind : Libadalang.Common.Ref_Result_Kind;
97- Cancel : in out Boolean));
94+ Callback :
95+ not null access procedure
96+ (Base_Id : Libadalang.Analysis.Base_Id;
97+ Kind : Libadalang.Common.Ref_Result_Kind;
98+ Cancel : in out Boolean));
9899 -- Finds all references to a given defining name in all units of the
99100 -- context.
100101
@@ -124,10 +125,11 @@ package LSP.Ada_Contexts is
124125 procedure Find_All_Calls
125126 (Self : Context;
126127 Definition : Libadalang.Analysis.Defining_Name;
127- Callback : not null access procedure
128- (Base_Id : Libadalang.Analysis.Base_Id;
129- Kind : Libadalang.Common.Ref_Result_Kind;
130- Cancel : in out Boolean));
128+ Callback :
129+ not null access procedure
130+ (Base_Id : Libadalang.Analysis.Base_Id;
131+ Kind : Libadalang.Common.Ref_Result_Kind;
132+ Cancel : in out Boolean));
131133 -- Return all the enclosing entities that call Definition in all sources
132134 -- known to this project.
133135
@@ -147,52 +149,63 @@ package LSP.Ada_Contexts is
147149 (Self : Context;
148150 Definition : Libadalang.Analysis.Defining_Name;
149151 Imprecise_Results : out Boolean;
150- Callback : not null access procedure
151- (Base_Id : Libadalang.Analysis.Base_Id;
152- Kind : Libadalang.Common.Ref_Result_Kind;
153- Cancel : in out Boolean));
152+ Callback :
153+ not null access procedure
154+ (Base_Id : Libadalang.Analysis.Base_Id;
155+ Kind : Libadalang.Common.Ref_Result_Kind;
156+ Cancel : in out Boolean));
154157 -- Get all the references to a given defining name in all units for
155158 -- renaming purposes: for instance, when called on a tagged type primitive
156159 -- definition, references to the base subprograms it inherits and to the
157160 -- overriding ones are also returned.
158161
159- function Is_Part_Of_Project
160- (Self : Context;
161- URI : LSP.Structures.DocumentUri) return Boolean;
162- -- Check if given file belongs to the project loaded in the Context
162+ function Is_Fallback_Context (Self : Context) return Boolean;
163+ -- Return true if the given context is used as a fallback (i.e: used for files
164+ -- that do not belong to any known project subtree).
163165
164166 function Is_Part_Of_Project
165- (Self : Context;
166- File : GNATCOLL.VFS.Virtual_File) return Boolean;
167- -- Check if given file belongs to the project loaded in the Context
167+ (Self : Context; URI : LSP.Structures.DocumentUri) return Boolean;
168+ -- Check if the file designated by the given URI belongs to the project
169+ -- loaded in the Context.
170+ -- This returns False for fallback contexts, since fallback contexts
171+ -- are not linked to any project subtree.
168172
169- function List_Files (Self : Context'CLass)
170- return LSP.Ada_File_Sets.File_Sets.Set_Iterator_Interfaces
171- .Reversible_Iterator'Class;
173+ function Is_Part_Of_Project
174+ (Self : Context; File : GNATCOLL.VFS.Virtual_File) return Boolean;
175+ -- Check if given file belongs to the project loaded in the Context.
176+ -- This returns False for fallback contexts, since fallback contexts
177+ -- are not linked to any project subtree.
178+
179+ function List_Files
180+ (Self : Context'CLass)
181+ return LSP
182+ .Ada_File_Sets
183+ .File_Sets
184+ .Set_Iterator_Interfaces
185+ .Reversible_Iterator'Class;
172186 -- Return the list of files known to this context.
173187
174188 function File_Count (Self : Context) return Natural;
175189 -- Return number of files known to this context.
176190
177- function Get_PP_Options (Self : Context) return
178- Utils.Command_Lines.Command_Line;
191+ function Get_PP_Options
192+ (Self : Context) return Utils.Command_Lines.Command_Line;
179193 -- Return the command line for the Pretty Printer
180194
181195 function Get_Format_Options
182196 (Self : Context) return Gnatformat.Configuration.Format_Options_Type;
183197 -- Return the formatting options for Gnatformat
184198
185- function Get_Documentation_Style (Self : Context) return
186- GNATdoc.Comments.Options.Documentation_Style;
199+ function Get_Documentation_Style
200+ (Self : Context) return GNATdoc.Comments.Options.Documentation_Style;
187201 -- Get the documentation style used for this context.
188202
189203 function Analysis_Units
190204 (Self : Context) return Libadalang.Analysis.Analysis_Unit_Array;
191205 -- Return the analysis units for all Ada sources known to this context
192206
193207 function List_Source_Directories
194- (Self : Context;
195- Include_Externally_Built : Boolean := False)
208+ (Self : Context; Include_Externally_Built : Boolean := False)
196209 return LSP.Ada_File_Sets.File_Sets.Set;
197210 -- List the source directories, including externally built projects' source
198211 -- directories when Include_Externally_Built is set to True.
@@ -220,23 +233,19 @@ package LSP.Ada_Contexts is
220233 -- increase the speed of semantic requests.
221234
222235 procedure Include_File
223- (Self : in out Context;
224- File : GNATCOLL.VFS.Virtual_File);
236+ (Self : in out Context; File : GNATCOLL.VFS.Virtual_File);
225237 -- Includes File in Self's source files
226238
227239 procedure Exclude_File
228- (Self : in out Context;
229- File : GNATCOLL.VFS.Virtual_File);
240+ (Self : in out Context; File : GNATCOLL.VFS.Virtual_File);
230241 -- Excludes File from Self's source files
231242
232243 procedure Index_Document
233- (Self : in out Context;
234- Document : in out LSP.Ada_Documents.Document);
244+ (Self : in out Context; Document : in out LSP.Ada_Documents.Document);
235245 -- Index/reindex the given document in this context
236246
237247 procedure Flush_Document
238- (Self : in out Context;
239- File : GNATCOLL.VFS.Virtual_File);
248+ (Self : in out Context; File : GNATCOLL.VFS.Virtual_File);
240249 -- Revert a document to the state of the file discarding any changes
241250
242251 function LAL_Context
@@ -247,10 +256,11 @@ package LSP.Ada_Contexts is
247256 (Self : Context;
248257 Pattern : LSP.Search.Search_Pattern'Class;
249258 Only_Public : Boolean;
250- Callback : not null access procedure
251- (File : GNATCOLL.VFS.Virtual_File;
252- Name : Libadalang.Analysis.Defining_Name;
253- Stop : in out Boolean);
259+ Callback :
260+ not null access procedure
261+ (File : GNATCOLL.VFS.Virtual_File;
262+ Name : Libadalang.Analysis.Defining_Name;
263+ Stop : in out Boolean);
254264 Unit_Prefix : VSS.Strings.Virtual_String :=
255265 VSS.Strings.Empty_Virtual_String);
256266 -- Find symbols that match the given Pattern in all files of the context and
0 commit comments