Re: vim9 exported functions not recognized by ctags

2022-08-17 Thread N V
For extended powershell script, displaying functions with tagbar see this:

https://github.com/preservim/tagbar/issues/830



If it can help. 
Have a good Day. 
Nicolas 

Le vendredi 12 août 2022 à 16:19:16 UTC+2, N V a écrit :

> And YES It Is !!  :)
>
> Windows configuration of *vim9script  ctags* extension
>
>
> *1/ In your $MYVIMRC ~_vimrc (here vim9script) just put these lines :*
>
> g:tagbar_type_vim = {
>kinds: [
>
>   \ 'a:autocommand groups:1',
>   \ 'c:commands:0:0',
>   \ 'e:exported defs',
>   \ 'f:functions',
>   \ 'g:global variables',
>   \ 'K:constants',
>
>   \ 'm:maps:1:0',
>   \ 'n:vimball filenames',
>   \ 'v:variables:1:0',
>   \ ],
> }
>
> *2/ In your $vimruntime ~ vim90 folder where there is ctags.exe v5.9 just 
> add  file in folder .ctags.d/vim.ctags*
>
> --kinddef-vim=e,export,Vim 9 exported defs
> --kinddef-vim=g,global,Vim 9 global variables
> --kinddef-vim=K,const,Vim 9 constants
> --regex-vim=/^\s*export\s+def\s+([^(]+)/\1/e,export/
> --regex-vim=/^\s*(g:\w+)\b/\1/g,global/
> --regex-vim=/^(\s*export\s+)?const\s+(\w+)/\2/K,const/
> --regex-vim=/^(\s*export\s+)?final\s+(\w+)/\2/K,const/
>
>
>
>
> and see the light : all exported defs vim9script functions are now 
> displayed !   :) :)
> [image: Capture.PNG]
>
>
>
> THANK YOU Life !!
> Hope this help someone.
> Nicolas
> Le jeudi 11 août 2022 à 19:55:48 UTC+2, Lifepillar a écrit :
>
>> On 2022-08-11, N V  wrote: 
>> > So I put it in *somewhereOvertherainbow\*Vim\vim90\.ctags.d 
>>
>> If you put Ctags configuration there, does `ctags --list-kinds=vim` 
>> still use it? 
>>
>> > But it seems to not runnning well : does not displays vim9 exported 
>> > functions 
>>
>> I'm afraid I can't help you with Windows-specific configuration, as I'm 
>> not using Windows. 
>>
>> Life. 
>>
>>

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/7e50faf3-93dc-42e9-9cf8-1149ee1106d0n%40googlegroups.com.


Re: [vim9script] Behavior of has_key()

2022-08-17 Thread Bram Moolenaar


> The help entry for has_key() says that the key must be a string. In
> legacy Vim script, however, this works fine:
> 
> let dd = {42: '42', v:true:  'T', 3.14: '3.14'}
> echo dd->has_key(42)
> echo dd->has_key(v:true)
> echo dd->has_key(3.14)
> 
> In Vim 9 script, the behavior is different:
> 
> vim9script
> const dd = {42: '42', true:  'T', [3.14]: '3.14'}
> echo dd->has_key(42) # OK
> echo dd->has_key(v:true) # Error, must be string(v:true)
> echo dd->has_key(3.14)   # Error, must be string(3.14)
> 
> This seems a bit inconsistent to me. I don't have a problem with Vim
> 9 script being different from legacy script, but I think that either all
> the three cases should raise an error, or none of them.
> 
> Besides, the documentation does not make it clear that implicit type
> casting may happen.

I'll add a note to the help.

In Vim9 script there is no automatic conversion to string, but an
exception is made for a number.  I don't recall the discussion, but I
think this was because it is rather common.  Perhaps not totally
consistent, but I don't want to change it now, it would cause obscure
problems.

-- 
A poem:read aloud:

<> !*''#   Waka waka bang splat tick tick hash,
^"`$$- Caret quote back-tick dollar dollar dash,
!*=@$_ Bang splat equal at dollar under-score,
%*<> ~#4   Percent splat waka waka tilde number four,
&[]../ Ampersand bracket bracket dot dot slash,
|{,,SYSTEM HALTED  Vertical-bar curly-bracket comma comma CRASH.

Fred Bremmer and Steve Kroese (Calvin College & Seminary of Grand Rapids, MI.)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20220817123218.7A0F71C0B04%40moolenaar.net.


[vim9script] Behavior of has_key()

2022-08-17 Thread Lifepillar
The help entry for has_key() says that the key must be a string. In
legacy Vim script, however, this works fine:

let dd = {42: '42', v:true:  'T', 3.14: '3.14'}
echo dd->has_key(42)
echo dd->has_key(v:true)
echo dd->has_key(3.14)

In Vim 9 script, the behavior is different:

vim9script
const dd = {42: '42', true:  'T', [3.14]: '3.14'}
echo dd->has_key(42) # OK
echo dd->has_key(v:true) # Error, must be string(v:true)
echo dd->has_key(3.14)   # Error, must be string(3.14)

This seems a bit inconsistent to me. I don't have a problem with Vim
9 script being different from legacy script, but I think that either all
the three cases should raise an error, or none of them.

Besides, the documentation does not make it clear that implicit type
casting may happen.

Life.


-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/tdi4ul%24ik8%241%40ciao.gmane.io.