diff options
author | Tim Lagnese | 2023-01-04 11:05:56 -0800 |
---|---|---|
committer | Tim Lagnese | 2023-01-04 11:05:56 -0800 |
commit | 92e4b3b1adb949684077aa20f8399c1888346a4e (patch) | |
tree | 7e59c243a13ed5765c35d6da1bcd297e90582360 | |
parent | 1b4cd936e746edf966443a9ef839391aa468b364 (diff) | |
download | aur-92e4b3b1adb949684077aa20f8399c1888346a4e.tar.gz |
Update version to 23.0.12
Update ada_language_server to 23.0.12. This required multiple patches to
ensure that it can build against the dependencies available in the AUR
because als upstream depends on newer untagged versions of dependencies.
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | gnatdoc.patch | 21 | ||||
-rw-r--r-- | lal-tools.patch | 956 | ||||
-rw-r--r-- | lal.patch | 60 | ||||
-rw-r--r-- | libadalang-tools.patch | 13 | ||||
-rw-r--r-- | spawn.patch | 63 | ||||
-rw-r--r-- | vss.patch | 24 |
8 files changed, 1158 insertions, 21 deletions
@@ -1,6 +1,6 @@ pkgbase = ada_language_server pkgdesc = High performance syntactic and semantic engine for the Ada programming language - pkgver = 23.0.10 + pkgver = 23.0.12 pkgrel = 1 epoch = 2 url = https://github.com/AdaCore/ada_language_server @@ -15,9 +15,19 @@ pkgbase = ada_language_server depends = ada-libfswatch depends = gpr depends = gnatdoc - source = ada_language_server-23.0.10.tar.gz::https://github.com/AdaCore/ada_language_server/archive/refs/tags/23.0.10.tar.gz + source = ada_language_server-23.0.12.tar.gz::https://github.com/AdaCore/ada_language_server/archive/refs/tags/23.0.12.tar.gz source = als.patch - b2sums = 100a0d042a6c638b1b3eb7c9c27a638f218a66e3f52a6f9be53fc42e764aff636c4fe7c1f532f2ba7ae6a811bf4cb8a8ce4a416fd1958c460ffb7f715a7166f5 + source = spawn.patch + source = lal-tools.patch + source = lal.patch + source = gnatdoc.patch + source = vss.patch + b2sums = 9daab15000b42df79a847d0ca6eb5b7f604c18f561eed2074cce8d2477d5a85671d3677bb87bab75d31340d90114a3d7b91cbd19817bd3f9e167bf29b77b5ce3 b2sums = 95a8d0ad9367606e5d6426dec432941d76e7bf7f8f7de3915282dcea9fcf7da783611b94f1f09376d5fac5b0fa2e81f470d01344dd42ab607918709e5a48e43b + b2sums = 56fecf391b0618a97ea5e010b272346ae761254354bb9b74241508d47dffa6e8abaaeedd1be267775be54347c63929ad4a9f9744f9abc7f360169b139ac957ef + b2sums = cc8e0bd391cbf85fd188e5850977b90f1c69a6e4f43cff975c6e5daf8e9c80cde54bc9608ce8505a918300f1f5e17aef46a25300cf992cc89b1c0485e64beac5 + b2sums = 509b44efc1a2ef8cf0216632bbf03980956ba500bcedd7442308b60ffe5668a0db851de11af0606626ba4726f5efaf10cad1dca16e898b379f6314dc03f51b2e + b2sums = 4072dde16e15faeab86da4a804730751ba7e498a32f19dd19bbf7b8e6fd44dff183b375fdacd857ecad03c6d1ac5b3a3351d17fe3b6e5d903e76a99752a2b3c7 + b2sums = 19682602c942eb3cf4a1e911d311468f21003ef7b4bd5c0f36d592cc2088faa50a9dc814dd14596be5bfb834ee3de57fc83c3323462076379995f4042a484849 pkgname = ada_language_server @@ -1,7 +1,7 @@ # Maintainer: Tim Lagnese <tim at inept tech> pkgname=ada_language_server -pkgver=23.0.10 +pkgver=23.0.12 pkgrel=1 epoch=2 @@ -13,15 +13,31 @@ license=('GPL3') depends=('libadalang-tools' 'gtkada' 'libvss' 'ada_spawn' 'ada-libfswatch' 'gpr' 'gnatdoc') makedepends=('gcc-ada' 'gprbuild') +# NOTE: When new releases of spawn, lal, lal-tools, gnatdoc, and vss make it to the AUR, try removing the corresponding patches. The patches only exist because the tagged versions of the dependencies have not been updated in GitHub. source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz" - "als.patch") - -b2sums=('100a0d042a6c638b1b3eb7c9c27a638f218a66e3f52a6f9be53fc42e764aff636c4fe7c1f532f2ba7ae6a811bf4cb8a8ce4a416fd1958c460ffb7f715a7166f5' - '95a8d0ad9367606e5d6426dec432941d76e7bf7f8f7de3915282dcea9fcf7da783611b94f1f09376d5fac5b0fa2e81f470d01344dd42ab607918709e5a48e43b') + "als.patch" + "spawn.patch" + "lal-tools.patch" + "lal.patch" + "gnatdoc.patch" + "vss.patch") + +b2sums=('9daab15000b42df79a847d0ca6eb5b7f604c18f561eed2074cce8d2477d5a85671d3677bb87bab75d31340d90114a3d7b91cbd19817bd3f9e167bf29b77b5ce3' + '95a8d0ad9367606e5d6426dec432941d76e7bf7f8f7de3915282dcea9fcf7da783611b94f1f09376d5fac5b0fa2e81f470d01344dd42ab607918709e5a48e43b' + '56fecf391b0618a97ea5e010b272346ae761254354bb9b74241508d47dffa6e8abaaeedd1be267775be54347c63929ad4a9f9744f9abc7f360169b139ac957ef' + 'cc8e0bd391cbf85fd188e5850977b90f1c69a6e4f43cff975c6e5daf8e9c80cde54bc9608ce8505a918300f1f5e17aef46a25300cf992cc89b1c0485e64beac5' + '509b44efc1a2ef8cf0216632bbf03980956ba500bcedd7442308b60ffe5668a0db851de11af0606626ba4726f5efaf10cad1dca16e898b379f6314dc03f51b2e' + '4072dde16e15faeab86da4a804730751ba7e498a32f19dd19bbf7b8e6fd44dff183b375fdacd857ecad03c6d1ac5b3a3351d17fe3b6e5d903e76a99752a2b3c7' + '19682602c942eb3cf4a1e911d311468f21003ef7b4bd5c0f36d592cc2088faa50a9dc814dd14596be5bfb834ee3de57fc83c3323462076379995f4042a484849') prepare() { cd "$srcdir/$pkgname-$pkgver" patch --strip=1 < ../als.patch + patch --strip=1 --reverse < ../spawn.patch + patch --strip=1 --reverse < ../lal-tools.patch + patch --strip=1 --reverse < ../lal.patch + patch --strip=1 --reverse < ../gnatdoc.patch + patch --strip=1 < ../vss.patch } build() { diff --git a/gnatdoc.patch b/gnatdoc.patch new file mode 100644 index 000000000000..778f6ca3a24d --- /dev/null +++ b/gnatdoc.patch @@ -0,0 +1,21 @@ +From 8a15e9d49248f2305091438d4dbfc395eb77bb7f Mon Sep 17 00:00:00 2001 +From: Vadim Godunko <godunko@adacore.com> +Date: Wed, 21 Sep 2022 14:04:33 +0300 +Subject: [PATCH] V721-007 Fix build with latest GNATdoc + +--- + source/ada/lsp-ada_handlers.adb | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb +index 0991cd57..d65291cf 100644 +--- a/source/ada/lsp-ada_handlers.adb ++++ b/source/ada/lsp-ada_handlers.adb +@@ -3075,6 +3075,7 @@ package body LSP.Ada_Handlers is + Options : constant + GNATdoc.Comments.Options.Extractor_Options := + (Style => Self.Options.Documentation.Style, ++ Pattern => <>, + Fallback => True); + + begin diff --git a/lal-tools.patch b/lal-tools.patch new file mode 100644 index 000000000000..0b3c97cc4362 --- /dev/null +++ b/lal-tools.patch @@ -0,0 +1,956 @@ +From 95a945d305c47d6799bbc85852d98da0d76183c4 Mon Sep 17 00:00:00 2001 +From: Joao Azevedo <azevedo@adacore.com> +Date: Wed, 12 Oct 2022 14:12:05 +0100 +Subject: [PATCH] VA12-013 Update test baseline due to laltools changes + +--- + source/ada/lsp-ada_contexts.adb | 3 --- + source/ada/lsp-ada_contexts.ads | 3 +-- + .../ada_lsp/refactoring_pull_up_declaration/V207-019/test.json | 2 +- + 3 files changed, 2 insertions(+), 6 deletions(-) + +diff --git a/source/ada/lsp-ada_contexts.adb b/source/ada/lsp-ada_contexts.adb +index c585252b..45596b32 100644 +--- a/source/ada/lsp-ada_contexts.adb ++++ b/source/ada/lsp-ada_contexts.adb +@@ -892,9 +892,6 @@ package body LSP.Ada_Contexts is + Self.Source_Dirs.Clear; + Self.Tree := null; + +- -- Destroy gnatpp's command line +- Utils.Command_Lines.Clear (Self.PP_Options); +- + -- Cleanup gnatpp's template tables + Pp.Actions.Clear_Template_Tables; + end Free; +diff --git a/source/ada/lsp-ada_contexts.ads b/source/ada/lsp-ada_contexts.ads +index 271d274d..7989b324 100644 +--- a/source/ada/lsp-ada_contexts.ads ++++ b/source/ada/lsp-ada_contexts.ads +@@ -358,7 +358,6 @@ private + is (Self.Source_Files.Length); + + function Get_PP_Options (Self : Context) return +- Utils.Command_Lines.Command_Line is +- (Utils.Command_Lines.Copy_Command_Line (Self.PP_Options)); ++ Utils.Command_Lines.Command_Line is (Self.PP_Options); + + end LSP.Ada_Contexts; +diff --git a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json +index 4cd2124a..a01e8e38 100644 +--- a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json ++++ b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json +@@ -259,7 +259,7 @@ + "character": 0 + } + }, +- "newText": "\n procedure Foo is null;\n" ++ "newText": " procedure Foo is null;\n\n" + }, + { + "range": { +From 41cb0924dbcdb61a7b598604d0a614cf3e90e9eb Mon Sep 17 00:00:00 2001 +From: Joao Azevedo <azevedo@adacore.com> +Date: Thu, 10 Nov 2022 16:45:16 +0000 +Subject: [PATCH] VB10-040 Adjust to latest gnatpp partial formatting API + +Support partial formatting of Ada_List slices. +Update tests baseline. +--- + source/ada/lsp-ada_completions.adb | 6 +- + source/ada/lsp-ada_documents.adb | 86 +-- + source/ada/lsp-ada_documents.ads | 2 +- + .../T527-019.range_formatting/test.json | 619 ++++++++---------- + .../test.json | 48 +- + 5 files changed, 339 insertions(+), 422 deletions(-) + +diff --git a/source/ada/lsp-ada_completions.adb b/source/ada/lsp-ada_completions.adb +index b3d9fb51..89f751c9 100644 +--- a/source/ada/lsp-ada_completions.adb ++++ b/source/ada/lsp-ada_completions.adb +@@ -397,15 +397,15 @@ package body LSP.Ada_Completions is + Filename => "", + Buffer => Full, + Rule => Rule); +- Pp.Actions.Set_Partial_Gnatpp_Offset (Offset); ++ Pp.Actions.Set_Partial_GNATPP_Offset (Offset); + Pp.Actions.Format_Vector + (Cmd => Cmd, + Input => Input, + Node => Root (Tmp_Unit), + Output => Output, + Messages => PP_Messages, +- Partial_Gnatpp => True); +- Pp.Actions.Set_Partial_Gnatpp_Offset (0); ++ Partial_GNATPP => True); ++ Pp.Actions.Set_Partial_GNATPP_Offset (0); + exception + when E : others => + -- Failed to pretty print the snippet, keep the previous +diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb +index 7e465e59..5f1f8395 100644 +--- a/source/ada/lsp-ada_documents.adb ++++ b/source/ada/lsp-ada_documents.adb +@@ -615,7 +615,7 @@ package body LSP.Ada_Documents is + (Self : Document; + Span : LSP.Messages.Span; + New_Text : VSS.Strings.Virtual_String; +- Edit : out LSP.Messages.TextEdit_Vector) ++ Edit : in out LSP.Messages.TextEdit_Vector) + is + use LSP.Types; + use LSP.Messages; +@@ -1121,68 +1121,50 @@ package body LSP.Ada_Documents is + end loop; + end Append_PP_Messages; + +- Output : Char_Vector; +- +- PP_Messages : Pp.Scanner.Source_Message_Vector; +- +- Input_Selection_Range : constant Source_Location_Range := +- (if Span = LSP.Messages.Empty_Span then +- No_Source_Location_Range +- else +- Make_Range +- (Self.Get_Source_Location (Span.first), +- Self.Get_Source_Location (Span.last))); +- +- Output_Selection_Range : Source_Location_Range; +- +- Unit : constant Analysis_Unit := +- Self.Unit (Context); +- Enclosing_Node : Ada_Node; +- + begin + Context.Trace.Trace ("On Range_Formatting"); ++ + Context.Trace.Trace ("Format_Selection"); +- begin +- Format_Selection +- (Main_Unit => Unit, +- Input_Selection_Range => Input_Selection_Range, +- Output => Output, +- Output_Selection_Range => Output_Selection_Range, +- PP_Messages => PP_Messages, +- Formatted_Node => Enclosing_Node, +- PP_Options => PP_Options, +- Force_Source_Line_Breaks => False); ++ declare ++ Unit : constant Analysis_Unit := ++ Self.Unit (Context); ++ Input_Selection_Range : constant Source_Location_Range := ++ (if Span = LSP.Messages.Empty_Span then No_Source_Location_Range ++ else Make_Range ++ (Self.Get_Source_Location (Span.first), ++ Self.Get_Source_Location (Span.last))); ++ Partial_Formatting_Edit : ++ constant Laltools.Partial_GNATPP.Partial_Formatting_Edit := ++ Format_Selection (Unit, Input_Selection_Range, PP_Options); + +- exception +- when others => +- Append_PP_Messages (PP_Messages); ++ begin ++ if not Partial_Formatting_Edit.Diagnostics.Is_Empty then ++ Append_PP_Messages (Partial_Formatting_Edit.Diagnostics); ++ Context.Trace.Trace ++ ("Non empty diagnostics from GNATPP - " ++ & "not continuing with Range_Formatting"); + return False; +- end; ++ end if; + +- if not PP_Messages.Is_Empty then +- Context.Trace.Trace +- ("Non empty PP_Messages - appending them to Messages"); +- Append_PP_Messages (PP_Messages); +- return False; +- end if; ++ Context.Trace.Trace ("Computing Range_Formatting Text_Edits"); ++ Edit.Clear; ++ declare ++ Edit_Span : constant LSP.Messages.Span := ++ Self.To_LSP_Range (Partial_Formatting_Edit.Edit.Location); ++ Edit_Text : constant VSS.Strings.Virtual_String := ++ VSS.Strings.Conversions.To_Virtual_String ++ (Partial_Formatting_Edit.Edit.Text); + +- Context.Trace.Trace ("Computing Range_Formatting Text_Edits"); +- declare +- Edit_Span : constant LSP.Messages.Span := +- Self.To_LSP_Range (Output_Selection_Range); +- Output_Str : constant String := +- Char_Vectors.Elems (Output) (1 .. Char_Vectors.Last_Index (Output)); +- Edit_Text : constant VSS.Strings.Virtual_String := +- VSS.Strings.Conversions.To_Virtual_String (Output_Str); ++ begin ++ Edit.Append (TextEdit'(Edit_Span, Edit_Text)); ++ end; + +- begin +- Self.Diff_Symbols (Edit_Span, Edit_Text, Edit); ++ return True; + end; + +- return True; +- + exception +- when others => ++ when E : others => ++ Log (Self.Trace, E, "in Range_Formatting"); + return False; + end Range_Formatting; + +diff --git a/source/ada/lsp-ada_documents.ads b/source/ada/lsp-ada_documents.ads +index 063d26a2..31ce7e5c 100644 +--- a/source/ada/lsp-ada_documents.ads ++++ b/source/ada/lsp-ada_documents.ads +@@ -388,7 +388,7 @@ private + (Self : Document; + Span : LSP.Messages.Span; + New_Text : VSS.Strings.Virtual_String; +- Edit : out LSP.Messages.TextEdit_Vector); ++ Edit : in out LSP.Messages.TextEdit_Vector); + -- Create a diff between document Text inside Span and New_Chunk and + -- return Text_Edit. Tests individual symbols instead of lines + -- as above. Do not use it for large text slices because it +diff --git a/testsuite/ada_lsp/T527-019.range_formatting/test.json b/testsuite/ada_lsp/T527-019.range_formatting/test.json +index d7841c2e..c75db82d 100644 +--- a/testsuite/ada_lsp/T527-019.range_formatting/test.json ++++ b/testsuite/ada_lsp/T527-019.range_formatting/test.json +@@ -1,346 +1,307 @@ + [ +- { +- "comment": [ +- "Test rangeFormatting request" +- ] +- }, +- { +- "start": { +- "cmd": [ +- "${ALS}" +- ] +- } +- }, +- { +- "send": { +- "request": { +- "params": { +- "processId": 20634, +- "capabilities": { +- "textDocument": { +- "rangeFormatting": { +- "dynamicRegistration": true +- } +- } +- }, +- "rootUri": "$URI{.}" ++ { ++ "comment": [ ++ "Test rangeFormatting request" ++ ] ++ }, ++ { ++ "start": { ++ "cmd": [ ++ "${ALS}" ++ ] ++ } ++ }, ++ { ++ "send": { ++ "request": { ++ "params": { ++ "processId": 20634, ++ "capabilities": { ++ "textDocument": { ++ "rangeFormatting": { ++ "dynamicRegistration": true ++ } ++ } ++ }, ++ "rootUri": "$URI{.}" ++ }, ++ "jsonrpc": "2.0", ++ "id": 1, ++ "method": "initialize" + }, +- "jsonrpc": "2.0", +- "id": 1, +- "method": "initialize" +- }, +- "wait": [ +- { +- "id": 1, +- "result": { +- "capabilities": { +- "textDocumentSync": 2 +- } +- } +- } +- ] +- } +- }, +- { +- "send": { +- "request": { +- "jsonrpc": "2.0", +- "method": "initialized" +- }, +- "wait": [] +- } +- }, +- { +- "send": { +- "request": { +- "params": { +- "settings": { +- "ada": { +- "enableDiagnostics": false +- } +- } ++ "wait": [ ++ { ++ "id": 1, ++ "result": { ++ "capabilities": { ++ "textDocumentSync": 2 ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "send": { ++ "request": { ++ "jsonrpc": "2.0", ++ "method": "initialized" + }, +- "jsonrpc": "2.0", +- "method": "workspace/didChangeConfiguration" +- }, +- "wait": [ +- { +- "jsonrpc": "2.0", +- "id": 2, +- "method": "client/registerCapability", +- "params": { +- "registrations": [ +- { +- "method": "textDocument/rangeFormatting", +- "registerOptions": { +- "documentSelector": [ +- "ada" +- ] ++ "wait": [] ++ } ++ }, ++ { ++ "send": { ++ "request": { ++ "params": { ++ "settings": { ++ "ada": { ++ "enableDiagnostics": false + } +- } +- ] +- } +- } +- ] +- } +- }, +- { +- "send": { +- "request": { +- "params": { +- "textDocument": { +- "text": "procedure Main is\n -- comment\n X : Integer := (1\n + 2\n + 3);\n begin\n -- Insert code here.\n null;\nend Main;\n", +- "version": 0, +- "uri": "$URI{main.adb}", +- "languageId": "Ada" +- } ++ } ++ }, ++ "jsonrpc": "2.0", ++ "method": "workspace/didChangeConfiguration" ++ }, ++ "wait": [ ++ { ++ "jsonrpc": "2.0", ++ "id": 2, ++ "method": "client/registerCapability", ++ "params": { ++ "registrations": [ ++ { ++ "method": "textDocument/rangeFormatting", ++ "registerOptions": { ++ "documentSelector": [ ++ "ada" ++ ] ++ } ++ } ++ ] ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "send": { ++ "request": { ++ "params": { ++ "textDocument": { ++ "text": "procedure Main is\n -- comment\n X : Integer := (1\n + 2\n + 3);\n begin\n -- Insert code here.\n null;\nend Main;\n", ++ "version": 0, ++ "uri": "$URI{main.adb}", ++ "languageId": "Ada" ++ } ++ }, ++ "jsonrpc": "2.0", ++ "method": "textDocument/didOpen" + }, +- "jsonrpc": "2.0", +- "method": "textDocument/didOpen" +- }, +- "wait": [] +- } +- }, +- { +- "send": { +- "request": { +- "jsonrpc": "2.0", +- "id": 3, +- "method": "textDocument/rangeFormatting", +- "params": { +- "textDocument": { +- "uri": "$URI{main.adb}" +- }, +- "range": { +- "start": { +- "line": 2, +- "character": 0 +- }, +- "end": { +- "line": 6, +- "character": 0 +- } +- }, +- "options": { +- "insertSpaces": true, +- "tabSize": 3 +- } +- } +- }, +- "wait": [ +- { +- "id": 3, +- "result": [ +- { +- "range": { +- "start": { +- "line": 2, +- "character": 20 +- }, +- "end": { +- "line": 3, +- "character": 5 +- } +- }, +- "newText": "" +- }, +- { +- "range": { +- "start": { +- "line": 3, +- "character": 9 +- }, +- "end": { +- "line": 4, +- "character": 7 +- } +- }, +- "newText": "" +- }, +- { +- "range": { +- "start": { +- "line": 5, +- "character": 0 +- }, +- "end": { +- "line": 5, +- "character": 3 +- } +- }, +- "newText": "" +- }, +- { +- "range": { +- "start": { +- "line": 6, +- "character": 0 +- }, +- "end": { +- "line": 6, +- "character": 4 +- } +- }, +- "newText": "" +- } +- ] +- } +- ] +- } +- }, +- { +- "send": { +- "request": { +- "jsonrpc": "2.0", +- "method": "textDocument/didChange", +- "params": { +- "textDocument": { +- "uri": "$URI{main.adb}", +- "version": 2 +- }, +- "contentChanges": [ +- { +- "range": { ++ "wait": [] ++ } ++ }, ++ { ++ "send": { ++ "request": { ++ "jsonrpc": "2.0", ++ "id": 3, ++ "method": "textDocument/rangeFormatting", ++ "params": { ++ "textDocument": { ++ "uri": "$URI{main.adb}" ++ }, ++ "range": { + "start": { +- "line": 5, +- "character": 0 ++ "line": 2, ++ "character": 0 + }, + "end": { +- "line": 5, +- "character": 3 ++ "line": 6, ++ "character": 0 + } +- }, +- "rangeLength": 3, +- "text": "" +- }, +- { +- "range": { +- "start": { +- "line": 4, +- "character": 3 +- }, +- "end": { +- "line": 4, +- "character": 8 ++ }, ++ "options": { ++ "insertSpaces": true, ++ "tabSize": 3 ++ } ++ } ++ }, ++ "wait": [ ++ { ++ "id": 3, ++ "result": [ ++ { ++ "range": { ++ "start": { ++ "line": 0, ++ "character": 0 ++ }, ++ "end": { ++ "line": 8, ++ "character": 9 ++ } ++ }, ++ "newText": "procedure Main is\n -- comment\n X : Integer := (1 + 2 + 3);\nbegin\n -- Insert code here.\n null;\nend Main;" + } +- }, +- "rangeLength": 5, +- "text": "" +- }, +- { +- "range": { +- "start": { +- "line": 3, +- "character": 9 ++ ] ++ } ++ ] ++ } ++ }, ++ { ++ "send": { ++ "request": { ++ "jsonrpc": "2.0", ++ "method": "textDocument/didChange", ++ "params": { ++ "textDocument": { ++ "uri": "$URI{main.adb}", ++ "version": 2 ++ }, ++ "contentChanges": [ ++ { ++ "range": { ++ "start": { ++ "line": 6, ++ "character": 0 ++ }, ++ "end": { ++ "line": 6, ++ "character": 4 ++ } ++ }, ++ "rangeLength": 4, ++ "text": "" + }, +- "end": { +- "line": 4, +- "character": 2 +- } +- }, +- "rangeLength": 3, +- "text": "" +- }, +- { +- "range": { +- "start": { +- "line": 3, +- "character": 5 ++ { ++ "range": { ++ "start": { ++ "line": 5, ++ "character": 0 ++ }, ++ "end": { ++ "line": 5, ++ "character": 3 ++ } ++ }, ++ "rangeLength": 3, ++ "text": "" + }, +- "end": { +- "line": 3, +- "character": 6 ++ { ++ "range": { ++ "start": { ++ "line": 4, ++ "character": 5 ++ }, ++ "end": { ++ "line": 4, ++ "character": 8 ++ } ++ }, ++ "rangeLength": 3, ++ "text": "" ++ }, ++ { ++ "range": { ++ "start": { ++ "line": 3, ++ "character": 9 ++ }, ++ "end": { ++ "line": 4, ++ "character": 4 ++ } ++ }, ++ "rangeLength": 5, ++ "text": "" ++ }, ++ { ++ "range": { ++ "start": { ++ "line": 2, ++ "character": 20 ++ }, ++ "end": { ++ "line": 3, ++ "character": 5 ++ } ++ }, ++ "rangeLength": 6, ++ "text": "" + } +- }, +- "rangeLength": 1, +- "text": "" +- }, +- { +- "range": { ++ ] ++ } ++ }, ++ "wait": [] ++ } ++ }, ++ { ++ "send": { ++ "request": { ++ "jsonrpc": "2.0", ++ "id": 4, ++ "method": "textDocument/rangeFormatting", ++ "params": { ++ "textDocument": { ++ "uri": "$URI{main.adb}" ++ }, ++ "range": { + "start": { +- "line": 2, +- "character": 20 ++ "line": 4, ++ "character": 0 + }, + "end": { +- "line": 3, +- "character": 4 ++ "line": 6, ++ "character": 0 ++ } ++ }, ++ "options": { ++ "insertSpaces": true, ++ "tabSize": 3 ++ } ++ } ++ }, ++ "wait": [ ++ { ++ "id": 4, ++ "result": [ ++ { ++ "range": { ++ "start": { ++ "line": 0, ++ "character": 0 ++ }, ++ "end": { ++ "line": 6, ++ "character": 9 ++ } ++ }, ++ "newText": "procedure Main is\n -- comment\n X : Integer := (1 + 2 + 3);\nbegin\n -- Insert code here.\n null;\nend Main;" + } +- }, +- "rangeLength": 5, +- "text": "" +- } +- ] +- } +- }, +- "wait": [] +- } +- }, +- { +- "send": { +- "request": { +- "jsonrpc": "2.0", +- "id": 4, +- "method": "textDocument/rangeFormatting", +- "params": { +- "textDocument": { +- "uri": "$URI{main.adb}" +- }, +- "range": { +- "start": { +- "line": 4, +- "character": 0 +- }, +- "end": { +- "line": 6, +- "character": 0 +- } +- }, +- "options": { +- "insertSpaces": true, +- "tabSize": 3 +- } +- } +- }, +- "wait": [ +- { +- "id": 4, +- "result": [ +- { +- "range": { +- "start": { +- "line": 4, +- "character": 0 +- }, +- "end": { +- "line": 4, +- "character": 4 +- } +- }, +- "newText": "" +- } +- ] +- } +- ] +- } +- }, +- { +- "send": { +- "request": { +- "jsonrpc": "2.0", +- "id": 5, +- "method": "shutdown" +- }, +- "wait": [ +- { +- "id": 5, +- "result": null +- } +- ] +- } +- }, +- { +- "stop": { +- "exit_code": 0 +- } +- } +-] ++ ] ++ } ++ ] ++ } ++ }, ++ { ++ "send": { ++ "request": { ++ "jsonrpc": "2.0", ++ "id": 5, ++ "method": "shutdown" ++ }, ++ "wait": [ ++ { ++ "id": 5, ++ "result": null ++ } ++ ] ++ } ++ }, ++ { ++ "stop": { ++ "exit_code": 0 ++ } ++ } ++] +\ No newline at end of file +diff --git a/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.json b/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.json +index dbb6eeca..74769937 100644 +--- a/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.json ++++ b/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.json +@@ -156,43 +156,17 @@ + "id": 12, + "result": [ + { +- "range": { +- "start": { +- "line": 4, +- "character": 0 +- }, +- "end": { +- "line": 4, +- "character": 0 +- } +- }, +- "newText": " " +- }, +- { +- "range": { +- "start": { +- "line": 5, +- "character": 0 +- }, +- "end": { +- "line": 5, +- "character": 3 +- } +- }, +- "newText": "" +- }, +- { +- "range": { +- "start": { +- "line": 7, +- "character": 0 +- }, +- "end": { +- "line": 7, +- "character": 3 +- } +- }, +- "newText": "" ++ "range": { ++ "start": { ++ "line": 0, ++ "character": 0 ++ }, ++ "end": { ++ "line": 9, ++ "character": 9 ++ } ++ }, ++ "newText": "procedure Main is\n\nbegin\n declare\n A : Integer;\n begin\n null;\n end;\n\nend Main;" + } + ] + } + +From 4c8c6b56756d3b39aa43a29384343c75843eba46 Mon Sep 17 00:00:00 2001 +From: Anthony Leonardo Gracio <leonardo@adacore.com> +Date: Thu, 6 Oct 2022 14:23:43 +0200 +Subject: [PATCH] V624-007: clear gnatpp's template tables + +This fixes a memory leak. +--- + source/ada/lsp-ada_contexts.adb | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/source/ada/lsp-ada_contexts.adb b/source/ada/lsp-ada_contexts.adb +index 1f09af86..c585252b 100644 +--- a/source/ada/lsp-ada_contexts.adb ++++ b/source/ada/lsp-ada_contexts.adb +@@ -37,6 +37,8 @@ with Langkit_Support.Slocs; + + with Utils.Command_Lines.Common; + ++with Pp.Actions; ++ + package body LSP.Ada_Contexts is + + Indexing_Trace : constant Trace_Handle := Create ("ALS.INDEXING", Off); +@@ -890,8 +892,11 @@ package body LSP.Ada_Contexts is + Self.Source_Dirs.Clear; + Self.Tree := null; + +- -- Destroy GnatPP command line ++ -- Destroy gnatpp's command line + Utils.Command_Lines.Clear (Self.PP_Options); ++ ++ -- Cleanup gnatpp's template tables ++ Pp.Actions.Clear_Template_Tables; + end Free; + + ----------------- + diff --git a/lal.patch b/lal.patch new file mode 100644 index 000000000000..a44bb49b224c --- /dev/null +++ b/lal.patch @@ -0,0 +1,60 @@ +From ac18f3896b86600cd0272d5413bf6285ecd73590 Mon Sep 17 00:00:00 2001 +From: Joao Azevedo <azevedo@adacore.com> +Date: Tue, 20 Dec 2022 09:50:19 +0000 +Subject: [PATCH] Update to latest LAL API for accept statements + +--- + source/ada/lsp-ada_completions-end_names.adb | 2 +- + source/ada/lsp-ada_handlers.adb | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/source/ada/lsp-ada_completions-end_names.adb b/source/ada/lsp-ada_completions-end_names.adb +index 9bb85218a..b1fca333a 100644 +--- a/source/ada/lsp-ada_completions-end_names.adb ++++ b/source/ada/lsp-ada_completions-end_names.adb +@@ -96,7 +96,7 @@ package body LSP.Ada_Completions.End_Names is + when Libadalang.Common.Ada_Accept_Stmt_With_Stmts_Range => + + return VSS.Strings.To_Virtual_String +- (Node.As_Accept_Stmt_With_Stmts.F_Name.Text); ++ (Node.As_Accept_Stmt_With_Stmts.F_Body_Decl.F_Name.Text); + + when Libadalang.Common.Ada_Select_Stmt_Range => + return "select"; +diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb +index ec162fd53..c82850e78 100644 +--- a/source/ada/lsp-ada_handlers.adb ++++ b/source/ada/lsp-ada_handlers.adb +@@ -2618,7 +2618,8 @@ package body LSP.Ada_Handlers is + + if Entry_Decl_Node /= Libadalang.Analysis.No_Entry_Decl then + for Accept_Node of Entry_Decl_Node.P_Accept_Stmts loop +- Append_Location (Response.result, Accept_Node.F_Name); ++ Append_Location ++ (Response.result, Accept_Node.F_Body_Decl.F_Name); + end loop; + end if; + end Resolve_In_Context; +From c9a51bc9565b5ad862db050efa3f7231f53ca779 Mon Sep 17 00:00:00 2001 +From: Anthony Leonardo Gracio <leonardo@.adacore.com> +Date: Wed, 14 Dec 2022 10:24:28 +0000 +Subject: [PATCH] VC14-004: Fix ALS edge builds + +--- + source/ada/lsp-ada_completions.adb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source/ada/lsp-ada_completions.adb b/source/ada/lsp-ada_completions.adb +index 89f751c9..999d7d9c 100644 +--- a/source/ada/lsp-ada_completions.adb ++++ b/source/ada/lsp-ada_completions.adb +@@ -98,7 +98,7 @@ package body LSP.Ada_Completions is + Info : constant Name_Information := Names (Cursor); + Name : constant Libadalang.Analysis.Defining_Name := + Completion_Maps.Key (Cursor); +- Selector : constant Libadalang.Analysis.Single_Tok_Node := ++ Selector : constant Libadalang.Analysis.Name := + Name.P_Relative_Name; + Label : VSS.Strings.Virtual_String; + Canonical : VSS.Strings.Virtual_String; + diff --git a/libadalang-tools.patch b/libadalang-tools.patch deleted file mode 100644 index 1f7c820a9685..000000000000 --- a/libadalang-tools.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: libadalang-tools/Makefile -=================================================================== ---- libadalang-tools.orig/Makefile -+++ libadalang-tools/Makefile -@@ -29,7 +29,7 @@ lib: - for proj in $(LIB_PROJECTS) ; do \ - for kind in $(ALL_LIBRARY_TYPES) ; do \ - rm -f obj/lib/*.lexch; \ -- gprbuild -v -k \ -+ gprbuild -v -aP ../libadalang/build -aP ../langkit/support -k \ - -XLIBRARY_TYPE=$$kind \ - -XBUILD_MODE=$(BUILD_MODE) \ - -P $$proj -p -j$(PROCESSORS) ; \ diff --git a/spawn.patch b/spawn.patch new file mode 100644 index 000000000000..6e583cb14a8f --- /dev/null +++ b/spawn.patch @@ -0,0 +1,63 @@ +From 579b5f9f6655e0403f8ea9ae4ad90ee90b3d88de Mon Sep 17 00:00:00 2001 +From: Maxim Reznik <reznik@adacore.com> +Date: Fri, 23 Dec 2022 14:14:32 +0200 +Subject: [PATCH] Update ALS after changes in Spawn. + +--- + source/client/lsp-raw_clients.adb | 2 +- + source/tester/tester-tests.adb | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/source/client/lsp-raw_clients.adb b/source/client/lsp-raw_clients.adb +index e1b9e7e0..fb6d27c3 100644 +--- a/source/client/lsp-raw_clients.adb ++++ b/source/client/lsp-raw_clients.adb +@@ -71,7 +71,7 @@ package body LSP.Raw_Clients is + + function Is_Server_Running (Self : Raw_Client'Class) return Boolean is + begin +- return Self.Server.Status in Spawn.Processes.Running; ++ return Self.Server.Status in Spawn.Running; + end Is_Server_Running; + + ------------------------------- +diff --git a/source/tester/tester-tests.adb b/source/tester/tester-tests.adb +index 191a479f..2d53c625 100644 +--- a/source/tester/tester-tests.adb ++++ b/source/tester/tester-tests.adb +@@ -204,7 +204,7 @@ package body Tester.Tests is + Self.Send_Message (Text); + + loop +- Spawn.Processes.Monitor_Loop (Timeout => 100); ++ Spawn.Processes.Monitor_Loop (Timeout => 0.1); + exit when GNATCOLL.JSON.Length (Self.Waits) = 0; + + if Ada.Calendar.Clock - Self.Started > Timeout +@@ -408,7 +408,7 @@ package body Tester.Tests is + Listener.Process.Close_Standard_Error; + + loop +- Spawn.Processes.Monitor_Loop (Timeout => 10); ++ Spawn.Processes.Monitor_Loop (Timeout => 0.01); + exit when Listener.Done; + end loop; + +@@ -469,7 +469,7 @@ package body Tester.Tests is + Self.Start; + + loop +- Spawn.Processes.Monitor_Loop (Timeout => 1); ++ Spawn.Processes.Monitor_Loop (Timeout => 0.001); + exit when Self.Is_Server_Running; + end loop; + +@@ -511,7 +511,7 @@ package body Tester.Tests is + end if; + + loop +- Spawn.Processes.Monitor_Loop (Timeout => 1); ++ Spawn.Processes.Monitor_Loop (Timeout => 0.001); + exit when not Self.Is_Server_Running; + end loop; + diff --git a/vss.patch b/vss.patch new file mode 100644 index 000000000000..6d2d60d77a50 --- /dev/null +++ b/vss.patch @@ -0,0 +1,24 @@ +Index: ada_language_server-23.0.12/source/ada/lsp-ada_handlers-file_readers.adb +=================================================================== +--- ada_language_server-23.0.12.orig/source/ada/lsp-ada_handlers-file_readers.adb ++++ ada_language_server-23.0.12/source/ada/lsp-ada_handlers-file_readers.adb +@@ -176,7 +176,7 @@ package body LSP.Ada_Handlers.File_Reade + (Buffer => null, Last => 0); + + begin +- VSS.Strings.Conversions.Set_UTF_8_String (Text, Buffer.all); ++ Buffer.all := VSS.Strings.Conversions.To_UTF_8_String (Text); + + Libadalang.Preprocessing.Preprocess + (Data => Self.Preprocessing_Data, +@@ -219,8 +219,8 @@ package body LSP.Ada_Handlers.File_Reade + First => 1, + Last => Natural (Text.Character_Length)); + +- VSS.Strings.Conversions.Set_Wide_Wide_String +- (Text, Contents.Buffer.all); ++ Contents.Buffer.all := VSS.Strings.Conversions.To_Wide_Wide_String ++ (Text); + end if; + end Read; + |