Re: Python/Ruby completion requires language interface ?

2006-09-28 Thread Alexey I. Froloff
* A.J.Mechelynck  [060928 01:06]:
> It surprised me because, after all, Vim doesn't need to be a C
> compiler to run ccomplete.vim,
But it still needs tags information, generated bu ctags, for
example...

-- 
Regards,
Sir Raorn.


signature.asc
Description: Digital signature


Re: Python/Ruby completion requires language interface ?

2006-09-27 Thread Aaron Griffin

On 9/27/06, Mark Guzman <[EMAIL PROTECTED]> wrote:

A.J.Mechelynck wrote:
> Yes, I never said anything else: "...the scripts... terminate early
> and with error...". It surprised me because, after all, Vim doesn't
> need to be a C compiler to run ccomplete.vim, or a Web browser (hiding
> tags, the whole  part, and OTOH showing clickable 
> links and graphical  pictures) to use htmlcomplete.vim. Executing
> a script and editing it are two different things.
My other message covered the reason for the requirement. C as a language
does not provide introspection, python and ruby do. The most effective
completion (for ruby) comes from asking the ruby interpreter itself
"what do you know about X". I will probably add a fail-over to syntax
completion as someone else mentioned. I wonder how microsoft manages
their completion system, I'm of the belief that they are also using
introspection (probably in some sort of sandbox).


For obvious reasons, I'm going to side with Mark here.  You can claim
that "vim doesn't need to be a C compiler to complete C" - that's like
comparing cats and potatoes.  C and C++ have inheirant type
information directly in the code itself.  Header files are included
verbatim, and easy to parse (when needed).  Also, with regards to C,
all completable symbols are top-level  and require no extra scoping.

Let's take a look a python.  Tell me how you would gather the
information from the "sys" module in order to complete it.  Sure you
could run through all of sys.path oh wait! no... somehow you'd
have to determine the path python WOULD use to find the module, find
the .py file (assuming you don't have a gimped install containing only
pyc files), and parse that.  Sure it's possible, and sure, it might be
easy for "sys" - but take a look at pygtk.  Tell me how long that
would take to parse.

Now, go to a terminal, type "python" and hit enter. Then type "import
sys; dir(sys)" - tell me which was:
a) faster
b) easier
c) less error prone
d) guaranteed to work on all python installs




It would be nice if I could access the spelling/underlining stuff to
provide syntax error information. I haven't look too hard yet to see if
this is possible, but I for one would find it useful.

> P.S. Is that really your mail address? Looks bogus to me. But then if
> it were, you shouldn't stay long on the mailing list...
Yes, it is indeed my email address, though I have a few aliases that are
a bit more "formal". I am quite the trouble maker. I'm sure you can
imagine that my address does not validate on many websites, apparently
.info domains aren't valid in most peoples eyes.
  --mark


--
sic transit gloria et adulescentia
blog | http://blog.hasno.info/blog
wiki | http://wiki.hasno.info




Re: Python/Ruby completion requires language interface ?

2006-09-27 Thread Mark Guzman
A.J.Mechelynck wrote:
> Yes, I never said anything else: "...the scripts... terminate early
> and with error...". It surprised me because, after all, Vim doesn't
> need to be a C compiler to run ccomplete.vim, or a Web browser (hiding
> tags, the whole  part, and OTOH showing clickable 
> links and graphical  pictures) to use htmlcomplete.vim. Executing
> a script and editing it are two different things.
My other message covered the reason for the requirement. C as a language
does not provide introspection, python and ruby do. The most effective
completion (for ruby) comes from asking the ruby interpreter itself
"what do you know about X". I will probably add a fail-over to syntax
completion as someone else mentioned. I wonder how microsoft manages
their completion system, I'm of the belief that they are also using
introspection (probably in some sort of sandbox).

It would be nice if I could access the spelling/underlining stuff to
provide syntax error information. I haven't look too hard yet to see if
this is possible, but I for one would find it useful.

> P.S. Is that really your mail address? Looks bogus to me. But then if
> it were, you shouldn't stay long on the mailing list...
Yes, it is indeed my email address, though I have a few aliases that are
a bit more "formal". I am quite the trouble maker. I'm sure you can
imagine that my address does not validate on many websites, apparently
.info domains aren't valid in most peoples eyes.
  --mark


-- 
sic transit gloria et adulescentia 
blog | http://blog.hasno.info/blog
wiki | http://wiki.hasno.info



Re: Python/Ruby completion requires language interface ?

2006-09-27 Thread A.J.Mechelynck

Mark Guzman wrote:

A.J.Mechelynck wrote:

