[TxMt] Re: "Document.did-change" and access to the current document in a bundle?

Jacob Carlborg doob at me.com
Mon Aug 22 18:53:52 UTC 2016


From Allan:

"I actually have a local branch which allow commands to run on 
“document changed” which is designed for live HTML/Markdown preview, 
but could also be used for updating the gutter. Though there are some 
minor issues that need fixing before I can push this to master.” [1]

[1] http://lists.macromates.com/textmate/2016-May/039527.html <http://lists.macromates.com/textmate/2016-May/039527.html>

-- 
/Jacob Carlborg

> On 22 aug 2016, at 19:15, Graham Heath <graham.p.heath at gmail.com> wrote:
> 
> [+textmate at lists.macromates.com <mailto:textmate at lists.macromates.com>] since this seems to be growing into a feature request, rather than a request for more information.
> 
> [I hope I’ve recombine-ed these emails in a sane way…]
> 
> The way Atom appears to be doing this "on change" event is by debouncing it over 300ms. ESLint-d is a daemon implementation of ESLint. IIRC it is a rather simple wrapper around ESLint that keeps the linter open in a background process.
> 
> If I could get the "on change" event, I’d be happy to setup a node script that either launches a background process ("TMHinter-d" perhaps) or attaches to the existing background process.
> 
> Thanks,
> 
> Graham Heath
> 
>> 
>>> 
>>> On August 20, 2016 at 2:58:31 PM, Michael Sheets (bundles at textmate.org <mailto:bundles at textmate.org>) wrote:
>>> 
>>> > On Aug 18, 2016, at 8:23 PM, Graham Heath <graham.p.heath at gmail.com <mailto:graham.p.heath at gmail.com>> wrote: 
>>> > 
>>> > My current issue is that Atom can lint in real time. I figure with the gutter/marks API the front-end is ready for this. However, in my research the only thing that seems to update without a save is spell checking. 
>>> > 
>>> > Is there a Semantic Class that I’m just not finding, or could we create one? I’d then need a way to access the document’s unsaved contents. It seems to me that spell checking is already doing this, and maybe we could hijack some of that functionality? 
>>> > 
>>> > If there isn’t a Semantic Class (or other hook) and there’s not a way to access the current unsaved document, could there be? :D 
>>> 
>>> The current callbacks are: 
>>> 
>>> callback.document.did-open 
>>> callback.application.did-deactivate 
>>> callback.application.did-activate 
>>> callback.document.will-save 
>>> callback.document.did-save 
>>> 
>>> There is no option to monitor a document for changes in real time, doing so would activate for every single keypress which is just too much overhead for general use. To do this properly we need a program running constantly in the background which isn’t really part of how bundles work. 
>>> 
>>> A good example to look at that we use is the SCM Diff Gutter bundle, this updates on save and open. 
>>> 
>>> > Is this the appropriate list for this conversation? 
>>> > 
>>> > Will Allan see this thread if we keep it on this list? I’m sure he’s got better things to work on, but I’d love to know how he’s thought about these issues (because I know he has). 
>>> 
>>> This isn’t a list, it goes directly to me only. :) If you want to discuss things with the wider community the main TextMate mailing list is the solution. (Or for a subset the IRC chatroom perhaps.) 
>>> On August 18, 2016 at 6:23:50 PM, Graham Heath (graham.p.heath at gmail.com <mailto:graham.p.heath at gmail.com>) wrote:
>>> 
>>>> Hello again;
>>>> 
>>>> I’ve been working on some exciting features (for me any way) for the existing JSHinter bundle. I’ve had some PRs for small things pending for a while, and I guess that the original author is no longer interested in the project. No problem there, my work continues and the plugin will soon be better than ever.
>>>> 
>>>> The goal is to be comparable to the (awesome) Atom Linter plugin, and as the new author I intend to rebrand it as TextMate Linter (or something similar).
>>>> 
>>>> My current issue is that Atom can lint in real time. I figure with the gutter/marks API the front-end is ready for this. However, in my research the only thing that seems to update without a save is spell checking.
>>>> 
>>>> Is there a Semantic Class that I’m just not finding, or could we create one? I’d then need a way to access the document’s unsaved contents. It seems to me that spell checking is already doing this, and maybe we could hijack some of that functionality?
>>>> 
>>>> If there isn’t a Semantic Class (or other hook) and there’s not a way to access the current unsaved document, could there be? :D
>>>> 
>>>> I don’t know if you’re interested, but my work has been going on here: https://github.com/loadedsith/JavascriptHinter.tmbundle/ <https://github.com/loadedsith/JavascriptHinter.tmbundle/>
>>>> specifically off the master branch;
>>>> https://github.com/loadedsith/JavascriptHinter.tmbundle/tree/scss-es-and-gjslint <https://github.com/loadedsith/JavascriptHinter.tmbundle/tree/scss-es-and-gjslint>
>>>> 
>>>> 
>>>> 2 last questions;
>>>> 
>>>> Is this the appropriate list for this conversation? 
>>>> 
>>>> Will Allan see this thread if we keep it on this list? I’m sure he’s got better things to work on, but I’d love to know how he’s thought about these issues (because I know he has).
>>>> 
>>>> Thanks,
>>>> 
>>>> Graham Heath
> 
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com <mailto:textmate at lists.macromates.com>
> http://lists.macromates.com/listinfo/textmate <http://lists.macromates.com/listinfo/textmate>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20160822/ba51b66b/attachment-0001.html>


More information about the textmate mailing list