You could try this command. I will add this code to the next release (at this point, 27.0.1).
/**
* Selects the text from the start to end of the current token under the cursor.
* If there is no token under the cursor, selects the whitespace between the
* previous token and the next token after the cursor.
*
* @see select_word
* @see select_subword
* @see tag_get_current_token
* @see tag_get_next_token
* @see tag_get_prev_token
*
* @appliesTo Edit_Window, Editor_Control
* @categories Edit_Window_Methods, Editor_Control_Methods, Selection_Functions
*/
_command void select_token() name_info(','VSARG2_MULTI_CURSOR|VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL)
{
if (!_is_tokenlist_supported()) {
_message_box("Token list not supported for this language");
return;
}
if (_lineflags() & NOSAVE_LF) {
select_line();
return;
}
_UpdateContextAndTokens(AlwaysUpdate:true, ForceUpdate:false);
start_offset := 0;
end_offset := p_buf_size;
offset := _QROffset();
tid := tag_get_current_token((int)offset);
if (tid > 0) {
tag_get_token_info(tid, auto token_type, auto token_text, auto token_seek, auto token_line);
start_offset = token_seek;
end_offset = token_seek + length(token_text);
//SAY("HAVE TOKEN: start="start_offset" end="end_offset);
} else {
while (--offset > 0) {
tid = tag_get_current_token((int)offset);
if (tid > 0) break;
}
if (tid > 0) {
tag_get_token_info(tid, auto token_type, auto token_text, auto token_seek, auto token_line);
start_offset = token_seek + length(token_text);
//SAY("HAVE PREV TOKEN: start="start_offset);
tid = tag_get_next_token(tid);
} else {
tid = tag_get_first_token();
}
if (tid > 0) {
//SAY("HAVE NEXT TOKEN: end="end_offset);
tag_get_token_info(tid, auto token_type, auto token_text, auto token_seek, auto token_line);
end_offset = token_seek;
}
}
mark := _duplicate_selection("");
_deselect(mark);
_GoToROffset(start_offset);
_select_char(mark);
_GoToROffset(end_offset);
_select_char(mark,translate(def_select_style,'N','I'));
_cua_select=1;
}