Content assist and unordered groups [message #1756147] |
Mon, 13 March 2017 04:13  |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07623 seconds