Axaptapedia is now maintained by AgileCadence For more information please click here.

Difference between revisions of "AxGoToDeclaration"

From Axaptapedia
Jump to: navigation, search
(Download)
(Features)
Line 9: Line 9:
  
 
== Features ==
 
== Features ==
 +
=== Version 1.1.1 ===
 +
New futures 1)view name of variables object, not going to declaration 2) open object in separate window for viewing properties and methods of object 3)Friendly interface
 +
Fixed a small bug with selected variable name parsing.
 
=== Version 1.1.1 ===
 
=== Version 1.1.1 ===
 
Now you can go back to the place that you performed the GoToDeclaration from. (A separate function must be added into EditorScripts for this)
 
Now you can go back to the place that you performed the GoToDeclaration from. (A separate function must be added into EditorScripts for this)

Revision as of 02:57, 29 August 2007

Download

A handy tool for Dynamics Ax Developers

Purpose

Finds the declaration of the selected variable and opens the editor on the line with the declaration

Features

Version 1.1.1

New futures 1)view name of variables object, not going to declaration 2) open object in separate window for viewing properties and methods of object 3)Friendly interface Fixed a small bug with selected variable name parsing.

Version 1.1.1

Now you can go back to the place that you performed the GoToDeclaration from. (A separate function must be added into EditorScripts for this) Fixed a small bug with selected variable name parsing.

Version 1.1

Searches the current method first. If the declaration is not found, goes to the root of the object and looks in the classDeclaration method. If still not found, continues on with the parent of the class.

Installation

  • Import the xpo project. (contains 3 classes)
  • Recompile all (in case of errors)
  • Add the following code as a method into the EditorScripts class

<xpp> void AOT_goToDeclaration(Editor e) {

   AxGoToDeclaration   goToDeclEngine;
   ;
   infolog.globalCache().set("AxGoToDeclarationSource", "source_editor", e);
   goToDeclEngine = new AxGoToDeclaration(e);
   goToDeclEngine.goToDeclaration();

}</xpp>

  • Add the following code as a method into the EditorScripts class

<xpp> void AOT_goToDeclarationBack(Editor e) {

   AxGoToDeclarationGoBack   goToDeclGoBackEngine;
   ;
   AxGoToDeclarationGoBack::main(new Args());

}</xpp>

User Guide

There is not much to describe. Just select the variable, right click, select Scripts\AOT\goToDeclaration and you are done. if the declaration of the selected variable is found, you will be moved to the corresponding line in the editor.

Known Issues (small inconveniences)

  • ParserClass does not parse the constructor (new) method. So variable declarations cannot be found from this method.
  • Does not find variables this, element, etc.
  • Does not find objects with AutoDeclaration set to Yes on forms, nor the datasources
  • Does not find variable declarations that are not secure, for example like the following:

<xpp> class Class1 {

   Class2  classVar, classVar2;

} </xpp> ClassVar2 will not be found. (It is insecure because if you declare a class names classVar2, than the compilation of class1 will fail)

Plans for upgrade (Suggestions)

  • Open AOT objects when this or element is selected (table, class, form, etc)
  • Open AOT objects with the property sheet for objects with AutoDeclaration = Yes
  • Include global classes into the search

Thanks

  • AndyD - for the timer AOT edit code and the selectedLine method modifications
  • Max Belugin - for ParserClass_class descripton
  • Alex55 - for the idea and basic implementation of AxGoToDeclarationGoBack class

See also

Editor_scripts_OpenInAOT - Another Editor script for developers