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

Can't enter a relative path in Preferences->ANTLR 4->Tool #150

Open
sithys opened this issue Nov 6, 2016 · 11 comments
Open

Can't enter a relative path in Preferences->ANTLR 4->Tool #150

sithys opened this issue Nov 6, 2016 · 11 comments

Comments

@sithys
Copy link

sithys commented Nov 6, 2016

I cannot set a relative path under the ANTLR Tool Distributions settings. I want to enter a relative path so that I can push my project to GIT and not have to modify any project settings to use my project with a different linux username.

If I try to modify the path by hand using nano, the IDE starts to break down. It begins ignoring project settings and instead defaults to workspace settings. You get errors saying that the generator and the runtime use different versions of ANTLR.

In this state attempting to set the @Header with a package name will cause ANTLR 4 IDE to generate sources into the incorrect folder.

If you delete all the data generated by eclipse (the .recommenders and .metadata hidden folders) and restart eclipse, then import the project, ANTLR 4 IDE appears to rewrite that file to use an absolute path in place of your relative path that you hand-entered.

/xfilesmusic

@arifogel
Copy link
Member

arifogel commented Nov 7, 2016

Can you provide a screenshot and say the exact steps you would like to be able to perform with references to one or more UI elements in your screenshot?

@sithys
Copy link
Author

sithys commented Nov 8, 2016

antlr tool project properties

For example, if I have the antlr.jar file located in the lib folder under the project root folder, then when I browse to that antlr.jar file and click Ok, the resulting path should be ./lib/antlr.jar instead of /home/usrname/workspace/ProjectName/lib/antlr.jar (the current behavior)

Implementation option 1: When you click Add in the Project Properties->ANTLR->Tool dialog under the distributions list, if you brows to a path that is under the project path then when you click "Ok" in the file browser the relative path of the file should be placed in the Path field of the distribution item.

Implementation option 2: There will be a new button on the UI called Add Relative which opens the folder browser to the project root directory and makes a relative path from what the user selects.

@arifogel
Copy link
Member

arifogel commented Nov 8, 2016

So the tool path can be specified in both window->preferences and project
specific settings. In the former, it doesn't really make sense to be able
to use a relative path, which confuses the design of the latter. In the
latter, I think it would make sense to just be able to use variables like
workspace_loc in the path (not '.', which is a little ambiguous). Does that
make sense?

On Nov 8, 2016 9:03 AM, "sithys" notifications@github.com wrote:

[image: antlr tool project properties]
https://cloud.githubusercontent.com/assets/2238840/20108557/483f1094-a591-11e6-8499-b3612d7264c8.PNG

For example, if I have the antlr.jar file located in the lib folder under
the project root folder, then when I browse to that antlr.jar file and
click Ok, the resulting path should be ./lib/antlr.jar instead of
/home/usrname/workspace/ProjectName/lib/antlr.jar (the current behavior)

Implementation option 1: When you click Add in the Project
Properties->ANTLR->Tool dialog under the distributions list, if you brows
to a path that is under the project path then when you click "Ok" in the
file browser the relative path of the file should be placed in the Path
field of the distribution item.

Implementation option 2: There will be a new button on the UI called Add
Relative which opens the folder browser to the project root directory and
makes a relative path from what the user selects.


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/jknack/antlr4ide/issues/150#issuecomment-259195517,
or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHYSEnCif6u5qHFoDybo4U0EGXQK7vUuks5q8KtXgaJpZM4Kqd70
.

@sithys
Copy link
Author

sithys commented Nov 8, 2016

Yeah, a variable would be better. That's how most IDEs do it, come to think of it.

@HSorensen
Copy link
Member

If I understood your usecase correctly, you want to store the path for the antlr jar relatively to the workspace such that different users can use the same settings.

How do you share the eclipse preferences between your different users ?

The reason I am asking is that the preferences are stored per user anyway and they would have to configure the preferences for the new antlr jar at least once.

@sithys
Copy link
Author

sithys commented Nov 10, 2016

Are the project settings not stored inside the project folder? If my VM crashes or I need to revert it, or if I make a VM with a different name, I want to use git pull to start working where I left off without changing anything in the project after installing eclipse/antlr4 ide/xtext

Get Outlook for iOShttps://aka.ms/o0ukef


From: HSorensen <notifications@github.commailto:notifications@github.com>
Sent: Thursday, November 10, 2016 11:21 AM
Subject: Re: [jknack/antlr4ide] Can't enter a relative path in Preferences->ANTLR 4->Tool (#150)
To: jknack/antlr4ide <antlr4ide@noreply.github.commailto:antlr4ide@noreply.github.com>
Cc: Author <author@noreply.github.commailto:author@noreply.github.com>, sithys <secretgenius@hotmail.commailto:secretgenius@hotmail.com>

If I understood your usecase correctly, you want to store the path for the antlr jar relatively to the workspace such that different users can use the same settings.

How do you share the eclipse preferences between your different users ?

The reason I am asking is that the preferences are stored per user anyway and they would have to configure the preferences for the new antlr jar at least once.

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/jknack/antlr4ide/issues/150#issuecomment-259782174, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACIpeO9I8-qdg6ZmbTu6lwOUXtsxZ4vUks5q827NgaJpZM4Kqd70.

@HSorensen
Copy link
Member

The preferences are stored somewhere in the workspace/.metadata.
I guess your usecase goes beyond just antlr4ide and is more a question of how manage multiple eclipse configurations consistently across multiple users and potentially versions of eclipse.

See the eclipse help for
Multiple User Installs

@sithys
Copy link
Author

sithys commented Nov 10, 2016

I should note that I have "Use project specific configuragion" checked.

If I delete metadata my options are still there for antler4 IDE when I restart eclipse and import the project.

Get Outlook for iOShttps://aka.ms/o0ukef

On Thu, Nov 10, 2016 at 2:42 PM -0800, "HSorensen" <notifications@github.commailto:notifications@github.com> wrote:

The preferences are stored somewhere in the workspace/.metadata.
I guess your usecase goes beyond just antlr4ide and is more a question of how manage multiple eclipse configurations consistently across multiple users and potentially versions of eclipse.

See the eclipse help for
Multiple User Installshttp://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fmulti_user_installs.html

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/jknack/antlr4ide/issues/150#issuecomment-259829625, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACIpeD1sgZ6JhgSnVMUPLrXQWBo-BZ-Qks5q8524gaJpZM4Kqd70.

@timeraider4u
Copy link
Member

If you enable project-specific settings for a project then these settings are stored inside the project directory itself inside a hidden folder with the name .settings.
So an example path could then be something like /home/harry/workspace/MyProject/.settings/com.github.jknack.antlr4ide.Antlr4.prefs

@HSorensen
Copy link
Member

HSorensen commented Nov 12, 2016

I see it now. So two options to either "add Jar" (relative to workspace) or "add external Jar" (from filesystem) would make sense, Similar to the build path.

@gion86
Copy link

gion86 commented Sep 27, 2021

Hello,

any news on this issue? I'm having the same problem: how to specify a relative path.

When, for example, the project is under git version control, the same com.github.jknack.antlr4ide.Antlr4.prefs file is shared among different users.. but they have different absolute path of the ANTLR tool.

So how to solve this situation?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants