You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Eric Bresie <eb...@gmail.com> on 2021/03/25 12:55:28 UTC
How to Implement a New Language
I was hoping for some guidance and/or pointers to documentation or tutorials on how to add new Language support to Netbeans.
I understand there being movement towards using LSP rather than full language support within a give language module without LSP. Is the preferred route to use LSP or native support? And what is the pros/con of each approach?
For native support...
I found some older articles (1) which provides some details but wasn’t sure if this is still the “best practice” in current Netbeans or if there is another preferred way or even new tutorials. There are also some older documents on the old Netbeans site (4)(5)(6) (not sure where on the new site so providing archived versions) but now sure how up to date these are.
For LSP support...
I find a discussion on similar implementation on a new language here (2) which provides some guidance as well as another’s related to the VS Code LSP activities (3)
It seems for LSP the general consensus is to look at the cpplite and Typescript implementations as good examples of LSP based.
So what other newer guidance is available and/or recommended?
Reference
(1) https://dzone.com/articles/quickstart-guide-language-supp
(2) https://lists.apache.org/x/list.html?dev@netbeans.apache.org:lte=1y:Textmate%20or%20LSP%20for%20Cucumber
(3) https://lists.apache.org/x/thread.html/rf84a830a545d0f3bfb39a07d3f7fcf33ca7ab28deb82bf6551f54e44@%3Cdev.netbeans.apache.org%3E
(4) https://web.archive.org/web/20210118012355/http://wiki.netbeans.org/How_to_create_support_for_a_new_language
(5) https://web.archive.org/web/20210117160954/https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html
(6) https://web.archive.org/web/20210117160955/https://platform.netbeans.org/tutorials/nbm-javacc-parser.html
Eric Bresie
Ebresie@gmail.com (mailto:Ebresie@gmail.com)
Re: AW: How to Implement a New Language
Posted by Eric Bresie <eb...@gmail.com>.
On Thu, Apr 8, 2021 at 7:19 AM Eric Bresie <eb...@gmail.com> wrote:
> Soooo...if one was to want to implement new Python or other new languages,
> it would be possible to implement and leverage one of the implemented
> servers like those defined here?
>
> https://microsoft.github.io/language-server-protocol/implementors/servers/
>
And leverage the tm grammars from some place like here
https://github.com/Chris2011/netbeans-textmate-files
When adding a new language, should this generally be done as a separate
plugin or be integrated within the netbeans codebase itself? I guess this
could go either way but assume making an external plugin allows more
flexibility to management of it, avoids growing the netbeans codebase
significantly, but has a little less visibility up front (and not part of
“Netbeans” proper) with the need to manage things separately from the
netbeans master repository
> Eric
>
> On Mon, Apr 5, 2021 at 8:05 AM Christian Lenz <ch...@gmx.net>
> wrote:
>
>> You can see the full list (more are coming soon) of all languages which
>> we can have in NetBeans here:
>> https://github.com/Chris2011/netbeans-textmate-files
>>
>> This is just simple basic syntax highlighting for over 50 languages. Well
>> known and some not well known.
>>
>> What is needed here for every language is:
>>
>> - Semantic syntax highlighting (more than with textmate I think)
>> - Formatting (custom implementation or LSP?)
>> - Refactoring (renaming, find usages, go to, etc. – LSP needed)
>> - Hints/Fixes/Suggestions, etc – LSP needed + custom implementation if
>> LSP doesn’t have that much
>> - Braces matching, automatic closing of braces (custom implementation?)
>> - Code completion – LSP needed
>> - Code templates – custom implementation
>> - Showing errors of the Syntax or Control flow – LSP needed
>>
>> So as an alternative to ANTLR which of course is good, we Need those
>> stuff for textmate too. Where we can all implement the stuff based on
>> textmate files and not only on g and g4 lexer and parser. If possible.
>>
>>
>> Cheers
>>
>> Chris
>>
>> Von: John Kostaras
>> Gesendet: Freitag, 2. April 2021 16:17
>> An: dev@netbeans.apache.org
>> Betreff: Re: AW: How to Implement a New Language
>>
>> Hallo,
>> the best 'tutorial' is chapter 11 of Pro Apache NetBeans
>> <
>> https://www.amazon.com/Pro-Apache-NetBeans-Building-Applications/dp/1484253698
>> >
>> book, even though it doesn't use the modern trend of TextMate and LSP, but
>> it is based on ANTLR.
>>
>> This confluence page
>> <https://cwiki.apache.org/confluence/display/NETBEANS/Community+plugins>
>> provides an overview of the status of language support of Apache Netbeans.
>> The situation is really bad, compared to the language support that existed
>> back in NetBeans 8.2 for example, or even earlier versions. There are
>> many
>> old and half-baked plugins for many languages, and I don't know what is
>> the
>> best way to move ahead in this respect.
>>
>> Kind regards,
>>
>> John.
>>
>>
>>
>> On Mon, 29 Mar 2021 at 23:02, antonio <an...@vieiro.net> wrote:
>>
>> > Very true. Maintaining an ANTLR grammar over the years is difficult and
>> > time consuming (see for instance all the changes to the NetBeans C++
>> > grammar in NetBeans [1]).
>> >
>> > LSP servers, when mantained by knowledgeable teams, may give better
>> > results with less effort. Apple, for instance, decided to move to clangd
>> > (from libclang) a few years back ([2]).
>> >
>> > For simpler languages/DSLs I think Eclipse's XText
>> > https://www.eclipse.org/Xtext/ outperforms JetBrain's MPS
>> > https://www.jetbrains.com/mps/ (the generated parsers could then be
>> > reused in NetBeans).
>> >
>> > Cheers,
>> > Antonio
>> >
>> > [1]
>> >
>> >
>> https://github.com/emilianbold/netbeans-releases/commits/master/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
>> >
>> > [2]
>> > https://lists.llvm.org/pipermail/cfe-dev/2018-April/057668.html
>> >
>> >
>> > El 29/3/21 a las 11:39, Christian Lenz escribió:
>> > > Hey all,
>> > >
>> > > for myself I prefer adding new languages with textmate nowadays and
>> LSP.
>> > It is not possible for some languages to find updated versions of the
>> ANTLR
>> > Grammar file. For example C#. I dunno how it is for rust but yeah, I
>> still
>> > prefer Textmate. We Need to figure out how we can create the Tokens
>> based
>> > on the textmate file instead of ANTLR. I would prefer that. In the end,
>> > everythins should be then the same as for ANTLR.
>> > >
>> > >
>> > > Cheers
>> > >
>> > > Chris
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> > For additional commands, e-mail: dev-help@netbeans.apache.org
>> >
>> > For further information about the NetBeans mailing lists, visit:
>> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>> >
>> >
>> >
>> >
>>
>> --
> Eric Bresie
> ebresie@gmail.com
>
--
Eric Bresie
ebresie@gmail.com
AW: AW: How to Implement a New Language
Posted by Christian Lenz <ch...@gmx.net>.
Unfortunately I dunno, I didn’t check them. But I think for 3rd party plugins, there are no problems. But just guessing.
Von: Eric Bresie
Gesendet: Freitag, 9. April 2021 14:19
An: Netbeans Developer List
Betreff: Re: AW: How to Implement a New Language
Are there any licenses concerns on any of those tm files to worry about?
Eric Bresie
ebresie@gmail.com
On Fri, Apr 9, 2021 at 6:40 AM Christian Lenz <ch...@gmx.net>
wrote:
> Hey Eric,
>
> I thinl so yes. So use a Textmate language from wherever you want. I just
> made a little repo as you already mentioned to collect all of them to use.
> And then the LSP for that language, if it exists.
> I would prefer to have it inside NetBeans, because we are more flexible
> with the APIs making friends if needed or taking whatever is needed.
>
> On the other hand I like 3rd Party pllugins more because of different
> release cycles. If we encounter a bug today, I can fix it today and release
> it today. Not possible with NetBeans if it is not a real blocker bug.
> Problem is again the problem that not all APIs are public to use them
> within your 3rd party plugin.
>
> So at the end, it is up to you I would say.
>
> Von: Eric Bresie
> Gesendet: Donnerstag, 8. April 2021 14:20
> An: dev@netbeans.apache.org
> Betreff: Re: AW: How to Implement a New Language
>
> Soooo...if one was to want to implement new Python or other new languages,
> it would be possible to implement and leverage one of the implemented
> servers like those defined here?
>
> https://microsoft.github.io/language-server-protocol/implementors/servers/
>
> Eric
>
> On Mon, Apr 5, 2021 at 8:05 AM Christian Lenz <ch...@gmx.net>
> wrote:
>
> > You can see the full list (more are coming soon) of all languages which
> we
> > can have in NetBeans here:
> > https://github.com/Chris2011/netbeans-textmate-files
> >
> > This is just simple basic syntax highlighting for over 50 languages. Well
> > known and some not well known.
> >
> > What is needed here for every language is:
> >
> > - Semantic syntax highlighting (more than with textmate I think)
> > - Formatting (custom implementation or LSP?)
> > - Refactoring (renaming, find usages, go to, etc. – LSP needed)
> > - Hints/Fixes/Suggestions, etc – LSP needed + custom implementation if
> LSP
> > doesn’t have that much
> > - Braces matching, automatic closing of braces (custom implementation?)
> > - Code completion – LSP needed
> > - Code templates – custom implementation
> > - Showing errors of the Syntax or Control flow – LSP needed
> >
> > So as an alternative to ANTLR which of course is good, we Need those
> stuff
> > for textmate too. Where we can all implement the stuff based on textmate
> > files and not only on g and g4 lexer and parser. If possible.
> >
> >
> > Cheers
> >
> > Chris
> >
> > Von: John Kostaras
> > Gesendet: Freitag, 2. April 2021 16:17
> > An: dev@netbeans.apache.org
> > Betreff: Re: AW: How to Implement a New Language
> >
> > Hallo,
> > the best 'tutorial' is chapter 11 of Pro Apache NetBeans
> > <
> >
> https://www.amazon.com/Pro-Apache-NetBeans-Building-Applications/dp/1484253698
> > >
> > book, even though it doesn't use the modern trend of TextMate and LSP,
> but
> > it is based on ANTLR.
> >
> > This confluence page
> > <https://cwiki.apache.org/confluence/display/NETBEANS/Community+plugins>
> > provides an overview of the status of language support of Apache
> Netbeans.
> > The situation is really bad, compared to the language support that
> existed
> > back in NetBeans 8.2 for example, or even earlier versions. There are
> many
> > old and half-baked plugins for many languages, and I don't know what is
> the
> > best way to move ahead in this respect.
> >
> > Kind regards,
> >
> > John.
> >
> >
> >
> > On Mon, 29 Mar 2021 at 23:02, antonio <an...@vieiro.net> wrote:
> >
> > > Very true. Maintaining an ANTLR grammar over the years is difficult and
> > > time consuming (see for instance all the changes to the NetBeans C++
> > > grammar in NetBeans [1]).
> > >
> > > LSP servers, when mantained by knowledgeable teams, may give better
> > > results with less effort. Apple, for instance, decided to move to
> clangd
> > > (from libclang) a few years back ([2]).
> > >
> > > For simpler languages/DSLs I think Eclipse's XText
> > > https://www.eclipse.org/Xtext/ outperforms JetBrain's MPS
> > > https://www.jetbrains.com/mps/ (the generated parsers could then be
> > > reused in NetBeans).
> > >
> > > Cheers,
> > > Antonio
> > >
> > > [1]
> > >
> > >
> >
> https://github.com/emilianbold/netbeans-releases/commits/master/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
> > >
> > > [2]
> > > https://lists.llvm.org/pipermail/cfe-dev/2018-April/057668.html
> > >
> > >
> > > El 29/3/21 a las 11:39, Christian Lenz escribió:
> > > > Hey all,
> > > >
> > > > for myself I prefer adding new languages with textmate nowadays and
> > LSP.
> > > It is not possible for some languages to find updated versions of the
> > ANTLR
> > > Grammar file. For example C#. I dunno how it is for rust but yeah, I
> > still
> > > prefer Textmate. We Need to figure out how we can create the Tokens
> based
> > > on the textmate file instead of ANTLR. I would prefer that. In the end,
> > > everythins should be then the same as for ANTLR.
> > > >
> > > >
> > > > Cheers
> > > >
> > > > Chris
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > > For additional commands, e-mail: dev-help@netbeans.apache.org
> > >
> > > For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > >
> > >
> > >
> > >
> >
> > --
> Eric Bresie
> ebresie@gmail.com
>
>
Re: AW: How to Implement a New Language
Posted by Eric Bresie <eb...@gmail.com>.
Are there any licenses concerns on any of those tm files to worry about?
Eric Bresie
ebresie@gmail.com
On Fri, Apr 9, 2021 at 6:40 AM Christian Lenz <ch...@gmx.net>
wrote:
> Hey Eric,
>
> I thinl so yes. So use a Textmate language from wherever you want. I just
> made a little repo as you already mentioned to collect all of them to use.
> And then the LSP for that language, if it exists.
> I would prefer to have it inside NetBeans, because we are more flexible
> with the APIs making friends if needed or taking whatever is needed.
>
> On the other hand I like 3rd Party pllugins more because of different
> release cycles. If we encounter a bug today, I can fix it today and release
> it today. Not possible with NetBeans if it is not a real blocker bug.
> Problem is again the problem that not all APIs are public to use them
> within your 3rd party plugin.
>
> So at the end, it is up to you I would say.
>
> Von: Eric Bresie
> Gesendet: Donnerstag, 8. April 2021 14:20
> An: dev@netbeans.apache.org
> Betreff: Re: AW: How to Implement a New Language
>
> Soooo...if one was to want to implement new Python or other new languages,
> it would be possible to implement and leverage one of the implemented
> servers like those defined here?
>
> https://microsoft.github.io/language-server-protocol/implementors/servers/
>
> Eric
>
> On Mon, Apr 5, 2021 at 8:05 AM Christian Lenz <ch...@gmx.net>
> wrote:
>
> > You can see the full list (more are coming soon) of all languages which
> we
> > can have in NetBeans here:
> > https://github.com/Chris2011/netbeans-textmate-files
> >
> > This is just simple basic syntax highlighting for over 50 languages. Well
> > known and some not well known.
> >
> > What is needed here for every language is:
> >
> > - Semantic syntax highlighting (more than with textmate I think)
> > - Formatting (custom implementation or LSP?)
> > - Refactoring (renaming, find usages, go to, etc. – LSP needed)
> > - Hints/Fixes/Suggestions, etc – LSP needed + custom implementation if
> LSP
> > doesn’t have that much
> > - Braces matching, automatic closing of braces (custom implementation?)
> > - Code completion – LSP needed
> > - Code templates – custom implementation
> > - Showing errors of the Syntax or Control flow – LSP needed
> >
> > So as an alternative to ANTLR which of course is good, we Need those
> stuff
> > for textmate too. Where we can all implement the stuff based on textmate
> > files and not only on g and g4 lexer and parser. If possible.
> >
> >
> > Cheers
> >
> > Chris
> >
> > Von: John Kostaras
> > Gesendet: Freitag, 2. April 2021 16:17
> > An: dev@netbeans.apache.org
> > Betreff: Re: AW: How to Implement a New Language
> >
> > Hallo,
> > the best 'tutorial' is chapter 11 of Pro Apache NetBeans
> > <
> >
> https://www.amazon.com/Pro-Apache-NetBeans-Building-Applications/dp/1484253698
> > >
> > book, even though it doesn't use the modern trend of TextMate and LSP,
> but
> > it is based on ANTLR.
> >
> > This confluence page
> > <https://cwiki.apache.org/confluence/display/NETBEANS/Community+plugins>
> > provides an overview of the status of language support of Apache
> Netbeans.
> > The situation is really bad, compared to the language support that
> existed
> > back in NetBeans 8.2 for example, or even earlier versions. There are
> many
> > old and half-baked plugins for many languages, and I don't know what is
> the
> > best way to move ahead in this respect.
> >
> > Kind regards,
> >
> > John.
> >
> >
> >
> > On Mon, 29 Mar 2021 at 23:02, antonio <an...@vieiro.net> wrote:
> >
> > > Very true. Maintaining an ANTLR grammar over the years is difficult and
> > > time consuming (see for instance all the changes to the NetBeans C++
> > > grammar in NetBeans [1]).
> > >
> > > LSP servers, when mantained by knowledgeable teams, may give better
> > > results with less effort. Apple, for instance, decided to move to
> clangd
> > > (from libclang) a few years back ([2]).
> > >
> > > For simpler languages/DSLs I think Eclipse's XText
> > > https://www.eclipse.org/Xtext/ outperforms JetBrain's MPS
> > > https://www.jetbrains.com/mps/ (the generated parsers could then be
> > > reused in NetBeans).
> > >
> > > Cheers,
> > > Antonio
> > >
> > > [1]
> > >
> > >
> >
> https://github.com/emilianbold/netbeans-releases/commits/master/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
> > >
> > > [2]
> > > https://lists.llvm.org/pipermail/cfe-dev/2018-April/057668.html
> > >
> > >
> > > El 29/3/21 a las 11:39, Christian Lenz escribió:
> > > > Hey all,
> > > >
> > > > for myself I prefer adding new languages with textmate nowadays and
> > LSP.
> > > It is not possible for some languages to find updated versions of the
> > ANTLR
> > > Grammar file. For example C#. I dunno how it is for rust but yeah, I
> > still
> > > prefer Textmate. We Need to figure out how we can create the Tokens
> based
> > > on the textmate file instead of ANTLR. I would prefer that. In the end,
> > > everythins should be then the same as for ANTLR.
> > > >
> > > >
> > > > Cheers
> > > >
> > > > Chris
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > > For additional commands, e-mail: dev-help@netbeans.apache.org
> > >
> > > For further information about the NetBeans mailing lists, visit:
> > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > >
> > >
> > >
> > >
> >
> > --
> Eric Bresie
> ebresie@gmail.com
>
>
AW: AW: How to Implement a New Language
Posted by Christian Lenz <ch...@gmx.net>.
Hey Eric,
I thinl so yes. So use a Textmate language from wherever you want. I just made a little repo as you already mentioned to collect all of them to use. And then the LSP for that language, if it exists.
I would prefer to have it inside NetBeans, because we are more flexible with the APIs making friends if needed or taking whatever is needed.
On the other hand I like 3rd Party pllugins more because of different release cycles. If we encounter a bug today, I can fix it today and release it today. Not possible with NetBeans if it is not a real blocker bug. Problem is again the problem that not all APIs are public to use them within your 3rd party plugin.
So at the end, it is up to you I would say.
Von: Eric Bresie
Gesendet: Donnerstag, 8. April 2021 14:20
An: dev@netbeans.apache.org
Betreff: Re: AW: How to Implement a New Language
Soooo...if one was to want to implement new Python or other new languages,
it would be possible to implement and leverage one of the implemented
servers like those defined here?
https://microsoft.github.io/language-server-protocol/implementors/servers/
Eric
On Mon, Apr 5, 2021 at 8:05 AM Christian Lenz <ch...@gmx.net>
wrote:
> You can see the full list (more are coming soon) of all languages which we
> can have in NetBeans here:
> https://github.com/Chris2011/netbeans-textmate-files
>
> This is just simple basic syntax highlighting for over 50 languages. Well
> known and some not well known.
>
> What is needed here for every language is:
>
> - Semantic syntax highlighting (more than with textmate I think)
> - Formatting (custom implementation or LSP?)
> - Refactoring (renaming, find usages, go to, etc. – LSP needed)
> - Hints/Fixes/Suggestions, etc – LSP needed + custom implementation if LSP
> doesn’t have that much
> - Braces matching, automatic closing of braces (custom implementation?)
> - Code completion – LSP needed
> - Code templates – custom implementation
> - Showing errors of the Syntax or Control flow – LSP needed
>
> So as an alternative to ANTLR which of course is good, we Need those stuff
> for textmate too. Where we can all implement the stuff based on textmate
> files and not only on g and g4 lexer and parser. If possible.
>
>
> Cheers
>
> Chris
>
> Von: John Kostaras
> Gesendet: Freitag, 2. April 2021 16:17
> An: dev@netbeans.apache.org
> Betreff: Re: AW: How to Implement a New Language
>
> Hallo,
> the best 'tutorial' is chapter 11 of Pro Apache NetBeans
> <
> https://www.amazon.com/Pro-Apache-NetBeans-Building-Applications/dp/1484253698
> >
> book, even though it doesn't use the modern trend of TextMate and LSP, but
> it is based on ANTLR.
>
> This confluence page
> <https://cwiki.apache.org/confluence/display/NETBEANS/Community+plugins>
> provides an overview of the status of language support of Apache Netbeans.
> The situation is really bad, compared to the language support that existed
> back in NetBeans 8.2 for example, or even earlier versions. There are many
> old and half-baked plugins for many languages, and I don't know what is the
> best way to move ahead in this respect.
>
> Kind regards,
>
> John.
>
>
>
> On Mon, 29 Mar 2021 at 23:02, antonio <an...@vieiro.net> wrote:
>
> > Very true. Maintaining an ANTLR grammar over the years is difficult and
> > time consuming (see for instance all the changes to the NetBeans C++
> > grammar in NetBeans [1]).
> >
> > LSP servers, when mantained by knowledgeable teams, may give better
> > results with less effort. Apple, for instance, decided to move to clangd
> > (from libclang) a few years back ([2]).
> >
> > For simpler languages/DSLs I think Eclipse's XText
> > https://www.eclipse.org/Xtext/ outperforms JetBrain's MPS
> > https://www.jetbrains.com/mps/ (the generated parsers could then be
> > reused in NetBeans).
> >
> > Cheers,
> > Antonio
> >
> > [1]
> >
> >
> https://github.com/emilianbold/netbeans-releases/commits/master/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
> >
> > [2]
> > https://lists.llvm.org/pipermail/cfe-dev/2018-April/057668.html
> >
> >
> > El 29/3/21 a las 11:39, Christian Lenz escribió:
> > > Hey all,
> > >
> > > for myself I prefer adding new languages with textmate nowadays and
> LSP.
> > It is not possible for some languages to find updated versions of the
> ANTLR
> > Grammar file. For example C#. I dunno how it is for rust but yeah, I
> still
> > prefer Textmate. We Need to figure out how we can create the Tokens based
> > on the textmate file instead of ANTLR. I would prefer that. In the end,
> > everythins should be then the same as for ANTLR.
> > >
> > >
> > > Cheers
> > >
> > > Chris
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
>
> --
Eric Bresie
ebresie@gmail.com
Re: AW: How to Implement a New Language
Posted by Eric Bresie <eb...@gmail.com>.
Soooo...if one was to want to implement new Python or other new languages,
it would be possible to implement and leverage one of the implemented
servers like those defined here?
https://microsoft.github.io/language-server-protocol/implementors/servers/
Eric
On Mon, Apr 5, 2021 at 8:05 AM Christian Lenz <ch...@gmx.net>
wrote:
> You can see the full list (more are coming soon) of all languages which we
> can have in NetBeans here:
> https://github.com/Chris2011/netbeans-textmate-files
>
> This is just simple basic syntax highlighting for over 50 languages. Well
> known and some not well known.
>
> What is needed here for every language is:
>
> - Semantic syntax highlighting (more than with textmate I think)
> - Formatting (custom implementation or LSP?)
> - Refactoring (renaming, find usages, go to, etc. – LSP needed)
> - Hints/Fixes/Suggestions, etc – LSP needed + custom implementation if LSP
> doesn’t have that much
> - Braces matching, automatic closing of braces (custom implementation?)
> - Code completion – LSP needed
> - Code templates – custom implementation
> - Showing errors of the Syntax or Control flow – LSP needed
>
> So as an alternative to ANTLR which of course is good, we Need those stuff
> for textmate too. Where we can all implement the stuff based on textmate
> files and not only on g and g4 lexer and parser. If possible.
>
>
> Cheers
>
> Chris
>
> Von: John Kostaras
> Gesendet: Freitag, 2. April 2021 16:17
> An: dev@netbeans.apache.org
> Betreff: Re: AW: How to Implement a New Language
>
> Hallo,
> the best 'tutorial' is chapter 11 of Pro Apache NetBeans
> <
> https://www.amazon.com/Pro-Apache-NetBeans-Building-Applications/dp/1484253698
> >
> book, even though it doesn't use the modern trend of TextMate and LSP, but
> it is based on ANTLR.
>
> This confluence page
> <https://cwiki.apache.org/confluence/display/NETBEANS/Community+plugins>
> provides an overview of the status of language support of Apache Netbeans.
> The situation is really bad, compared to the language support that existed
> back in NetBeans 8.2 for example, or even earlier versions. There are many
> old and half-baked plugins for many languages, and I don't know what is the
> best way to move ahead in this respect.
>
> Kind regards,
>
> John.
>
>
>
> On Mon, 29 Mar 2021 at 23:02, antonio <an...@vieiro.net> wrote:
>
> > Very true. Maintaining an ANTLR grammar over the years is difficult and
> > time consuming (see for instance all the changes to the NetBeans C++
> > grammar in NetBeans [1]).
> >
> > LSP servers, when mantained by knowledgeable teams, may give better
> > results with less effort. Apple, for instance, decided to move to clangd
> > (from libclang) a few years back ([2]).
> >
> > For simpler languages/DSLs I think Eclipse's XText
> > https://www.eclipse.org/Xtext/ outperforms JetBrain's MPS
> > https://www.jetbrains.com/mps/ (the generated parsers could then be
> > reused in NetBeans).
> >
> > Cheers,
> > Antonio
> >
> > [1]
> >
> >
> https://github.com/emilianbold/netbeans-releases/commits/master/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
> >
> > [2]
> > https://lists.llvm.org/pipermail/cfe-dev/2018-April/057668.html
> >
> >
> > El 29/3/21 a las 11:39, Christian Lenz escribió:
> > > Hey all,
> > >
> > > for myself I prefer adding new languages with textmate nowadays and
> LSP.
> > It is not possible for some languages to find updated versions of the
> ANTLR
> > Grammar file. For example C#. I dunno how it is for rust but yeah, I
> still
> > prefer Textmate. We Need to figure out how we can create the Tokens based
> > on the textmate file instead of ANTLR. I would prefer that. In the end,
> > everythins should be then the same as for ANTLR.
> > >
> > >
> > > Cheers
> > >
> > > Chris
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
>
> --
Eric Bresie
ebresie@gmail.com
AW: AW: How to Implement a New Language
Posted by Christian Lenz <ch...@gmx.net>.
You can see the full list (more are coming soon) of all languages which we can have in NetBeans here: https://github.com/Chris2011/netbeans-textmate-files
This is just simple basic syntax highlighting for over 50 languages. Well known and some not well known.
What is needed here for every language is:
- Semantic syntax highlighting (more than with textmate I think)
- Formatting (custom implementation or LSP?)
- Refactoring (renaming, find usages, go to, etc. – LSP needed)
- Hints/Fixes/Suggestions, etc – LSP needed + custom implementation if LSP doesn’t have that much
- Braces matching, automatic closing of braces (custom implementation?)
- Code completion – LSP needed
- Code templates – custom implementation
- Showing errors of the Syntax or Control flow – LSP needed
So as an alternative to ANTLR which of course is good, we Need those stuff for textmate too. Where we can all implement the stuff based on textmate files and not only on g and g4 lexer and parser. If possible.
Cheers
Chris
Von: John Kostaras
Gesendet: Freitag, 2. April 2021 16:17
An: dev@netbeans.apache.org
Betreff: Re: AW: How to Implement a New Language
Hallo,
the best 'tutorial' is chapter 11 of Pro Apache NetBeans
<https://www.amazon.com/Pro-Apache-NetBeans-Building-Applications/dp/1484253698>
book, even though it doesn't use the modern trend of TextMate and LSP, but
it is based on ANTLR.
This confluence page
<https://cwiki.apache.org/confluence/display/NETBEANS/Community+plugins>
provides an overview of the status of language support of Apache Netbeans.
The situation is really bad, compared to the language support that existed
back in NetBeans 8.2 for example, or even earlier versions. There are many
old and half-baked plugins for many languages, and I don't know what is the
best way to move ahead in this respect.
Kind regards,
John.
On Mon, 29 Mar 2021 at 23:02, antonio <an...@vieiro.net> wrote:
> Very true. Maintaining an ANTLR grammar over the years is difficult and
> time consuming (see for instance all the changes to the NetBeans C++
> grammar in NetBeans [1]).
>
> LSP servers, when mantained by knowledgeable teams, may give better
> results with less effort. Apple, for instance, decided to move to clangd
> (from libclang) a few years back ([2]).
>
> For simpler languages/DSLs I think Eclipse's XText
> https://www.eclipse.org/Xtext/ outperforms JetBrain's MPS
> https://www.jetbrains.com/mps/ (the generated parsers could then be
> reused in NetBeans).
>
> Cheers,
> Antonio
>
> [1]
>
> https://github.com/emilianbold/netbeans-releases/commits/master/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
>
> [2]
> https://lists.llvm.org/pipermail/cfe-dev/2018-April/057668.html
>
>
> El 29/3/21 a las 11:39, Christian Lenz escribió:
> > Hey all,
> >
> > for myself I prefer adding new languages with textmate nowadays and LSP.
> It is not possible for some languages to find updated versions of the ANTLR
> Grammar file. For example C#. I dunno how it is for rust but yeah, I still
> prefer Textmate. We Need to figure out how we can create the Tokens based
> on the textmate file instead of ANTLR. I would prefer that. In the end,
> everythins should be then the same as for ANTLR.
> >
> >
> > Cheers
> >
> > Chris
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
Re: AW: How to Implement a New Language
Posted by John Kostaras <jk...@gmail.com>.
Hallo,
the best 'tutorial' is chapter 11 of Pro Apache NetBeans
<https://www.amazon.com/Pro-Apache-NetBeans-Building-Applications/dp/1484253698>
book, even though it doesn't use the modern trend of TextMate and LSP, but
it is based on ANTLR.
This confluence page
<https://cwiki.apache.org/confluence/display/NETBEANS/Community+plugins>
provides an overview of the status of language support of Apache Netbeans.
The situation is really bad, compared to the language support that existed
back in NetBeans 8.2 for example, or even earlier versions. There are many
old and half-baked plugins for many languages, and I don't know what is the
best way to move ahead in this respect.
Kind regards,
John.
On Mon, 29 Mar 2021 at 23:02, antonio <an...@vieiro.net> wrote:
> Very true. Maintaining an ANTLR grammar over the years is difficult and
> time consuming (see for instance all the changes to the NetBeans C++
> grammar in NetBeans [1]).
>
> LSP servers, when mantained by knowledgeable teams, may give better
> results with less effort. Apple, for instance, decided to move to clangd
> (from libclang) a few years back ([2]).
>
> For simpler languages/DSLs I think Eclipse's XText
> https://www.eclipse.org/Xtext/ outperforms JetBrain's MPS
> https://www.jetbrains.com/mps/ (the generated parsers could then be
> reused in NetBeans).
>
> Cheers,
> Antonio
>
> [1]
>
> https://github.com/emilianbold/netbeans-releases/commits/master/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
>
> [2]
> https://lists.llvm.org/pipermail/cfe-dev/2018-April/057668.html
>
>
> El 29/3/21 a las 11:39, Christian Lenz escribió:
> > Hey all,
> >
> > for myself I prefer adding new languages with textmate nowadays and LSP.
> It is not possible for some languages to find updated versions of the ANTLR
> Grammar file. For example C#. I dunno how it is for rust but yeah, I still
> prefer Textmate. We Need to figure out how we can create the Tokens based
> on the textmate file instead of ANTLR. I would prefer that. In the end,
> everythins should be then the same as for ANTLR.
> >
> >
> > Cheers
> >
> > Chris
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
Re: AW: How to Implement a New Language
Posted by antonio <an...@vieiro.net>.
Very true. Maintaining an ANTLR grammar over the years is difficult and
time consuming (see for instance all the changes to the NetBeans C++
grammar in NetBeans [1]).
LSP servers, when mantained by knowledgeable teams, may give better
results with less effort. Apple, for instance, decided to move to clangd
(from libclang) a few years back ([2]).
For simpler languages/DSLs I think Eclipse's XText
https://www.eclipse.org/Xtext/ outperforms JetBrain's MPS
https://www.jetbrains.com/mps/ (the generated parsers could then be
reused in NetBeans).
Cheers,
Antonio
[1]
https://github.com/emilianbold/netbeans-releases/commits/master/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
[2]
https://lists.llvm.org/pipermail/cfe-dev/2018-April/057668.html
El 29/3/21 a las 11:39, Christian Lenz escribió:
> Hey all,
>
> for myself I prefer adding new languages with textmate nowadays and LSP. It is not possible for some languages to find updated versions of the ANTLR Grammar file. For example C#. I dunno how it is for rust but yeah, I still prefer Textmate. We Need to figure out how we can create the Tokens based on the textmate file instead of ANTLR. I would prefer that. In the end, everythins should be then the same as for ANTLR.
>
>
> Cheers
>
> Chris
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
AW: How to Implement a New Language
Posted by Christian Lenz <ch...@gmx.net>.
Hey all,
for myself I prefer adding new languages with textmate nowadays and LSP. It is not possible for some languages to find updated versions of the ANTLR Grammar file. For example C#. I dunno how it is for rust but yeah, I still prefer Textmate. We Need to figure out how we can create the Tokens based on the textmate file instead of ANTLR. I would prefer that. In the end, everythins should be then the same as for ANTLR.
Cheers
Chris
Von: Jonathan Bergh
Gesendet: Sonntag, 28. März 2021 17:27
An: dev@netbeans.apache.org
Betreff: Re: How to Implement a New Language
Hi Eric
I tried a few months (maybe 6?) to implement RustLang into Netbeans
(actually sent a few emails to the dev list for help, but they never seemed
to be received on the list) and found that I had to experiment with the
various tutorials to get something working ie. following one or the other
completely (the older or the newer) didnt work.
The biggest thing was getting the grammar file for the language, getting it
to be parsed correctly, and then figure out how to get Netbeans classes to
tokenise things properly. I thought I had deleted the repo, but actually
its still here: https://github.com/icojb25/netbeans-rust/
I recall there was a Typescript plugin (repo is still on github somewhere)
and an existing Rust plugin where the authors had done a really nice job,
and I was able to lift a number of the concepts and what not from there. I
also recall there was an issue with the ANTLR versions available in NB
missing not being the same as those in the tutorials, (the NB lib being
newer).
Cheers
Jonathan
On Thu, Mar 25, 2021 at 9:48 PM antonio <an...@vieiro.net> wrote:
> Long story short: if you build it you're under control. If someone else
> builds the LSP server for you then you're not under control, but you
> don't have to build it.
>
> Note also that "implementing a new language" (adding support for it in
> NetBeans, if I understand your question correctly) is much more than
> lexing and parsing the language.
>
> You may want to add a specific project type, interact with language
> specific tools (Makefiles, pom.xml or whatever), add wizards, editor
> folding, editor hints, etc.
>
> HTH,
> Antonio
>
>
> On 25/03/2021 13:55, Eric Bresie wrote:
> > And what is the pros/con of each approach?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
Re: How to Implement a New Language
Posted by Jonathan Bergh <be...@gmail.com>.
Hi Eric
I tried a few months (maybe 6?) to implement RustLang into Netbeans
(actually sent a few emails to the dev list for help, but they never seemed
to be received on the list) and found that I had to experiment with the
various tutorials to get something working ie. following one or the other
completely (the older or the newer) didnt work.
The biggest thing was getting the grammar file for the language, getting it
to be parsed correctly, and then figure out how to get Netbeans classes to
tokenise things properly. I thought I had deleted the repo, but actually
its still here: https://github.com/icojb25/netbeans-rust/
I recall there was a Typescript plugin (repo is still on github somewhere)
and an existing Rust plugin where the authors had done a really nice job,
and I was able to lift a number of the concepts and what not from there. I
also recall there was an issue with the ANTLR versions available in NB
missing not being the same as those in the tutorials, (the NB lib being
newer).
Cheers
Jonathan
On Thu, Mar 25, 2021 at 9:48 PM antonio <an...@vieiro.net> wrote:
> Long story short: if you build it you're under control. If someone else
> builds the LSP server for you then you're not under control, but you
> don't have to build it.
>
> Note also that "implementing a new language" (adding support for it in
> NetBeans, if I understand your question correctly) is much more than
> lexing and parsing the language.
>
> You may want to add a specific project type, interact with language
> specific tools (Makefiles, pom.xml or whatever), add wizards, editor
> folding, editor hints, etc.
>
> HTH,
> Antonio
>
>
> On 25/03/2021 13:55, Eric Bresie wrote:
> > And what is the pros/con of each approach?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
Re: How to Implement a New Language
Posted by antonio <an...@vieiro.net>.
Long story short: if you build it you're under control. If someone else
builds the LSP server for you then you're not under control, but you
don't have to build it.
Note also that "implementing a new language" (adding support for it in
NetBeans, if I understand your question correctly) is much more than
lexing and parsing the language.
You may want to add a specific project type, interact with language
specific tools (Makefiles, pom.xml or whatever), add wizards, editor
folding, editor hints, etc.
HTH,
Antonio
On 25/03/2021 13:55, Eric Bresie wrote:
> And what is the pros/con of each approach?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists