Home Explore Blog CI



neovim

2nd chunk of `runtime/doc/ft_ada.txt`
53ac4bec70862dc83e5077e0f3889bb4448ea2c6b19918da0000000100000fa5
	(|tagsrch.txt|)
 - Quick Fix		(|quickfix.txt|)
 - backspace handling	(|'backspace'|)
 - comment handling	(|'comments'|, |'commentstring'|)

The plug-in only activates the features of the Ada mode whenever an Ada
file is opened and adds Ada related entries to the main and pop-up menu.

==============================================================================
3. Omni Completion ~
								 *ft-ada-omni*

The Ada omni-completions (|i_CTRL-X_CTRL-O|) uses tags database created either
by "gnat xref -v" or the "Universal Ctags" (https://ctags.io).  The complete
function will automatically detect which tool was used to create the tags
file.

------------------------------------------------------------------------------
3.1 Omni Completion with "gnat xref" ~
								   *gnat-xref*

GNAT XREF uses the compiler internal information (ali-files) to produce the
tags file. This has the advantage to be 100% correct and the option of deep
nested analysis. However the code must compile, the generator is quite
slow and the created tags file contains only the basic Ctags information for
each entry - not enough for some of the more advanced Vim code browser
plug-ins.

NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
       output - If nothing is printed then usually the parameters are wrong.
       Here some important tips:

1)  You need to compile your code first and use the "-aO" option to point to
    your .ali files.
2)  "gnat xref -v ../Include/adacl.ads" won't work - use  the "gnat xref -v
    -aI../Include adacl.ads" instead.
3)  `gnat xref -v -aI../Include *.ad?` won't work - use "cd ../Include" and
    then `gnat xref -v *.ad?`
4)  Project manager support is completely broken - don't even try "gnat xref
    -Padacl.gpr".
5)  Vim is faster when the tags file is sorted - use "sort --unique
    --ignore-case --output=tags tags" .
6)  Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark
    the file assorted.

------------------------------------------------------------------------------
3.2 Omni Completion with "ctags"~
								   *ada-ctags*

Universal/Exuberant Ctags use their own multi-language code parser.  The
parser is quite fast, produces a lot of extra information and can run on files
which currently do not compile.

There are also lots of other Vim-tools which use Universal/Exuberant Ctags.
Universal Ctags is preferred, Exuberant Ctags is no longer being developed.

You will need to install Universal Ctags which is available from
https://ctags.io

The Ada parser for Universal/Exuberant Ctags is fairly new - don't expect
complete support yet.

==============================================================================
4. Compiler Support ~
								*ada-compiler*

The Ada mode supports more than one Ada compiler and will automatically load the
compiler set in |g:ada_default_compiler| whenever an Ada source is opened. The
provided compiler plug-ins are split into the actual compiler plug-in and a
collection of support functions and variables. This allows the easy
development of specialized compiler plug-ins fine tuned to your development
environment.

------------------------------------------------------------------------------
4.1 GNAT ~
							       *compiler-gnat*

GNAT is the only free (beer and speech) Ada compiler available. There are
several versions available which differ in the licence terms used.

The GNAT compiler plug-in will perform a compile on pressing <F7> and then
immediately shows the result. You can set the project file to be used by
setting: >
		call g:gnat.Set_Project_File ('my_project.gpr')
<
Setting a project file will also create a Vim session (|views-sessions|) so -
like with the GPS - opened files, window positions etc. will be remembered
separately for all projects.

								*gnat_members*
GNAT OBJECT ~

							       *g:gnat.Make()*
g:gnat.Make()
		Calls |g:gnat.Make_Command| and displays the result inside a
		|quickfix| window.

							     *g:gnat.Pretty()*

Title: ADA File Type Plugins: Omni Completion and Compiler Support
Summary
This section covers the Ada file type plugin's features, focusing on Omni Completion and Compiler Support. It details the usage of tag databases created by 'gnat xref -v' or 'Universal Ctags' for omni-completion functionality, along with tips and considerations for using 'gnat xref'. It also describes the Universal/Exuberant Ctags approach. Compiler support is discussed, mentioning the ability to automatically load a compiler based on |g:ada_default_compiler|, with GNAT being highlighted as a free Ada compiler. The GNAT compiler plugin allows compilation via <F7> and supports project file settings. Key GNAT object functions like g:gnat.Make() are mentioned for compiling and displaying results in a quickfix window.