Re: [code] On require() in REPL, auto_c_selection_change and refactored js module

From: Mitchell <m.att.foicica.com>
Date: Mon, 18 Nov 2019 11:05:10 -0500 (EST)

Hi Alexander,

On Mon, 18 Nov 2019, Alexander Misel wrote:

> I recently tried to play with Lua in Textadept's REPL. But as I need to import some module, I used require syntax. But I found that the global function called inside that module didn't use the env that REPL defined, for example, print(), which made me unable to output in REPL. Is there a fix for this?

It appears at first glance that Lua's `require` loads code in a separate environment. I don't know of a workaround for this.

> I also wanted to add an event handler to auto_c_selection_change event, for example, show related document associated to the choice in the code completion list. But the behavior seems not the same as document, the arguments didn't really pass to the event handler. I wonder if it is related to the Scintilla used by Textadept.

I've fixed[1] this. Thanks for the report.

> Moreover, I kind of refactored my ta-javascript module, in particular, the pattern matching was rewritten using lpeg.re (as re is more like the syntax mentioned in papers) and the new tags was generated based on https://github.com/ternjs/tern/tree/master/defs . I added a typeref field to the ctags files to get return type info during code completion. But as for now, it's not fully used. Ideas of using this field is welcome.

I don't use JavaScript, so I cannot comment on this.

Cheers,
Mitchell

[1]: https://foicica.com/hg/textadept/rev/6b8c375bfe00

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 18 Nov 2019 - 11:05:10 EST

This archive was generated by hypermail 2.2.0 : Tue 19 Nov 2019 - 06:54:33 EST