Home
TypeRex user manual
Contents
1. 2 2 4 Comment definition C 0c 2 3 Refactoring OCaml code with 231 undo RS urn RO BERG Zoe Renaming Bar Voll oos aa Hed ee Rea ee 020 Relerence pruning dE so oka ec bk 4x oe eee ene x 2 3 4 Open elimination q for qualify 24 POOP ee ko eR cR Ee eher 20 Autocompletion a a RE e d 2 6 TypeRex assumptions and supported code DL Preprocessors IE d O00000000 I1 1 1 1 1 CONTENTS 26 2 Module u ex za e RR ehem 19 2 6 3 Dealing with outdated binary annotations 20 2 6 4 Permissive 20 27 Recovery and debugging 2 3 6 2662 bee grs 20 TypeRex tools 23 SL oo ATE 23 mo SERIE on ea a AK AR Peut oa 23 Common issues and questions 25 UE AAA es cas ad GU a a A m b RC A ht DAR 25 4 2 Project setup building annotations 26 ta Browsing and relactorinhg 22 242 er ARA 26 Of BUDE III 27 Ao ee Dew ER en deos 27 Chapter 1 TypeRex setup This chapter describes the process of installing and configuring TypeRex from the sources on a Unix environment with OCaml already installed 1 1 TypeRex distribution and supported environments 1 1 1 System requirements e Linux 32 bit or 64 bit or MacOS tested with 10 6 8 e OCaml gt 3 11 2 e Emacs Tested with 23
2. but is still experimental and with the limitation that goto does not go through packs while grep does as for include directives 20 CHAPTER 2 TYPEREX DEVELOPMENT ENVIRONMENT FOR EMACS 2 6 3 Dealing with outdated binary annotations TypeRex is usually able to overcome sparse changes to the edited files saved or not w r t the last compiled version and to recompute the right positions This feature relies on the source snapshots which are embedded in cmt files This works also for refactoring commands but in this case a confirmation will be asked before proceeding 2 6 4 Permissive behavior Some internal errors which could occur while processing some files for example due to unhandled language features may be caught and reported to the user asking for a con firmation in the case of refactoring This avoids giving up too soon on errors which are clearly harmless to a specific action 2 7 Recovery and debugging Except for restarting the server this section is more intended to developing and debugging TypeRex Errors and server restart If the OCP server crashes for any reason or becomes crazy it is possible to restart it using M x ocp restart server Logging First the TypeRex environment for Emacs will echo minimal information as messages in the mini buffer the history of which is kept in the special buffer Messages This includes the startup procedure feedback about the executed commands and in case of
3. also suffers from some thresholds which are introduced to keep it responsive enough 4 5 Auto completion Completion is inaccurate for definitions in the current buffer The current implementation of completion is semantic for external compilation units i e with a cmt i or cmi but only lexical for the current buffer so this is expected Completion stops working We still have to spot the cause of this problem Reverting the current buffer with M x revert buffer after saving the file of course should bring it back 28 CHAPTER 4 COMMON ISSUES AND QUESTIONS Emacs deadlocks This is a known bug which sometimes happen when typing during a buffer s initialization The solution is to run killall ocp wizard to kill the TypeRex server process which unlocks Emacs and then restart it from the TypeRex menu
4. and supported code 2 6 1 Preprocessors The browsing commands of TypeRex support ocamlyacc ocamllex sources and should work with other pre processors which generate OCaml source files with appropriate line numbers directives More precisely the identifiers in a pre processed source file which are actual identifiers of the source i e not generated or transformed during pre processing should be OK to grep or jump from and to if no generated code has the same location For ocamlyacc and ocamllex files these actual identifiers correspond to the quoted OCaml code between braces Jumping to ocamlyacc entry points is not supported how ever because the generated interface has no line number directives Renaming may work in pre processed or ocamllex ocamlyacc source files but has not been thoroughly tested Other refactoring commands won t work on ocamlyacc ocamllex sources The camlp4 pre processor version 3 12 1 is supported but only partially because its output is an ast which has insufficient location information or a source file but without line numbers directives ocp type or ocp wrapper can generate binary annotations with camlp4 but the result of TypeRex commands will sometimes be inaccurate on camlp4 processed sources in particular renaming should only be attempted for local or unexported value bindings 2 6 2 Module packs Module packing is supported to the extent of its treatment in the project description see above
5. gt lt dirs gt white space separated list of directories lt files gt white space separated list of ml mli mll and mly files Relative directory names are interpreted with respect to the directory containing the project file typerex and the project directory itself may be denoted by but the shortcuts and user are not supported Note that lt prefix gt is a shorthand for lt prefix gt ml lt prefix gt mli See typerex in the TypeRex root directory for an example Meaning of project and library directories Lines starting with I indicate that the specified directories are considered as library and not as project s directories The meaning of this distinction which may change in the future is currently the following e All source files ml mli mll mly in a project directory are considered whether they have corresponding compiled files cmi cmti cmt or not while compiled files without sources are ignored This is exactly the opposite for libraries all cmi cmti cmt are considered and uncompiled sources are simply ignored e Refactoring and browsing stops at the boundary of libraries and no binding prop agation is performed on the implementation of libraries see the documentation for renaming and grep This saves some computation time and is sound unless a library depends on the program but the same question arises when the considered program is meant to be a library Pac
6. module is opened again inside one of the items in the elimination scope sub modules let open and M but a duplicate open at the same level will be correctly handled 2 4 Syntax coloring TypeRex implements its own version of syntax coloring It is not yet fully stable but already has some new features such as the inline marking of lexing errors with help info and a smarter treatment of unterminated strings and comments Syntax coloring is not specialized for ocamlyacc ocamllex files but will usually give an acceptable result except for C style comments 2 5 AUTO COMPLETION 19 2 5 Auto completion An experimental completion feature is proposed in typerex currently only for identifiers including methods tags labels and type variables Once enabled a menu of candidates is triggered when typing test or with the appropriate key lt gt by default which also completes the longest common prefix Other keys allow to select a candidate and insert it lt C n gt lt C p gt and lt gt by default or to cycle between them with TAB see the Auto Complete Mode user manual The candidates computation takes into account the load path which is configured for the project the open and include statements and unqualified identifiers until the current position in the edited file in a very approximative and simplistic way and the module qualification possibly prefixing the identifier to be completed 2 6 TypeRex assumptions
7. the Tuareg mode are also included even when we provide an equivalent of them 4 Feedback Please report any bugs unexpected behavior or unclear documentation through the Github issue tracker at https github com OCamlPro typerex issues Please let us know also about your most wanted features so that we can optimize our agenda Contents 1 TypeRex setup 1 1 TypeRex distribution and supported environments 111 System requirements 112 Obtaining Tepe 1 oe 2 rec x akt LS Tui DNE oc aus ai a Da a ass a 121 Bula 222 242 9 4 b Ru eine LAS oia to AS o SUR ee EE S 123 IDEE sia ara ar O Pan 12 4 Testing the environment s i o lt s oessa roes x RR ex 1 3 TypeRex configuration optional lt lt lt sa ces ee curer tiare na 1 31 TypeRex contextual x a ses ar er ee 1 3 2 TypeRex syntax coloting cocos coreo 133 Auto completion 1 3 4 Reconfiguring paths 2 2 2 2 ss cse ooo ea wee 2 TypeRex development environment for Emacs 2 1 TypeRex environment 211 Generating mi Hed o ecr coear eom dE ea bosi 212 Project riet r os e iyoda rias OEE SH 2 2 Browsing OCaml code with 221 up Is Lai he kb eee eee ee eee eee ee 222 Goto definition 223 Cycle definitions
8. through Emacs customizable variables and can be changed in two ways e By directly editing the emacs file to change the values e Through the Emacs customization mechanism by choosing Customize TypeRex Mode under the TypeRex Menu Remember to check your emacs for duplicate variable customization because setq assignments are ignored when updating the custom set variables expression Also note that many changes require restarting Emacs to become effective or at least running M x ocp restart server 1 3 TYPEREX CONFIGURATION OPTIONAL 9 1 3 1 TypeRex contextual menu The contextual menu can be enabled when right cliking it offers the same actions as the keyboard shortcuts Uncomment to enable typerex command menu by right click setq ocp menu trigger mouse 3 1 3 2 TypeRex syntax coloring By default TypeRex proposes a new syntax coloration for OCaml source files You may disable it by setting ocp syntax coloring to nil instead of t Alternatively you can change the coloring theme to look almost like Tuareg mode with minor improvements and differences by setting ocp theme to tuareg like 1 3 3 Auto completion A still very primitive contextual identifier completion feature is provided relying on the Emacs Auto Complete Mode written by Tomohiro Matsuyama It can be enabled by uncommenting the following lines in emacs AutoComplete add to list load path usr local share emacs site lisp auto compl
9. to the shell to launch the server is defined by the variable ocp server command You can use it for example to pass a particular OCAMLLIB environment variable see bellow to the server In a standard setup the cor responding line in emacs append is also not required as the default value is the executable base name and is searched in the path OCaml standard library Most TypeRex executables most notably the server need to access the OCaml standard library at runtime They look at the following options in decreasing priority order to determine the appropriate directory 1 3 TYPEREX CONFIGURATION OPTIONAL OCAMLLIB environment variable CAMLLIB environment variable option ocamllib in ocp ocaml conf the value determined by the configure script when building typerex 11 12 CHAPTER 1 TYPEREX SETUP Chapter 2 TypeRex development environment for Emacs This chapter explains how to enable and use the TypeRex environment for editing an OCaml program 2 1 TypeRex environment setup Using the TypeRex environment for an OCaml project requires two configuration steps en suring the generation of required binary annotations and providing a minimal description of the project s paths Those steps are detailed in the following Keeping binary annotations up to date The binary annotations must be up to date for TypeRex to function properly in particular for refactoring and these annotations are not updated
10. toolchain typerex ocamlc Using a separate build process Alternatively ocp type provides a file Makefile ocp type template which is able to perform the ocp type compilation automatically for simple projects 2 1 2 Project configuration Most functionalities of TypeRex rely on some knowledge of the edited program source files libraries which should be specified in one of the following ways 2 1 TYPEREX ENVIRONMENT SETUP 15 typerex file TypeRex may use a very simple configuration file to know about a project s directories and libraries When it is invoked on a source file file ml it looks for file typerex in the directory containing lt file ml gt or its parent directories back to the file system s root This file should specify the set of directories to search for OCaml source files and the set of directories to include in the load path e libraries It is also possible to exclude some source files or whole compilation units The syntax of the typerex file is as follows lt project file gt lt line gt file must end with a newline lt line gt lt dirs gt add all contained source files non recursive I lt dirs gt include lt dirs gt as external libraries lt dir gt means lt stdlib gt lt dir gt lt files gt ignore these source files CMT lt dir gt search cmt i s here instead of in source dir NOSTDLIB do not include the standard library path lt comment
11. unexpected error which is a bug a complete exception backtrace You may enable logging of debug information in ocp wizard log by setting the ocp debug variable to t the trace will be huge and hard to read The value of ocp debug may also be a string which is a comma separated list without whitespace of uncapitalized module names in the TypeRex code Fail fast In the context of debugging it is usually easier to disable most exception handling to get a backtrace closer to the real problem This can be done by setting ocp dont catch errors to t Note however that this will lead TypeRex to fail in cases which would normally have triggered tolerant behavior 2 7 RECOVERY AND DEBUGGING 21 Profiling TypeRex may dump profile information in ocp wizard profile out if ocp profile is set to the name of a TypeRex command see tools ocp wizard main owzServer ml Run profile ocp wizard profile out to generate a dot file note that profile is not compiled or installed by default 22 CHAPTER 2 TYPEREX DEVELOPMENT ENVIRONMENT FOR EMACS Chapter 3 TypeRex tools This chapter summarizes the command line tools which are provided together with the TypeRex environment 3 1 ocp type The ocp type command line tool is the type only OCaml compiler which is used to extract the binary annotations needed by the TypeRex environment It may be invoked directly or through the ocp wrapper tools see below It accepts the same options
12. 2 1 does not work under X Emacs reported to work with Aquamacs 1 1 2 Obtaining TypeRex We recommend using the compressed archive distribution of TypeRex Source archive All versions of TypeRex can be found at http www typerex org 1 2 Installation 1 2 1 Build configuration 1 configure options Useful options examples 8 CHAPTER 1 TYPEREX SETUP bindir opt typerex with lispdir emacs d default is a system wide installation path with ocp build lt command gt default is ocp build if found pwd boot ocp build boot otherwise disable auto complete default is to install Emacs auto complete unless found in lispdir enable cmt binary annotate typerex sources for typerex developpers You may also specify an EMACS variable as 1 configure options EMACS aquamacs 1 2 2 Building 2 make 1 2 3 Installation 3 sudo make install Append the contents of emacs append to your emacs 4 cat emacs append gt gt emacs or paste the contents where you like The next section shows how to customize this Emacs configuration in order to handle non standard settings and to fine tune various TypeRex options 1 2 4 Testing the environment Open a ml file inside emacs and switch to the Messages buffer If you see the line Connection established with TypeRex server the installation is OK 1 3 TypeRex configuration optional The following additional configuration is done
13. TypeRex user manual OCamlPro February 22 2012 This manual presents the usage of TypeRex a development environment and toolbox for OCaml developped by OCamlPro and Inria lwith support from the Campus Paris Saclay fundation Introduction We present a new development environment which improves what was previously available for OCaml by bringing some of the features which are considered classic in editors for mainstream programming languages The TypeRex environment for Emacs is written in OCaml and relies on parts of the OCaml compiler to provide a more accurate semantic view of the OCaml programs which are edited enabling a set of specific commands and behaviors A few additional tools are provided together with the TypeRex environment which mostly serve to perform the necessary specific processing on the edited programs namely provide appropriate binary annotations about the source files Summary of TypeRex features e Improved syntax coloring e Auto completion of identifiers experimental e Browsing of identifiers show type and comment go to definition cycle between alternate definitions and semantic grep e Strictly semantic preserving local and whole program refactoring renaming identifiers and compilation units open elimination and reference simplification e Robust w r t not recompiled possibly unsaved buffers e Scalable used regularly on a few hundreds of source files All the features of
14. and arguments as ocamlc and the specific option save types to actually write the binary data to a file Pre processing ocp type also accepts pre processors through the pp option which should output either e an OCaml source file if possible with line number directives to allow an accurate use of TypeRex or e an OCaml dumped AST of one of the supported versions this is the default behavior of camlp4 or e Camlp4 dumped AST of one of the supported versions which can be achieved by passing the option printer Camlp4AstDumper to camlp4 this is done automatically if you use ocp wrapper Note that the third option is better than the second one with respect to locations the accuracy of which is instrumental to TypeRex working 3 2 OCp wrapper The command ocp wrapper and the specialized commands ocp ocamlc ocp ocamlopt ocp ocamlc opt and ocp ocamlopt opt simplify the generation of binary annotations 23 24 CHAPTER 3 TYPEREX TOOLS by invoking ocp type with the appropriate options as part of the usual compilation com mands Calling ocp wrapper save types command options and arguments where command is one of the OCaml compilers first invokes this compiler with the exact same options and arguments and then runs ocp type unless the command line was a linking only phase with the right options and arguments which are deduced from the original command ones Shortcuts The four ocp commands are short
15. by TypeRex itself This implies that successive refactoring actions require a recompilation of the impacted part of the program at each step 2 1 1 Generating cmt i files The most simple way of generating binary annotations is to setup your build process to use the provided ocp versions of the OCaml compilers for example ocp ocamlc opt instead of ocamlc opt These are wrappers which behave as the original compilers but additionally run ocp type on the sources In some cases a more expressive solution is required which consists in prefixing the compiler commands with ocp wrapper save types with specific arguments see chapter ools for more details Here are examples of how to achieve this depending on your build system 13 14 CHAPTER 2 TYPEREX DEVELOPMENT ENVIRONMENT FOR EMACS make Use as compiler a variable defined by OCAMLC ocp ocamlc opt or OCAMLC ocp wrapper save types lt other options gt ocamlc opt ocamlbuild Add Options ocamlc S A ocp ocamlc or Options ocamlc S A ocp wrapper A save types A ocamlc to your myocamlbuild ml file ocamlfind without ocamlbuild Add ocamlc ocp ocamlc opt or ocamlc typerex ocp ocamlc opt to your etc findlib conf or ocamlfind conf or the file pointed to by 0CAMLFIND CONF The first option tells ocamlfind to use ocp wrapper globally the second defines a tool chain typerex which you then specify by calling ocamlfind
16. cuts for ocp wrapper save types command which are useful when a single executable program is required as compiling command Options e with ocp type with ocamlc allow to customize the ocp type ocamlc commands which are run e v print the ocp type command which is executed on stderr Pre processing Any pp option appearing in the command line is transformed as follows when passed to ocp type e if the pre processor command is a variant of cam1p4 then the option printer Camlp4AstDumper is added which yields more accurate location information e otherwise the command is left unchanged Chapter 4 Common issues and questions 4 1 General Reporting bugs Bugs reports should be sent through the issue tracker at https github com 0CamlPro typerex issues or by mail If the problem is an uncaught exception of the form Error make sure to provide the full backtrace available in the Messages buffer In addition to the action which triggered the problem an accurate description of your code and configuration will be helpful especially for a wrong result for example incomplete What about other editors and operating systems Eclipse support is planed in a near future Some people have also expressed interest in VIM support so we pay attention to this too Windows support is also planed there may not be a lot of work to do for that How does it compare to other similar tools Many oth
17. er tools exist to improve the development in OCaml and it is not possible to describe each of them here Generally we believe the refactoring and semantic grep capa bilities of TypeRex to be the most advanced except for the particular case of Oug whose very expressive graph description allows similar queries Identifier querying is slightly more powerful and robust than its equivalents in e g Tuareg OCamlSpotter or OcaIDE with some minor differences in user interface choices TypeRex does not yet have graph ical summaries as in ODT or OCaIDE or build management Syntax coloring is more detailed and systematic than other solutions Auto completion is currently restricted to identifiers and very approximate for local identifiers and does not support syntactic con structs such as pattern matching as was proposed in OcamlWizard and the latest version 25 26 CHAPTER 4 COMMON ISSUES AND QUESTIONS of OCamlSpotter but it is already quite accurate and responsive on identifiers defined in other modules 4 2 Project setup building annotations Findlib configuration does not work We are investigating possible issues with findlib itself What are cmt i files exactly required for The binary annotations provide a semantic descriptions of type able source code together with accurate location information They are used to know about binding in a large sense for example applying a functor to an argument somehow binds the fu
18. ete mode setq ocp auto complete t Using lt gt to complete whatever the context and lt C gt for setq auto complete keys ac keys backquote backslash I want immediate menu pop up setq ac auto show menu 0 Short delay before showing help setq ac quick help delay 0 3 Uncomment to disable help showing setq ac use quick help nil Number of characters required to start nil to disable setq ac auto start 0 If you like auto completion you can enable it for all supported modes using dictionar ies 3333 Uncomment to enable auto complete mode globally independently of OCaml require auto complete config add to list ac dictionary directories 25 usr local share emacs site lisp auto complete mode ac dict ac config default Warning Do not set a black background using M x invert face default when using auto completion instead start Emacs with emacs r 10 CHAPTER 1 TYPEREX SETUP Auto completion keys Changing the default keys and behavior can be useful to fit the user s habits For exam ple the provided configuration ac keys backquote backslash keeps normal behavior of TAB RET up and down and uses respectively lt gt X lt C p gt and lt C up gt instead remapping to lt C gt On some keyboards lt gt and lt gt may be more appropriate than lt gt lt gt This is achieved by setting auto complete k
19. eys to ac keys two dollar Setting auto complete keys to nil will use the default auto complete configuration that 15 with TAB RET up and down Alternatively one may want to use all standard keys but with auto start disabled and using a specific trigger key Standard keys but starting only with C TAB and no auto start setq ac auto start nil setq auto complete keys ac keys default start with c tab Finally you can also define a customized ac keys function by looking at the imple mentation of predefined ones or set the auto complete configuration variables directly but then make sure to set auto complete keys to nil See the Auto Complete Mode user manual for more details on the corresponding configuration 1 3 4 Reconfiguring paths The values of all the paths described in the following are determined at configure time so normally you should not need to change them unless you didn t perform the install step Emacs lisp directory The directory in which the TypeRex and auto complete lisp code is searched for is config ured by the add to list load path line in emacs append Note that if you ran configure with default options the value should be usr local share emacs site lisp which is in the default load path so this line is probably even not required TypeRex server command The TypeRex development environment is implemented by means of a server which is launched by Emacs The command which is fed
20. guration problem check your typerex 4 4 SYNTAX COLORING 27 Grep Cycle and renaming sometimes lag These command can take up to several seconds on large projects because some compu tations have to be done over the whole code Most of it is cached though to speed up subsequent invocations caching should be correctly invalidated on a cmt file basis Goto definition fails but Grep finds the definition This is expected if the identifier comes from for example an included module or a pack module more generally if the identifier is internally renamed by the OCaml compiler during type inference The grep or renaming algorithm takes these renamings into account to collect the full set of relevant identifiers so it is currently more powerful Locations are shifted TypeRex complains about unsaved files TypeRex uses the Emacs auto save mechanism to know about modified buffers so that it can usually re align shifted positions correctly This is not a perfect solution though and in particular possible auto save files file m1 from older sessions will confuse TypeRex if they are more recent than the file itself In this case you should delete them 4 4 Syntax coloring Coloring is sometimes inaccurate The current implementation has exact lexing information but only uses heuristics for ap proximate syntax computation because it needs to work for syntaxically incorrect buffers This solution is not perfect and
21. k modules experimental Pack modules are understood by TypeRex if the source directories contain either a file e pack mlpack in the ocamlbuild format a list of module names possibly qualified using by a path relative to the directory containing the pack mlpack file or 16 CHAPTER 2 TYPEREX DEVELOPMENT ENVIRONMENT FOR EMACS e pack cmt whose contents is a pack module such as generated by ocp type pack This option only works if the packed modules are in the same directory as the resulting pack CMT lt dir gt syntax It is possible to specify a CMT directory to search for cmt i files when they are not found at the same place as the source files This is needed if the build system moves the files around but then if several modules in different directories have the same name then outdated cmts won t be assigned unless there only is one matching with the source digest to resolve ambiguity Fallback If no specific configuration is provided TypeRex considers as program the set of OCaml source files present in the directory containing the edited source file with no libraries other than the OCaml stdlib 2 2 Browsing OCaml code with TypeRex Note on browsing commands Each cursor motion incurred by a browsing action except when clicking on grep results is undoable with the standard Emacs shortcut C b 2 2 1 Grep C o g C o t g C o g display a click able list compile minor mode of the connected definitions a
22. nctor s parameter s signature members to the actual argument s members Navigation and grep will only range over binary annotated code which can generally depend on libraries without requiring annotations for them as long as cmi files are available with some loss of completeness though Completion can use cmi or cmt i files but the latter and access to the source code will enable comment showing Syntax coloring does not require any annotation at all of course How to enable TypeRex for developping the OCaml compiler Just copy this patch into the main directory and run patch p0 i ocaml typerex patch then rebuild the compiler starting from the standard library mandatory make clean make world Please note the following limitations e ocp type will fail on camlp4 except for version 3 12 1 for binary compatibility rea sons This does not impact the use of TypeRex for the remaining of the compiler e Including Camlp4 in the program is currently not possible e Generated files other than ocamllex ocamlyacc are not detected so don t expect a fully automatic renaming of e g List iter e The Dynlinkaux pack module is not correctly understood by TypeRex because its components are in another directory 4 3 Browsing and refactoring module value x not found in load path This means that some identifiers could not be resolved and can occur in many situations For a toplevel module this probably means a confi
23. nd occurrences of the identifier under the cursor Invocation is the same as for renaming Use C o t g to grep the top level module defined by the current file instead of an identifier 2 2 2 Goto definition C o d Places the cursor on the definition of the identifier under the cursor opening the appro priate file in the current window if necessary 2 2 3 Cycle definitions C o a Places the cursor on an alternate definition of the identifier declaration under the cursor opening the appropriate file in the current window if necessary The typical effect is to switch between ml and mli files but at the right place This may be used only for top level let bindings i e and not let in external statements type declarations exception declarations and recursive module and module type declarations 2 3 REFACTORING OCAML CODE WITH TYPEREX 17 2 2 4 Comment definition c Display a description of the identifier under the cursor with its lookup path and any comments associated with it in the sense of OCamldoc The description is e the type for a value or field e the type declaration for a type constructor e the argument types or constant for a constructor or exception e the module type for a module or module type 2 3 Refactoring OCaml code with TypeRex Note on reverting and undoing For all refactoring actions the reverting of modified buffers and the undoing take one of the two following mode
24. plemented for values types modules non recursive module types fields constructors and exceptions Aa a convenience a partial unsound renaming of classes and class types is supported but will miss all references to the secondary bindings of a class or class type t e the closed and open types and for a class the class type Type variables instance variable methods argument labels and polymorphic variants are not supported The replacement is intended to be complete up to the following known bugs e labels e g renaming x in let x in f x yields f y instead of f x y and similarly with fun x gt e renaming a type which is in fact a class or a class type or such that its renaming propagates to one through module constraints and functor applications will not rename the class or class type itself or its references Note also the following limitation e including a module where an element is renamed with an afterwards masked name causes a capture error 2 3 3 Reference pruning C o p Simplify the identifier references longidents by removing unnecessary qualification This operation ranges on the current buffer 2 3 4 Open elimination C o q for qualify Remove if possible the open statement under the cursor and qualify the subsequent references as required the let open in syntax is also supported by open elimination This operation is currently slightly conservative when the same
25. s e If the modification is local to the current buffer then it is reverted while keeping its history and renamed if needed This enables undoing with the standard emacs shortcut C _ e If several files are modified then all relevant buffers are reverted and their local undo lists are cleared Instead the multiple file modification is added to a global undo list and can only be undone with C o u A call to C o u is also pushed onto the local undo lists of all modified buffers for convenience so that C _ will also work 2 3 1 Multiple file undo C o u Undo the last multiple file modification Warning This discards any subsequent modifi cation of the affected files a confirmation is asked in this case All buffers editing one of the affected files are reverted and their local undo lists are cleared and then receive a single new global undo item 2 3 2 Renaming C o r C o t r Rename an identifier through an OCaml program C o r The cursor must be placed on an identifier definition or reference for example a let binding or a pattern 18 CHAPTER 2 TYPEREX DEVELOPMENT ENVIRONMENT FOR EMACS C o t r Rename the top level module defined by the current file instead of an identifier Renaming takes care of necessary propagation e g when distinct values with the same name need to be renamed consistently because this name appears in a common interface and capture is detected Renaming is im
Download Pdf Manuals
Related Search
Related Contents
ASUS B451JA G9582 User's Manual Braun Photo Technik SPLASH Einbau- und Bedienungsanleitung StarCom1 Digital Compost - Grupo Dorta COLPOSCOPIO COLPY COLPY COLPOSCOPE "取扱説明書" 橡 ページ) I Qualité de vie BR-5100 BETRIEBSANLEITUNG Copyright © All rights reserved.
Failed to retrieve file