Skip to content

Commit 68fc8d7

Browse files
Merge branch 'topic/als.1596.runtime_fallback_memory' into 'master'
Avoid using the fallback context for runtime files See merge request eng/ide/ada_language_server!1907
2 parents 30d7816 + 79c51db commit 68fc8d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/ada/lsp-ada_handlers.adb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,12 @@ package body LSP.Ada_Handlers is
247247
-- Check if the given file belongs to the runtime.
248248

249249
function Is_A_Source (Self : LSP.Ada_Contexts.Context) return Boolean is
250-
(Is_Runtime_File or else Self.Is_Part_Of_Project (File));
250+
((Is_Runtime_File and then not Self.Is_Fallback_Context)
251+
or else Self.Is_Part_Of_Project (File));
251252
-- Return True if File is a source of the project held by Context
253+
-- Avoid considering runtime files as sources for the fallback context,
254+
-- if there is no context available for this file then we will still
255+
-- use the fallback later.
252256

253257
Contexts : constant LSP.Ada_Context_Sets.Context_Lists.List :=
254258
(Self.Contexts.Each_Context (Is_A_Source'Unrestricted_Access));

0 commit comments

Comments
 (0)