| Summary: | [Documentation] Explain how to extend/customize auto edit and partitioning (was: Multiple MultiLineTerminalsEditStrategy can be applied) | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Ed Willink <ed> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jan, sebastian.zarnekow, sven.efftinge |
| Version: | 2.0.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
Please provide a sample input file including the cursor position that fails with teh default auto edit strategies. Thanks. With M5 plus the latest N-builds of Xtext, OCL: editing /org.eclipse.ocl.examples.xtext.tests/src/org/eclipse/ocl/examples/test/xtext/models/OCL-2.3.oclstdlib goto to end of file place cursor after final **/ hit return inserts )* )*/ when just a new line was appropriate. Could you please attach the complete file or provide an http url to it? Thanks in advance. Did you define own terminal rules in your OCL language? If yes - did you customize / configure the document partitioning accordingly (see org.eclipse.xtext.ui.editor.model.TerminalsTokenTypeToPartitionMapper)? (In reply to comment #3) > Could you please attach the complete file or provide an http url to it? Thanks > in advance. > > Did you define own terminal rules in your OCL language? If yes - did you > customize / configure the document partitioning accordingly (see > org.eclipse.xtext.ui.editor.model.TerminalsTokenTypeToPartitionMapper)? The grammar with terminal in is: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.mdt/org.eclipse.ocl/examples/org.eclipse.ocl.examples.xtext.essentialocl/src/org/eclipse/ocl/examples/xtext/essentialocl/EssentialOCL.xtext?root=Modeling_Project&view=log An extending grammar demonstrating the problem is: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.mdt/org.eclipse.ocl/examples/org.eclipse.ocl.examples.xtext.oclstdlib/src/org/eclipse/ocl/examples/xtext/oclstdlib/OCLstdlib.xtext?root=Modeling_Project&view=log I suspect that one my definitions of /**...**/ documentation comments as distinct from /*...*/ comments and/or /'...'/ multi-line strings is interacting badly. Perhaps my grammar is stupid, perhaps it's just not what you anticipated, perhaps my subsequent value converters or cross reference setializers are ill-matched. As well as bad new-line behaviour, I also get very bad single quoted string editing; auto-edit invariably provides the opposite polarity insert/delete to what is required. It looks like use of the default TerminalsTokenTypeToPartitionMapper is incompatible with custom terminals; my partitioning seems pretty wierd. Perhaps this is a WONTFIX/INVALID idiotic user. Perhaps you want to try to auto-generate a TerminalsTokenTypeToPartitionMapper, or at least diagnose the user idiocy. This is something for the documentation. |
2.0M5 and a bit. The AutoEdit strategies use a simple partitioning that can fail. As a result the backwards search may find, with the aid of comment content, multiple 'unclosed' (), [], {}, /* */ etc. As a result a new line may perform multiple multipleline insertions. I've seen 4! with the DefaultAutoEditStrategy. Surely at most one, for the narrowest range should apply?