Actually I have a device which runs pre processed javascript. I have to create a custom editor which will contain preprocessed JS and html source code. So I have to provide JS intellisense in that editor.
IJ bundle provides intellisense in the editor with js extension while in my case the editor will have html extension and some additional methods and syntax different from normal javascript.
You can add com.intellij.psi.LanguageSubstitutor that will substitute html with whatever language you want.
For any syntax customisation you'll need to extend JavaScript language and tweak lexer/parser accordingly. You can see an example in AngularJS plugin sources
I am working on intellij community edition. Can you give me example source for intellij community edition. The earlier example is of intellij ultimate edition.
I have a .flex file, which I have already used to create the lexer for javascript. I also have intellij javascript source code, Can you tell me how can I create parser for javascript. There is no tutorial available for that and I also don't have .bnf file to create the parser.
if following is the licence statement in the source code:
/* * Copyright 2000-2005 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
I have integrated JavaScript parser code in my application, but whenever I run the build, the parse method of JavaScriptParser class is called recursively and then it exceeds the GC memory limit.
I want to know that whether it will be called recursively like this or am I doing something wrong.
I am having a trouble in implementing the lexer parser. The official tutorial is also illustrated the concept of the parser, but doesn't tell how to code for creating the parser. Can anyone help me to resolve this issue or give me links of some source code for the intellij community version.
Define "custom Javascript editor". What exactly do you want to achieve that is not available in IJ's bundled JS support?
Thanks for reply.
Actually I have a device which runs pre processed javascript. I have to create a custom editor which will contain preprocessed JS and html source code. So I have to provide JS intellisense in that editor.
IJ bundle provides intellisense in the editor with js extension while in my case the editor will have html extension and some additional methods and syntax different from normal javascript.
You can add com.intellij.psi.LanguageSubstitutor that will substitute html with whatever language you want.
For any syntax customisation you'll need to extend JavaScript language and tweak lexer/parser accordingly. You can see an example in AngularJS plugin sources
Thanks for reply.
I am working on intellij community edition. Can you give me example source for intellij community edition. The earlier example is of intellij ultimate edition.
Sorry, but JavaScript support is available only in ultimate edition. So there's no option to reuse existing JS support in community edition
Thanks for reply.
But I still can add custom JS support in community edition right? Or it is not possible?
Yes, you can. In this case you'll have to implement everything yourself: lexing, parsing, navigation, etc
Thanks for the reply.
I have a .flex file, which I have already used to create the lexer for javascript. I also have intellij javascript source code, Can you tell me how can I create parser for javascript. There is no tutorial available for that and I also don't have .bnf file to create the parser.
There's a tutorial on how to write parsers here http://www.jetbrains.org/intellij/sdk/docs/reference_guide/custom_language_support/implementing_parser_and_psi.html
"I also have intellij javascript source code" what do you mean exactly?
Thanks for reply
I have javascript editor source code developed by intellij. I have extracted it from an open source ide based on intellij.
Can I use that parser in my custom editor?
If the license of that source allows it, of course.
if following is the licence statement in the source code:
I'm not a lawyer :) but Apache License does allow it AFAIU
Ok anyway thanks for reply.
Hi,
I have integrated JavaScript parser code in my application, but whenever I run the build, the parse method of JavaScriptParser class is called recursively and then it exceeds the GC memory limit.
I want to know that whether it will be called recursively like this or am I doing something wrong.
Hi,
I am having a trouble in implementing the lexer parser. The official tutorial is also illustrated the concept of the parser, but doesn't tell how to code for creating the parser. Can anyone help me to resolve this issue or give me links of some source code for the intellij community version.
Please see http://www.jetbrains.org/intellij/sdk/docs/basics/checkout_and_build_community.html on how to checkout IntelliJ Community Edition sources.
.
Hi,
Can anyone tell me how to create language PsiImplUtil class?
Thanks
Hi,
Can someone provide me ".bnf" grammar file for javascript or ecmascript?
Thanks