createSyntaxFile            package:svIDE            R Documentation

_C_r_e_a_t_e _a _s_y_n_t_a_x _d_e_f_i_n_i_t_i_o_n _o_r _a _c_a_l_l_t_i_p _f_i_l_e _f_o_r _R _l_a_n_g_u_a_g_e

_D_e_s_c_r_i_p_t_i_o_n:

     A .svl syntax file describes the syntax of the language for
     SciViews GUIs. It is used mainly for syntax coloring of text in
     editors. The calltip file (by default, Rcalltips.txt) is a
     database with formal calls of R functions, to be used by code
     editors to display function calltips.

_U_s_a_g_e:

     createSyntaxFile(svlfile = "R.svl", pos = 2:length(search()))
     createCallTipFile(file = "Rcalltips.txt", pos = 2:length(search()),
         field.sep = "=", only.args = FALSE, return.location = FALSE)

_A_r_g_u_m_e_n_t_s:

 svlfile: The name or location of the .svl file you want to create 

    file: The name or location of the calltip file you want to create 

     pos: A vector of integers indicating which positions in the search
          path should be recorded in the file 

field.sep: The field separator to use between the function name and its
          calltip in the file 

only.args: Do we record the full calltip ('myfun(arg1, arg2 = TRUE,
          ...)'), or only the function arguments ('arg1, arg2, ...') 

return.location: When 'TRUE', the package where this function is
          located in returned between square brackets at the end of the
          line 

_V_a_l_u_e:

     These functions return nothing. They are invoked for their side
     effects of creating a file.

_N_o_t_e:

     SciViews-R uses a file named 'R.svl' and located in
     <SciViewsDir>/bin/languages. This function generates such a file.
     Do resist to the temptation to generate a very long list of
     keywords by loading many packages. SciViews cannot handle a list
     longer that 32k, that is roughly, 2000 - 2500 keywords.

     'createCallTipFile()' sometimes issues warnings because it cannot
     get arguments from some keywords. You can ignore these warnings.

_A_u_t_h_o_r(_s):

     Philippe Grosjean <phgrosjean@sciviews.org>

_S_e_e _A_l_s_o:

     'getFunctions', 'getKeywords', 'CallTip'

_E_x_a_m_p_l_e_s:

       ## Not run: 
         # Create a syntax highlighting file for all currently loaded R packages
         createSyntaxFile("Rtemp.svl")
         # Show and delete it
         file.show("Rtemp.svl", delete.file = TRUE)
         
         # Create a calltips file for all currently loaded R packages
         createCallTipFile("Rtemp.ctip", return.location = TRUE)
         # Show and delete it
         file.show("Rtemp.ctip", delete.file = TRUE)
         
         # You can also customize the calltip file and select the package
         # Here we include only functions from base package (the last item
         # in the search path)
         createCallTipFile("Rtemp2.ctip", pos = length(search()),
             field.sep = ";", only.args = TRUE)
         # Show and delete it
         file.show("Rtemp2.ctip", delete.file = TRUE)
       
     ## End(Not run)

