@@ -91,10 +91,11 @@ package LSP.Ada_Contexts is
91
91
procedure Find_All_References
92
92
(Self : Context;
93
93
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));
98
99
-- Finds all references to a given defining name in all units of the
99
100
-- context.
100
101
@@ -124,10 +125,11 @@ package LSP.Ada_Contexts is
124
125
procedure Find_All_Calls
125
126
(Self : Context;
126
127
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));
131
133
-- Return all the enclosing entities that call Definition in all sources
132
134
-- known to this project.
133
135
@@ -147,52 +149,63 @@ package LSP.Ada_Contexts is
147
149
(Self : Context;
148
150
Definition : Libadalang.Analysis.Defining_Name;
149
151
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));
154
157
-- Get all the references to a given defining name in all units for
155
158
-- renaming purposes: for instance, when called on a tagged type primitive
156
159
-- definition, references to the base subprograms it inherits and to the
157
160
-- overriding ones are also returned.
158
161
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).
163
165
164
166
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.
168
172
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;
172
186
-- Return the list of files known to this context.
173
187
174
188
function File_Count (Self : Context) return Natural;
175
189
-- Return number of files known to this context.
176
190
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;
179
193
-- Return the command line for the Pretty Printer
180
194
181
195
function Get_Format_Options
182
196
(Self : Context) return Gnatformat.Configuration.Format_Options_Type;
183
197
-- Return the formatting options for Gnatformat
184
198
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;
187
201
-- Get the documentation style used for this context.
188
202
189
203
function Analysis_Units
190
204
(Self : Context) return Libadalang.Analysis.Analysis_Unit_Array;
191
205
-- Return the analysis units for all Ada sources known to this context
192
206
193
207
function List_Source_Directories
194
- (Self : Context;
195
- Include_Externally_Built : Boolean := False)
208
+ (Self : Context; Include_Externally_Built : Boolean := False)
196
209
return LSP.Ada_File_Sets.File_Sets.Set;
197
210
-- List the source directories, including externally built projects' source
198
211
-- directories when Include_Externally_Built is set to True.
@@ -220,23 +233,19 @@ package LSP.Ada_Contexts is
220
233
-- increase the speed of semantic requests.
221
234
222
235
procedure Include_File
223
- (Self : in out Context;
224
- File : GNATCOLL.VFS.Virtual_File);
236
+ (Self : in out Context; File : GNATCOLL.VFS.Virtual_File);
225
237
-- Includes File in Self's source files
226
238
227
239
procedure Exclude_File
228
- (Self : in out Context;
229
- File : GNATCOLL.VFS.Virtual_File);
240
+ (Self : in out Context; File : GNATCOLL.VFS.Virtual_File);
230
241
-- Excludes File from Self's source files
231
242
232
243
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);
235
245
-- Index/reindex the given document in this context
236
246
237
247
procedure Flush_Document
238
- (Self : in out Context;
239
- File : GNATCOLL.VFS.Virtual_File);
248
+ (Self : in out Context; File : GNATCOLL.VFS.Virtual_File);
240
249
-- Revert a document to the state of the file discarding any changes
241
250
242
251
function LAL_Context
@@ -247,10 +256,11 @@ package LSP.Ada_Contexts is
247
256
(Self : Context;
248
257
Pattern : LSP.Search.Search_Pattern'Class;
249
258
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);
254
264
Unit_Prefix : VSS.Strings.Virtual_String :=
255
265
VSS.Strings.Empty_Virtual_String);
256
266
-- Find symbols that match the given Pattern in all files of the context and
0 commit comments