Following the instructions here
am building a custom language plugin, after generating A lexer class and registering it into the plugin.xml then running the project was expectiong to see the PsiViewer (Tools | PSI view Structure) but its not visible, the file extensions are recognized, actions registered are showing up but PsiViewer is not showing in the menu.Why ?
Even after struggling to show the PsiViewer am un able to debug my plugin language file as it does not show the properties/ file token.
What am i missing ?
I have tried installing the PsiViewer plugin even in the debugging version of Intellij Community and copying the flex files from some of the open source intellij plugin projects but it still does not seem to work.(even after fixing all the grammertical errors)
ADD.
Here is Github Repo to a simplified version of the application
If you do not have them installed, you need to have the IntelliJ IDEA Dev Kit plugin installed, and (if you're not writing your parser by hand), the Grammer-Kit plugin, which helps with making parsers.
To show the PSI Viewer when it won't show up otherwise, add "-Didea.is.internal=true" to the VM Options of the run configuration dialog ("Run->Edit Configurations..."). The PSI Viewer does not require a plugin:
Then, put focus on the editor (in your source file), and use the "Tools->View PSI Structure of Current File..." menu item. That will show the PSI viewer.
Your project is set up correctly to run, except that you have to add a new run configuration as a Plugin.
Beyond that, your parser description needs to quote all of the keywords. Unquoted words are "missing rules". For example, from the grammar description (BNF file) of your project:
FunctionDefinition ::= function IDENTIFIER '(' ')' (returns Type)? '{' FunctionBody '}'
should be:
FunctionDefinition ::= "function" IDENTIFIER '(' ')' ("returns" Type)? '{' FunctionBody '}'
Related
I am trying to run a simple grammar file in IntelliJ with the ANTLR v4 grammar plugin on a new computer. I have followed the online steps for installing the plugin in IntelliJ, and the plugin looks like it is installed correctly. I have written simple code in a .g4 grammar file, and clicked the option to generate an ANTLR recognizer on the code. However, when I try to run the grammar file on the start rule by right-clicking the start rule, the option "Test ANTLR rule" is greyed out. When I look at the .g4 file, it does not show the ANTLR "red A" icon, but instead an icon with curly braces for generic files.
I have uninstalled and re-installed IntelliJ twice, uninstalled and in-installed the ANTLR v4 grammar plugin multiple times, and tried to find similar posts of this issue. I have been able to get the ANTLR plugin to work in other computers on the same steps, but it is not working for me this time.
grammar g;
prule: 'hello ' CHAR;
CHAR: 'a'..'z' | ' ' | 'A'..'Z';
After each attempted solution, I expected for the "Test ANTLR rule" option to be available and not greyed out when I right-click the start rule, but each time the option is disabled. Any assistance to be able to run the ANTLR code from the start rule will be really appreciated.
I had the same issue (Windows 10).
Updating IntelliJ to 2019 helped for me.
When there's an error in a file, IntelliJ underlines the relevant code in red and marks the position of the error in red on the right-hand side of the editor, e.g.
Is there some way that I can get a list of all errors in a module? I know IntelliJ has a "Problems" view, but I can't seem to display it, and I'm pretty sure low-level errors like this aren't shown in it anyway (IIRC it only shows project-wide problems such as missing dependencies).
In my case the module is a Grails app, so it contains both server-side (Groovy) code and front-end code (JS, HTML, CSS, etc.). If I run "Build Project" (or "Build Module") any errors in the JS code aren't listed in the output, presumably because JS code doesn't have to be built (compiled).
I'm using IntelliJ IDEA version 2018.3.3 (Ultimate Edition).
Select the module you wish to inspect in the Project pane on the left of the IDE
On the main menu, choose Analyze | Inspect Code
In the Inspection scope area, specify which files should be inspected
Click OK to run code analysis
Examine the results
Build | Build Project shows all errors in the project.
I did generate a code with ANTLR4 to parse a text input that I need it on a site created with JavaEE so I must transform it to .jar file to integrate it . how can I do that ?
I don t need the parsing tree inspector too that keep showing off , I just need the output that I generated it. How can I remove it ?
And thank you
There seems to be a misunderstanding here. Your generated parser + support files is all what you need to distribute. You pack those into a jar like you would do with any Java project (e.g. in Eclipse organize the parse stuff in a library and export that as jar).
In addition to that you need the ANTLR4 runtime. You can get the minimal runtime jar from the ANTLR4 website. That's it to deploy your parser.
I started creating a Test-Project for playing around with TypeScript in intelliJ IDEA 14. At first I added the angularjs_DefinitelyTyped TypeScript libraries in the Settings (Settings / Language & Frameworks / JavaScript / Libraries -> Download... -> TypeScript community stubs). At this point IntelliJ gave me the desired code-completition. I started creating a Controller as described here. Everything works fine.
The Problem I stumbled over occurs, when I installed the TypeScript transpiler with the "File Watchers"-Plugin as described in the IntelliJ IDEA 14 Web Help. Now I get the Error "error TS2304: cannot find name 'ng.'" when typing ... extends ng.IScope.
As i already downloaded the definition-Files I was hoping that the "File Watchers"-Plugin auto references these Files.
I tried manually referencing the these files but the TypeScript transpiler cannot resolve %userprofile%\.IntelliJIdea14\system\extLibs nor $USER_HOME$\....
Is there a solution without manually downloading and referencing all these Files in my Projects?
Does the tsc have an option to do this? I don't find anything about it.
Hope anybody can help me with this Problem ;-)
angularjs_DefinitelyTyped TypeScript libraries in the Settings (Settings / Language & Frameworks / JavaScript / Libraries -> Download... -> TypeScript community stubs).
That is how IntelliJ supports Type definitions for JavaScript projects. For TypeScript projects you need to include + reference the .d.ts files manually. TIP: create a vendor.d.ts file or use TSD : https://github.com/DefinitelyTyped/tsd/ it will create a reference tsd.d.ts file for you for all your imports
I have a Scala Play project. I'm using Play 2.2.1. I downloaded Scala, Play 2 supported and SBT plugins. Everything is OK, but When I call route on Action in the Controller appear following error(Look screenshots):
I'm using IntelliJ IDEA 12.1.6 Ultimate version. Scala version 2.10.2
Anybody know how to fix this problem?
Thanks in advance!
Edit
When I generate my project to Intellij IDEA via "play idea" command in play console, and I opened project in IDEA project structure was such:
Then I saw answer #millhouse and discussing on this githup([Play 2.2] "play idea" creates not working source mapping in target) and I removed following folders from Sources Folders:
target\scala-2.10\src_managed\main\controllers
target\scala-2.10\src_managed\main\views
and "Report highlighting error" disappeared, but now there is another error:
and
my route:
And I've changed "Sources Folders" as shown below:
But it doesn't help me. And remains "Unspecified value parametrs" error.
millhouse's answer helped me find the right answer. Play 2.2 (and perhaps earlier versions, haven't checked) output a scala version of the routes file to project_dir/target/scala-2.10/src_managed/main So for IntelliJ to get the highlighting right you need to make sure that src_managed/main is added as a source folder. The reverse routes for javascript are for some reason included in project_dir/target/scala-2.10/classes_managed so you'll have to add that as well. (In your screenshot it looks like classes_managed is set to excluded so you'll want to un-exclude it by pressing the x button on the right hand side.)
Here's a screen shot of my project structure:
Update:
In Play 2.3 (or perhaps recent versions of IntelliJ) adding the classes_managed no longer fixes the problem. Instead of adding classes_managed to the project's sources add it to it's dependencies. By doing that IntelliJ should be able to pick up the compiled routes.class.
This is a common problem, it's because IntelliJ needs to be shown where to look for the compiled Scala templates and routes file. Here's how I fixed it on my IntelliJ 12.1 installation:
Go to the Module Settings for your project in IntelliJ (select the top-level, hit F4)
Choose the Modules item in the Project Structure window that appears
Select the projectname item (as opposed to the projectname-build item)
Add the compiler's output directory to the Source Folders items;
For Scala 2.10 it's target/scala-2.10/classes
I personally find the IntelliJ UI for this to be very non-intuitive; you might need to take the target directory and/or one of its subdirectories out of the Excluded Folders first
After applying that change, IntelliJ should see the results of compiling each routes and .scala.html file as just-another source file, so they won't show as "broken" and auto-complete should work for them.