Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

-listener preference not working #137

Open
renzet opened this issue Feb 3, 2016 · 10 comments
Open

-listener preference not working #137

renzet opened this issue Feb 3, 2016 · 10 comments
Assignees
Labels

Comments

@renzet
Copy link

renzet commented Feb 3, 2016

I don't use the listener so I disabled the checkbox for generating a listener on the ANTLR preference pane:

screen shot 2016-02-03 at 02 53 21

But it still uses the -listener flag when building a grammar:

screen shot 2016-02-03 at 02 53 33

@renzet
Copy link
Author

renzet commented Feb 16, 2016

Moving the grammar file from the top level folder of the project to a subfolder (package) resolves this issue..

@xoxota99
Copy link

-visitor setting is also ignored, regardless of where the .g4 file is located in the project.

@arifogel
Copy link
Member

arifogel commented Nov 6, 2016

This is the same issue as #143. I will look into this when I get the chance.

@arifogel arifogel self-assigned this Nov 6, 2016
@HSorensen
Copy link
Member

Can you try to reproduce this with v0.3.7.

@arifogel
Copy link
Member

Just so we are clear: 0.3.7 is identical to 0.3.6 codewise at the moment.
0.3.6 is the release I recently created with HSorensen's and my recent
fixes.

On Thu, Nov 10, 2016 at 11:27 AM, HSorensen notifications@github.com
wrote:

Can you try to reproduce this with v0.3.7.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/jknack/antlr4ide/issues/137#issuecomment-259783593,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHYSEjI37nN5DUgMiuxZxm6Lk2pyFEiLks5q83AJgaJpZM4HSEWM
.

@HSorensen
Copy link
Member

@arifogel Thanks btw for stepping up here!
My pull request fixed a number of issues with 0.3.6 and so did yours.

@HSorensen HSorensen added the bug label Nov 14, 2016
@HSorensen
Copy link
Member

HSorensen commented Nov 14, 2016

So I discovered there is a problem when ANTLR4IDE rebuilds the full project that might relate to the observations mentioned in this issue.
It seems under some circumstances the default tool options are used and not the project specific tool options.
I my test project I have two grammars

(1) src-import\testissue.g4
(2) src-import\imports\A.g4

The testissue.g4 grammar has:

grammar testissue;
import A;

When changing the project specific tool settings the following rebuilds are done:

ANTLR Tool v4.5.2-SNAPSHOT (C:\git\antlr4\tool\target\antlr4-4.5.2-SNAPSHOT.jar)
A.g4 -o C:\workspace\TestStuff\target\generated-sources\antlr4 -listener -visitor -lib ../ -encoding UTF-8

ANTLR Tool v4.5.2-SNAPSHOT (C:\git\antlr4\tool\target\antlr4-4.5.2-SNAPSHOT.jar)
testissue.g4 -o C:\workspace\TestStuff\target\generated-sources\antlr4 -no-listener -no-visitor -lib C:\workspace\TestStuff\src-import\imports -encoding UTF-8

Note the different -listener and -visitor options used by the two different invocations. They should have been the same as the project specific setting (-listener and -visitor).

Something is wrong here.

@timeraider4u
Copy link
Member

I can confirm this bug using the described steps above.

@timeraider4u timeraider4u self-assigned this Nov 14, 2016
@timeraider4u
Copy link
Member

After doing some research on this issue, I would guess that the problem is that com.github.jknack.antlr4ide.ui.generator.DefaultToolOptionsProvider iterates through all Eclipse launch configurations at line 85. Can you please provide your launch configurations, so that I can ensure that my observation is correct (in Eclipse right-click in the Package Explorer at a .g4 file and select run-as -> external tool configuratioins and list the configurations under ANTLR with the grammar and the arguments)? Also, I would like to know if it is using the right settings if you manually delete the corresponding launch configurations.

@HSorensen
Copy link
Member

I noticed I had an external run config for one file in my project. This config was used when building the project. After removing that config I can not reproduce the issue.

@arifogel arifogel removed their assignment Jan 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants