- Add the base of the Translation_Unit cache API in Language.Libclang
- Add the first implementation of the libclang tree in
Language.Libclang_Tree
- Extend libclang bindings
Change-Id: Ib767acaa81d2933fa0270b103b2133849150457a
The goal is to be able to set it to "-" for languages that have no
object files. This is used to avoid naming collisions when
GNATCOLL.Projects.Library_Files finds a ".*li" file and tries to
find which project it belongs to. For instance, the plugin unicode.py
had the result that the file unicode.ali in the xmlada install was
though to belong to the plugins.gpr project, and thus unicode.ali
was never returned, and thus its cross references never parsed.
This object file suffix can be set either in GPS plugins like
languages.py, or explicitly in project files, which was done here
so that gnatinspect is not confused.
N304-018
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@224037 936e1b1b-40f2-da11-902a-00137254ae57
This package was obsolete and replaced with GNATCOLL.Traces
Exceptions are now sent to "<name>.EXCEPTIONS" streams, and are
always displayed in the testsuite.
Remove a number of exception handlers in gtk+ callbacks, which were
no longer necessary since GtkAda has its own exception handlers.
M910-019
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@215445 936e1b1b-40f2-da11-902a-00137254ae57
Instead, changes are now applied on the fly as soon as one of the
settings is modified.
Remove design/tests/theme.1, since GPS themes are no longer used
anyway.
M617-030
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/branches/global/gtk3/gps@211613 936e1b1b-40f2-da11-902a-00137254ae57
(Character_Added_Hook_Callback): Enable C/C++ completion when '(' is pressed.
* completion/core/src/completion-c-constructs_extractor.ads
(C_Completion_Proposal): Adding flags to the completion proposal to
identify requests of completion with parameters.
(Get_Completion): overridden
(Get_Label): overridden
(To_Completion_Id): overridden
* completion/core/src/completion-c-constructs_extractor.adb
(Get_Completion_Root.Add_Proposal_With_Params): New subprogram.
(Get_Completion_Root.Add_Scope_Proposal): Skip entities associated with
foreign languages.
(Get_Completion): Extended inherited functionality. Needed to handle
functions with parameters and single parameters.
(Get_Label): Generate the label "<entity> without params" when the proposal
requests the completion of the parameters of a subprogram call and the entity
of the proposal has no parameters; generate the label "params of <entity>" when
the proposal requests the completion with parameters and the entity of the
proposal has parameters; otherwise generate the label "<entity>".
(To_Completion_Id): Extend identification of C_Completion_Proposals to
avoid filtering proposals that have the same Name. Required because it
is frequent to have arguments with the same name in different functions.
* cpp_module/src/cpp_semantic_tree.adb
(Parse_Expression_Backward.Handle_Token): Do not stop parsing if the
first token is a left-parenthesis.
* kernel/src_info/entities.ads
Adding documentation.
For KA27-013
[C/C++] Adding smart completion of parameters
This patch extends the functionality of the smart completion of
C and C++ entities. For example, when dynamic smart completion
is enabled and the left parenthesis is entered in the buffer as
part of a function call, GPS suggests the automatic completion
of the parameters of the target functions.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@189727 936e1b1b-40f2-da11-902a-00137254ae57
(Add_Scope_Proposals): Fix bug which added the same proposal several
times to the list of proposals. This bug causes a crash when the
second occurrence of a proposal is removed because its associated
memory is already freed.
* cpp_module/src/cpp_semantic_tree.adb
(Handle_Token): Remove initialization of Stop to False because it
causes missbehavior when trying to complete entities located at
the beginning of a C/C++ file.
* language/src/language-cpp.adb
(Prev_Char): If we arrive to the beginning of the file then set
the values of Index and Word_Begin appropriately to ensure that
the scanner returns the whole text of the first word of the file.
(Scan): Incorporate the underscore as valid suffix of an identifier.
Needed to propose proper completions of entities with Dynamic
Smart Completion support enabled.
Part of KA27-013
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@187746 936e1b1b-40f2-da11-902a-00137254ae57
* cpp_module/src/cpp_semantic_tree.adb
New files
* kernel/src_info/entities.adb
(Is_Container_Array): Adding C++ Class types
* completion/core/completion_core.gpr
Adding dependency on cpp_module
* language/src/language-cpp.ads
(Parse_Tokens_Backward): New overriding subprogram.
(Tok_xxx): New CPP tokens
* language/src/language-cpp.adb
(The_Keywords): New declaration
(Is_Keyword): New subprogram.
(Parse_Tokens_Backward): New overriding subprogram.
* src_editor/src/completion_module.adb
(Auto_Complete_Ada_Keyword): Disable this functionality if the buffer
does not have an Ada source program.
Part of KA27-013
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@187131 936e1b1b-40f2-da11-902a-00137254ae57
(Create_CPP_Handler): Do not launch c++filt subprocess.
* kernel/src_info/ali_parser.ads
(ALI_Handler_Record.Launch_Unmangle_Subprocess): New field.
* kernel/src_info/ali_parser.adb
(Create_Ali_Handler): Add default value of new field.
(CPP_Unmangled_Name): Handle lazy creation of the subprocess executing c++filt
(ALI_Handler_Record.Destroy): Terminate execution of c++filt subprocess.
* kernel/src/gps-kernel.adb
(Kernel_Handle_Record.Destroy): Enable call to remove the language handlers.
Part of K907-014
For KA27-015
[GPS] Launch c++filt lazily
This patch completes the initial implementation of navigation through
entities imported from C++ handling the creation of the c++filt in a
lazy manner (that is, the subprocess c++filt is now only launched if
required).
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@180755 936e1b1b-40f2-da11-902a-00137254ae57
(Create_CPP_Handler): Incorporate in the C++ handler the id of the
subprocess running c++filt (program used to unmangle C++ names).
* kernel/src_info/entities-queries.adb
(Recursive_LI_Information_Iterator.Next): Handle C++ files. These files
were not properly handled because C and C++ share the LI handler.
* kernel/src_info/ali_parser.ads
(ALI_Handler_Record): Adding new field Unmangle_Pd.
* kernel/src_info/ali_parser.adb
(Create_ALI_Handler): Adding null initialization to the new field Unmangle_Pd
(CPP_Unmangled_Name): New subprogram which invokes the process executing
c++filt and returns the unmangled name of a C++ mangled name.
(Process_Entity_Ref): Handle references of entities imported from C++
* language/src/language-cpp.ad[sb]
(Entities_Indexed): Primitive overridden to return True and thus activate
the support for indexing C++ entities in the trie database.
* language/src/language-c.ads
(Entities_Indexed): Complete documentation.
For K907-014
[GPS] GPS 5.2: navigate across language boundary (C++)
This patch incorporates support for navigating in Ada sources
through entities imported from C++. This new feature relies on
the availability of the GNU Binary Utility c++filt to provide
its functionality.
Restriction: Navigation through C++ constructors not supported.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@180629 936e1b1b-40f2-da11-902a-00137254ae57
Remove useless dependency on project "gvd"
* cpp_module/cpp_module.gpr
Remove useless dependency on project "kernel"
Found working in I401-027
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@178236 936e1b1b-40f2-da11-902a-00137254ae57
Code reorganization. No functional change.
For I401-027
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@178235 936e1b1b-40f2-da11-902a-00137254ae57
(Create_CPP_Handler): Adding new parameter for the languages handler.
* cpp_module/src/cpp_module.adb
(Create_CPP_Handler): Store the languages handler in the CPP handler.
(Register_Module): Add new actual when invoking Create_CPP_Handler.
* ada_module/ui/src/ada_module.adb
(Register_Module): Add new actual when invoking Create_ALI_Handler.
* kernel/src_info/ali_parser.ads
(Create_ALI_Handler): Adding new parameter for the languages handler.
(ALI_Handler_Record): Adding new field to store the languages handler.
* kernel/src_info/ali_parser.adb
(Update_ALI): Minor reformating.
(Process_Entity_Ref): Add support for entities imported from C.
(Create_ALI_Handler): Store the languages handler in the ALI handler.
* kernel/src_info/entities.ads
(E_Reference): Adding new component (Is_Imported)
(Add_Reference): Adding new formal (Is_Imported).
(No_E_Reference): Add default value of Is_Imported.
* kernel/src_info/entities.adb
(Set_End_Of_Scope): Initialize new component in aggregates (Is_Imported).
(Add_Reference): Use new formal to initialize the new field (Is_Imported).
* kernel/src_info/entities-queries.adb
(Find_Next_Body): Handle references of imported entities.
Subsidiary updates:
* ada_module/ui/src/ada_semantic_tree-crash_test.adb
* kernel/src_info/tests/test_parse.adb
In both cases the new parameter Lang_Handler must be passed
in calls to Create_CPP_Handler and Create_ALI_Handler.
For I401-027
[GPS] Adding support to navigate across language boundary
This patch adds the minimum functionality needed to navigate
in Ada sources through entities imported from C.
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@177794 936e1b1b-40f2-da11-902a-00137254ae57
(Register_Module, Preferences_Changed): Replace occurrences of
Tab_Width.Get_Pref by call to new function String_Utils.Tab_Width
* cpp_module.adb
(On_Preferences_Changed): Remove initialization of field Tab_Width.
* ada_module.adb
(On_Preferences_Changed): Remove initialization of field Tab_Width.
* gps-kernel-preferences.adb
(Tab_Width): Remove initialization.
* gps-kernel-preferences.ads
(Tab_Width): Removed.
* ada_analyzer.adb
(Tab_Width): Remove this renaming of Indent_Params.Tab_Width.
* language.ads
(Indent_Parameters): Remove field Tab_Width.
(Default_Indent_Parameters): Remove initialization of Tab_Width.
* language.adb
(Format_Buffer): Remove renaming of Indent_Params.Tab_Width.
* c_analyzer.adb
(Analyze_C_Source): Remove renaming of Indent_Params.Tab_Width.
* src_editor_buffer.adb
(Preferences_Changed_Hook_Record.Execute): Replace occurrence of
Tab_Width.Get_Pref by call to String_Utils.Tab_Width.
* gnatpp.adb
(Gnatpp): In calls to Analyze_C_Source and Analyze_Ada_Source remove
initialization of Tab_Width value.
* string_utils.ad[sb]
(Tab_Width): New function.
For K412-013
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@176916 936e1b1b-40f2-da11-902a-00137254ae57
(Analyze_C_Source): Set Indent_Separate_Line according to Indent_Extra.
(C_Indent_Extra): New preference.
Reuse Align_On_Colons to set Indent_Extra for C/C++.
Implements JA22-036
git-svn-id: svn+ssh://svn.eu.adacore.com/Dev/trunk/gps@166257 936e1b1b-40f2-da11-902a-00137254ae57