I notice that the scripts autoload/pythoncomplete.vim and
autoload/rubycomplete.vim terminate early and with error if the
corresponding interface is not compiled-in. Is that intentional? I
would expect to be able to _edit_ (for instance) a python script even
on a Vim version which cannot _run_ python commands.


if !has('ruby')
s:ErrMsg( "Error: Required vim compiled with +ruby" )
finish
endif

if version < 700
s:ErrMsg( "Error: Required vim >= 7.0" )
finish
endif   


Vim continues to run.
  --mark



Yes, I never said anything else: "...the scripts... terminate early and with 
error...". It surprised me because, after all, Vim doesn't need to be a C 
compiler to run ccomplete.vim, or a Web browser (hiding tags, the whole  
part, and OTOH showing clickable  links and graphical  
pictures) to use htmlcomplete.vim. Executing a script and editing it are two 
different things.



Best regards,
Tony.

P.S. Is that really your mail address? Looks bogus to me. But then if it were, 
you shouldn't stay long on the mailing list...


Re: Python/Ruby completion requires language interface ?

2006-09-27 Thread Mikolaj Machowski
Dnia środa, 27 września 2006 14:27, Stefan Walk napisał:
> The script terminates, not vim...
>
> if !has('python')
> echo "Error: Required vim compiled with +python"
> finish
> endif
>
> is right at the start.

It could at least degrade to syntax highlighting completion.

m.



Re: Python/Ruby completion requires language interface ?

2006-09-27 Thread Mark Guzman
A.J.Mechelynck wrote:
> I notice that the scripts autoload/pythoncomplete.vim and
> autoload/rubycomplete.vim terminate early and with error if the
> corresponding interface is not compiled-in. Is that intentional? I
> would expect to be able to _edit_ (for instance) a python script even
> on a Vim version which cannot _run_ python commands.
>
if !has('ruby')
s:ErrMsg( "Error: Required vim compiled with +ruby" )
finish
endif

if version < 700
s:ErrMsg( "Error: Required vim >= 7.0" )
finish
endif   

Vim continues to run.
  --mark

-- 
sic transit gloria et adulescentia 
blog | http://blog.hasno.info/blog
wiki | http://wiki.hasno.info



Re: Python/Ruby completion requires language interface ?

2006-09-27 Thread Mark Guzman
A.J.Mechelynck wrote:
> I notice that the scripts autoload/pythoncomplete.vim and
> autoload/rubycomplete.vim terminate early and with error if the
> corresponding interface is not compiled-in. Is that intentional? I
> would expect to be able to _edit_ (for instance) a python script even
> on a Vim version which cannot _run_ python commands.
The script itself terminates, vim continues running. The python
completion and ruby completion scripts use introspection in the
interpreter to provide completion options. The interpreter is required
for their use. Vim will continue to run.
The requirement check can be found at the start of both of our files.
 

> Note: The ruby script mentions "Maintainer: Mark Guzman
> <[EMAIL PROTECTED]>". I'm not emailing that address.
I am the developer and maintainer of the script.
  --mark

-- 
sic transit gloria et adulescentia 
blog | http://blog.hasno.info/blog
wiki | http://wiki.hasno.info



Re: Python/Ruby completion requires language interface ?

2006-09-27 Thread Stefan Walk

The script terminates, not vim...

if !has('python')
   echo "Error: Required vim compiled with +python"
   finish
endif

is right at the start.

Regards,
Stefan


Re: Python/Ruby completion requires language interface ?

2006-09-27 Thread Mikolaj Machowski
Dnia środa, 27 września 2006 11:35, A.J.Mechelynck napisał:
> I notice that the scripts autoload/pythoncomplete.vim and
> autoload/rubycomplete.vim terminate early and with error if the
> corresponding interface is not compiled-in. Is that intentional? I would
> expect to be able to _edit_ (for instance) a python script even on a Vim
> version which cannot _run_ python commands.

I don't agree with that. If interface is required for good completion it
should be done using that interface. But even in such situation good
degrading of script behaviour is required. Crashing IMO is unacceptable.

m.



Python/Ruby completion requires language interface ?

2006-09-27 Thread A.J.Mechelynck

Hello developers,

I notice that the scripts autoload/pythoncomplete.vim and 
autoload/rubycomplete.vim terminate early and with error if the corresponding 
interface is not compiled-in. Is that intentional? I would expect to be able 
to _edit_ (for instance) a python script even on a Vim version which cannot 
_run_ python commands.


Note: The ruby script mentions "Maintainer: Mark Guzman 
<[EMAIL PROTECTED]>". I'm not emailing that address.



Best regards,
Tony.