[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Generic code completion for kate
From:       Alex Turbov <i.zaufi () gmail ! com>
Date:       2014-02-01 17:26:46
Message-ID: CANktQtt-jMUcEjPL+r3_-4h_Q-ALRa51GKDL5yQBB_FVbpXUew () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sat, Feb 1, 2014 at 2:56 AM, Sven Brauch <svenbrauch@googlemail.com>wrote:

> Hi!
>
> I have had this plan for ages, but I never got around to trying it. The
> idea
> is that the highlighting XML files basically know a context, and a list of
> keywords which make sense in that context. E.g. for, say, GAP they have all
> the functions listed for highlighting purposes. It would be awesome if that
> information could also be shown in the completion list, right?
>
> First question is of course, do you think the idea is even worth it? ;)
>

definitely not for all languages (syntaxes). ideally I'd like to decide,
for example having a checkbox at "Modes & Filetypes"  configuration tab:
"try to use stupid^W keywords list based completion" for particular
document type...


> Do you think that is feasible / worth it? Is there a better way to do this?
>

I have another "idea for ages":
<dreams>
to have a (real) grammar ruled highlighting engine.
there is a lot of grammar files available in (E)BNF format (or ANTLR) for
various languages -- that would be cool to have a highlighter capable to
read a real grammar of the target language and build a highlighting rules
using it ;)
for example that highlighter will be capable to indicate syntax errors and
helps to newbies (in some language) do not do that stupid^W syntax
errors... or provide a hints to autocompleter about syntax blocks (as
blocks of editable snippets, just like snippets plugin in kate nowadays)
like `if (${expr}) {${cursor}} else {${cursor}}`, `for (${expr})
{${cursor}}` or `dynamic_cast<${T}>(${expr})`...
<dreams crazy="true">
so coding w/ that engine may be like filling "gaps" in that syntactic
blocks rather than just edit a text file...
</dreams>

I think "just syntax parsing and validation" is not so computation heavy
task for modern hardware so that highlighter quite possible to write and it
will work in a real-time...
</dreams>

...need to read more about GLR and/or GAP parsers...


> Greetings,
> Sven
> _______________________________________________
> KWrite-Devel mailing list
> KWrite-Devel@kde.org
> https://mail.kde.org/mailman/listinfo/kwrite-devel
>

[Attachment #5 (text/html)]

<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, \
Feb 1, 2014 at 2:56 AM, Sven Brauch <span dir="ltr">&lt;<a \
href="mailto:svenbrauch@googlemail.com" \
target="_blank">svenbrauch@googlemail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">Hi!<br> <br>
I have had this plan for ages, but I never got around to trying it. The idea<br>
is that the highlighting XML files basically know a context, and a list of<br>
keywords which make sense in that context. E.g. for, say, GAP they have all<br>
the functions listed for highlighting purposes. It would be awesome if that<br>
information could also be shown in the completion list, right?<br>
<br>
First question is of course, do you think the idea is even worth it? \
;)<br></blockquote><div><br></div><div>definitely not for all languages (syntaxes). \
ideally I&#39;d like to decide, for example having a checkbox at &quot;Modes &amp; \
Filetypes&quot;  configuration tab: &quot;try to use stupid^W keywords list based \
completion&quot; for particular document type...<br> <br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <br>
Do you think that is feasible / worth it? Is there a better way to do \
this?<br></blockquote><div><br></div><div>I have another &quot;idea for ages&quot;: \
<br></div><div>&lt;dreams&gt;<br></div><div>to have a (real) grammar ruled \
highlighting engine.<br> </div><div>there is a lot of grammar files available in \
(E)BNF format (or ANTLR) for various languages -- that would be cool to have a \
highlighter capable to read a real grammar of the target language and build a \
highlighting rules using it ;)<br> </div><div>for example that highlighter will be \
capable to indicate syntax errors and helps to newbies (in some language) do not do \
that stupid^W syntax errors... or provide a hints to autocompleter about syntax \
blocks (as blocks of editable snippets, just like snippets plugin in kate nowadays) \
like `if (${expr}) {${cursor}} else {${cursor}}`, `for (${expr}) {${cursor}}` or \
`dynamic_cast&lt;${T}&gt;(${expr})`... <br> </div><div>&lt;dreams \
crazy=&quot;true&quot;&gt;<br></div><div>so coding w/ that engine may be like filling \
&quot;gaps&quot; in that syntactic blocks rather than just edit a text \
file...<br></div><div>&lt;/dreams&gt;<br><br> </div><div>I think &quot;just syntax \
parsing and validation&quot; is not so computation heavy task for modern hardware so \
that highlighter quite possible to write and it will work in a real-time... \
<br></div><div>&lt;/dreams&gt;<br> <br></div><div>...need to read more about GLR \
and/or GAP parsers...<br></div><div><br></div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <br>
Greetings,<br>
Sven<br>
_______________________________________________<br>
KWrite-Devel mailing list<br>
<a href="mailto:KWrite-Devel@kde.org" target="_blank">KWrite-Devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kwrite-devel" \
target="_blank">https://mail.kde.org/mailman/listinfo/kwrite-devel</a><br> \
</blockquote></div><br></div></div>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic