Skip to content

Commit 32be305

Browse files
committed
Drop unused parameter from Get_Open_Document
1 parent 3c8a02e commit 32be305

File tree

4 files changed

+6
-20
lines changed

4 files changed

+6
-20
lines changed

source/ada/lsp-ada_handlers-file_readers.adb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ package body LSP.Ada_Handlers.File_Readers is
142142

143143
Doc := Self.Handler.Get_Open_Document
144144
(URI => (VSS.Strings.Conversions.To_Virtual_String (URI)
145-
with null record),
146-
Force => False);
145+
with null record));
147146

148147
-- Preprocess the document's contents if open, or the file contents if
149148
-- not.

source/ada/lsp-ada_handlers-refactor.adb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ package body LSP.Ada_Handlers.Refactor is
116116
for Problem of Edits.Diagnostics loop
117117
Document := Get_Open_Document
118118
(Self => Handler.all,
119-
URI => Handler.To_URI (Problem.Filename),
120-
Force => False);
119+
URI => Handler.To_URI (Problem.Filename));
121120

122121
-- Publish any processed diagnostic when switching to a
123122
-- different file.

source/ada/lsp-ada_handlers.adb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,7 @@ package body LSP.Ada_Handlers is
323323

324324
function Get_Open_Document
325325
(Self : in out Message_Handler;
326-
URI : LSP.Structures.DocumentUri;
327-
Force : Boolean := False)
326+
URI : LSP.Structures.DocumentUri)
328327
return LSP.Ada_Documents.Document_Access
329328
is
330329
File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI);
@@ -334,14 +333,6 @@ package body LSP.Ada_Handlers is
334333
if Self.Open_Documents.Contains (File) then
335334
return LSP.Ada_Documents.Document_Access
336335
(Self.Open_Documents.Element (File));
337-
elsif Force then
338-
declare
339-
Document : constant Internal_Document_Access :=
340-
new LSP.Ada_Documents.Document (Self.Tracer);
341-
begin
342-
Document.Initialize (URI, VSS.Strings.Empty_Virtual_String, null);
343-
return LSP.Ada_Documents.Document_Access (Document);
344-
end;
345336
else
346337
return null;
347338
end if;

source/ada/lsp-ada_handlers.ads

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,11 @@ package LSP.Ada_Handlers is
9494
-----------------------------
9595

9696
function Get_Open_Document
97-
(Self : in out Message_Handler;
98-
URI : LSP.Structures.DocumentUri;
99-
Force : Boolean := False)
97+
(Self : in out Message_Handler;
98+
URI : LSP.Structures.DocumentUri)
10099
return LSP.Ada_Documents.Document_Access;
101100
-- Return the open document for the given URI.
102-
-- If the document is not opened, then if Force a new document
103-
-- will be created and must be freed by the user else null will be
104-
-- returned.
101+
-- If the document is not opened, then null will be returned.
105102

106103
function Is_Open_Document
107104
(Self : Message_Handler;

0 commit comments

Comments
 (0)