Content assist and unordered groups [message #1756147] |
Mon, 13 March 2017 08:13 |
Markus Duft Messages: 35 Registered: March 2015 |
Member |
|
|
Hey. I've been struggling with this one now for a few days, hopefully somebody can explain
I have this grammar (full grammar here):
LaunchConfig:
((explicit?='explicit')? // Eclipse, RAP
& (manual?='manual')? // All
& (abstract?='abstract')? // All
& (foreground?='foreground')? // All
& (noConsole?='no-console')? // All but Groups
& (noValidate?='no-validate')? // Eclipse, RAP
& (swInstallSupport?='sw-install-allowed')? // Eclipse
& (replaceEnv?='replace-env')? // All but Groups
& (stopInMain?='stop-in-main')? // Java
) type=LaunchConfigType 'configuration' name=FQName
(':' superConfig=[LaunchConfig|FQName])? BLOCK_BEGIN
( // things that may appear only once
(clears=ClearOption)? // Eclipse, RAP (partial)
& (workspace=Workspace)? // Eclipse, RAP
& (workingDir=WorkingDir)? // All but Groups
& (memory=MemoryOption)? // All but Groups
& (mainProject=MainProject)? // Java
& (mainType=MainType)? // Java
& (application=ApplicationExtPoint)? // Eclipse
& (product=ProductExtPoint)? // Eclipse
& (favorites=Favorites)? // All
& (redirect=Redirect)? // All but Groups
& (execEnv=ExecutionEnvironment)? // All but Groups
& (configIniTemplate=ConfigIniTemplate)? // Eclipse
& (javaMainSearch=JavaMainSearch)? // Java
& (servletConfig=RapServletConfig)? // RAP
& (contentProviderProduct=ContentProviderProduct)? // Eclipse, RAP
)
( // things that may appear multiple times
plugins+=AddPlugin // Eclipse, RAP
| features+=AddFeature // Eclipse, RAP
| ignore+=IgnorePlugin // Eclipse, RAP
| groupMembers+=GroupMember // Groups // TODO: content assist, validation, update on rename
| vmArgs+=VmArgument // All but Groups
| progArgs+=ProgramArgument // All but Groups
| envVars+=EnvironmentVariable // All but Groups
| traces+=TraceEnablement // Eclipse, RAP
)*
BLOCK_END
;
Everything works as expected, EXCEPT content assist If i have an "empty" launch config like this:
eclipse configuration Something {
// ...press ctrl space here
}
Content assist proposes all keywords from the first group only, but not a single one from the second group. Once i manually complete a single statement from the second group, it works.
I also tried merging the two groups, but that didn't fix it - it made it a little bit better. If i omit the second group and make every single member of it part of the first group like this:
(':' superConfig=[LaunchConfig|FQName])? BLOCK_BEGIN
( // things that may appear only once
(clears=ClearOption)? // Eclipse, RAP (partial)
& (workspace=Workspace)? // Eclipse, RAP
& (workingDir=WorkingDir)? // All but Groups
& (memory=MemoryOption)? // All but Groups
& (mainProject=MainProject)? // Java
& (mainType=MainType)? // Java
& (application=ApplicationExtPoint)? // Eclipse
& (product=ProductExtPoint)? // Eclipse
& (favorites=Favorites)? // All
& (redirect=Redirect)? // All but Groups
& (execEnv=ExecutionEnvironment)? // All but Groups
& (configIniTemplate=ConfigIniTemplate)? // Eclipse
& (javaMainSearch=JavaMainSearch)? // Java
& (servletConfig=RapServletConfig)? // RAP
& (contentProviderProduct=ContentProviderProduct)? // Eclipse, RAP
// things that may appear multiple times
& (plugins+=AddPlugin)* // Eclipse, RAP
& (features+=AddFeature)* // Eclipse, RAP
& (ignore+=IgnorePlugin)* // Eclipse, RAP
& (groupMembers+=GroupMember)* // Groups // TODO: content assist, validation, update on rename
& (vmArgs+=VmArgument)* // All but Groups
& (progArgs+=ProgramArgument)* // All but Groups
& (envVars+=EnvironmentVariable)* // All but Groups
& (traces+=TraceEnablement)* // Eclipse, RAP
)
BLOCK_END
Now I get proper proposal on the first line. But once I put a statement that can occur multiple times (the ones with *), I ONLY get proposal for that exact element until I manually write something else.
If I change all start to ? and convert the group to a look I of course get warnings that things that now appear once only can overwrite itself...
What is the correct solution to solve this with the grammar? Is there a way? Should I rather accept the overwrite warnings and solve the issue through validation?
Thanks!
Markus
|
|
|
|
Re: Content assist and unordered groups [message #1756151 is a reply to message #1756148] |
Mon, 13 March 2017 08:44 |
Markus Duft Messages: 35 Registered: March 2015 |
Member |
|
|
sure, for instance this:
manual eclipse configuration Database_Setup_With_Archive : BaseDataSetupConfig {
application com.wamas.world.datasetup.WorldDatabaseSetupApplication;
// here everything is proposed
memory min=128M max=512M;
// here everything is proposed
plugin com.wamas.world.datasetup;
// here only plugin is proposed
vm-argument '-Dcom.wamas.database.model=WMS';
// here only vm-argument is proposed.
}
Note: this example is with the "updated" grammar, so all in one group. with the prvious solution, plugin/vm-argument were NOT proposed in the first two examples above.
[Updated on: Mon, 13 March 2017 08:46] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08246 seconds