Thanks for coming back here.
I don't see my list_tags being called with this flag set. However my implementation is quite tiny so far and there might be some language setup or module initialisation requirements I missed.
That's the full code:
#pragma option(pedantic,on)
#region Imports
#include "slick.sh"
#import "adaptiveformatting.e"
#import "alias.e"
#import "alllanguages.e"
#import "autocomplete.e"
#import "c.e"
#import "cutil.e"
#import "notifications.e"
#import "optionsxml.e"
#import "se/lang/api/LanguageSettings.e"
#import "setupext.e"
#import "slickc.e"
#import "stdcmds.e"
#import "stdprocs.e"
#import "surround.e"
#import "tags.e"
#import "pmatch.e"
#endregion
using se.lang.api.LanguageSettings;
static const MXS_LANGUAGE_ID='foo';
_command foo_mode() name_info(','VSARG2_REQUIRES_EDITORCTL|VSARG2_READ_ONLY|VSARG2_ICON)
{
_SetEditorLanguage(MXS_LANGUAGE_ID);
}
_command void foo_enter() name_info(','VSARG2_MULTI_CURSOR|VSARG2_CMDLINE|VSARG2_ICON|VSARG2_REQUIRES_EDITORCTL|VSARG2_READ_ONLY)
{
generic_enter_handler(_foo_expand_enter);
}
bool _foo_expand_enter()
{
return true;
}
int vsfoo_list_tags( int output_view_id, _str file_name, _str extension, int list_tags_flags, int tree_wid = 0, int func_bitmap = 0, int StartFromCursor = 0, int StartSeekPos = 0 )
{
int status;
if( file_name != '' )
{
say( 'vsfoo_list_tags file_name='file_name );
}
kind := "";
name := "";
status = search( '^[ \t]*{SIGNAL|NEWTYPE|PROCESS}:b{:v}', '@ri>' );
while( !status )
{
kind = get_text( match_length('0'), match_length('S0') );
name = get_text( match_length('1'), match_length('S1') );
say( 'vsfoo_list_tags kind='kind' name='name );
tag_init_tag_browse_info( auto cm, name, "", "label", 0, p_buf_name, p_RLine, match_length('S1') );
if( list_tags_flags & VSLTF_SET_TAG_CONTEXT )
{
say( 'vsfoo_list_tags tag_insert_match_browse_info' );
tag_insert_match_browse_info( 0, cm );
}
else
{
say( 'vsfoo_list_tags tag_insert_tag_browse_info' );
tag_insert_tag_browse_info( cm );
}
auto tag = tag_compose_tag_browse_info( cm );
say( 'tag='tag );
status = repeat_search();
}
return 0;
}
Wanted to start with some simple parser/lexer implementation and other enhancements like this MaybeCreateTagFile etc. after the very basics are working. Any hints what might be missing here welcome. Note that I don't want to start some full fledged language support implementation with adaptive formatting etc., but adding symbols to the tag database is really desired