> -----Original Message-----
> From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 12, 2006 8:47 PM
> To: David Fishburn
> Cc: vim@vim.org
> Subject: Re: VimL and Exuberant tags - Suggestions please
> 
> David Fishburn wrote:
> [...]
> > When variables are identified we strip off the scope:
> >     let s:ignoreNextCursorMovedI = 0 ==> 
> ignoreNextCursorMovedI Should 
> > the scope be left on ==> s:ignoreNextCursorMovedI
> 
> How are scopes handled in other languages?
> 
> Notice that varname (in a function) is the same as l:varname 
> while varname (in a script, but outside of all functions) is 
> the same as g:varname. Similarly, s:funcname is the same as 
> <SID>funcname
> 
> If you identify scopes, should or shouldn't ctags qualify the 
> non-global variables by their script (if script-local) or 
> script and function (if function-local)? (I see you mention 
> this in a further paragraph. If it's not too hard to program, 
> it might be useful as an option.)
> 
>   And how to treat buffer- and window-local variables?


Basically I am saying this, consider the code snippet:

let g:var_global_scope = 1
let s:var_script_scope = 1
let var_script_default_scope = 1

function mydict.len() dict
    let var_in_func = 2
    let s:script_var_in_func = 2
   return len(self.data)
endfunction

What I am suggesting is we do not remove the scoping at the start of the
variable.  So in the case above, we would create the following tags:

Variable
--------
g:var_global_scope
s:var_script_scope
var_script_default_scope

These 2 variables are ignored since they were used inside of a function:
    let var_in_func = 2
    let s:script_var_in_func = 2

I would like to leave the scoping on, since it provides additional
information:
g:var_global_scope -> var_global_scope 
s:var_script_scope -> var_script_scope

You don't know if this is a script, global, buffer, window, tab, scoped
variable.
You would assume they were all global unless otherwise referenced.



> 
> > 
> > 
> > Instead of simply grouping everything under variables, should we 
> > distinguish between different types?
> > let forms#form = {
> >       \ 'title': 'Address Entry Form',
> >       \ 'fields': [],
> >       \ 'defaultbutton': 'ok',
> >       \ 'fieldMap': {},
> >       \ 'hotkeyMap': {},
> >       \ }
> > 
> > Right now this is identified as a variable, should we 
> identify it as a 
> > Dictionary by adding another kind of tag?
> [...]
> 
> When a script has
> 
>       :let var1 = var2
> 
> there is nothing there (maybe nothing in the script) which 
> says whether the variable in question is a "simple" variable 
> (Number/String), a List, or a Dictionary. Wouldn't it be a 
> headbreaker to try to label all cases correctly?


Right, I wasn't looking for anything earth shattering here.
        let var1 = var2
        let var1 = {...}
        let var1 = [...]

Does provide us with additional information if we wish to use it.


Dave

Reply via email to