Commit graph

3821 commits

Author SHA1 Message Date
Sebastian Zarnekow
aecc2d679c Merge pull request #186 from eclipse/maintenance
Merge fixes from maintenance into master
2015-04-23 17:17:54 +02:00
Sven Efftinge
2d18d6663e [bug 464762] Handle cases where resolve returns a detached proxy itself
Made PortableURIs more robust against EObjects without eResource.
Also fixed the cause, which was BatchLinkingService returning proxies instead of null, when something couldn't be resolved.

Signed-off-by: Sven Efftinge <sven.efftinge@itemis.de>
2015-04-22 16:48:04 +02:00
Moritz Eysholdt
7dc4339d7f [464867] fixed 'ITextRegionAccess cannot handle duplicate keywords'
https://bugs.eclipse.org/bugs/show_bug.cgi?id=464867

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-21 16:17:53 +02:00
Moritz Eysholdt
4296349f3e [465003] fixed 'ITextRegionAccess cannot handle duplicate terminal rule'
https://bugs.eclipse.org/bugs/show_bug.cgi?id=465003

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-21 16:17:51 +02:00
Moritz Eysholdt
fe2d242e2e [regionAccess] implemented regionsForFeatures()
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-21 16:17:48 +02:00
Moritz Eysholdt
303287508f [formatter] renamed test
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-21 16:17:45 +02:00
Moritz Eysholdt
0025d38d88 [formatter] fix ITextRegionAccess#getInvokingGrammarElement(EObject)
Make sure this method returns the same grammar element, no matter
whether the text region access has been constructid via 
serializer or node model.

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-20 15:42:33 +02:00
Sebastian Zarnekow
794ac2268e Merge pull request #12 from kthoms/bug443574-fsa-exists
[bug 443574] Added interface IFileSystemAccessExtension4
2015-04-20 08:29:42 +02:00
Sebastian Zarnekow
950a695bf1 Merge pull request #158 from kthoms/kth/380232
[380232] getColumn() should return 0 for "for no information available"
2015-04-20 08:26:18 +02:00
Moritz Eysholdt
367acdca29 Merge pull request #161 from eclipse/me/formatter2
Me/formatter2
2015-04-17 15:53:13 +02:00
Moritz Eysholdt
806eb6df59 Merge pull request #159 from eclipse/me/default_handler_for_undefined_ws
[formatter] format leftover undefined hidden regions
2015-04-17 15:52:44 +02:00
Sebastian Zarnekow
148c248c78 Merge pull request #162 from eclipse/sz/mergeaction
Merge fixes from maintenance into master
2015-04-17 13:53:34 +02:00
Sebastian Zarnekow
d58b8213f9 Merge branch 'maintenance' 2015-04-17 11:09:19 +02:00
Moritz Eysholdt
84bfecf6d0 [regionAccess] don't make merge() API for now
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-17 10:07:31 +02:00
Moritz Eysholdt
30a3737871 [formatter/serializer] added integration test
This particularly tests the changes introduced by 
37ab5c4965c9920dd625dee77b4a6d5a64bf7638

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-17 09:54:07 +02:00
Moritz Eysholdt
097a8a1dd3 [formatter] format leftover undefined hidden regions
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-17 09:50:51 +02:00
Miro Spönemann
e05160a685 [xtext] Fixed endless recursion and missing writer.flush() in Serializer,
renamed FormatterRequest.formatUndenfinedTokensOnly => formatUndefinedHiddenRegionsOnly

Signed-off-by: Miro Spönemann <miro.spoenemann@itemis.de>
2015-04-16 17:51:58 +02:00
Karsten Thoms
b8b82e13a3 [380232] getColumn() should return 0 for "for no information available"
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
2015-04-16 15:34:38 +02:00
Dennis Huebner
8ee759d365 [m2e] Added m2e builder to all m2e projects. Should not harm.
[jenkins] Added multi-thread option to maven projects

Signed-off-by: Dennis Huebner <dennis.huebner@itemis.de>
2015-04-16 15:11:58 +02:00
Stefan Oehme
cf31de0cce [idea] mavenized the projects needed to compile&test idea 2015-04-16 13:47:54 +02:00
Moritz Eysholdt
4d68371c5f [formatterTester] verify that all whitespace has been formatted
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-16 11:06:07 +02:00
Moritz Eysholdt
ca0442f9cf [formatter] several smaller improvements
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-16 11:06:04 +02:00
Karsten Thoms
deb0d72a67 [443574] Add IFileSystemAccessExtension4 with method isFile
Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
2015-04-16 08:25:29 +02:00
Moritz Eysholdt
baf57d3753 [formatter] count lines properly
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-14 21:52:26 +02:00
Moritz Eysholdt
e5c24c93f8 [formatter] avoid using internal classes of the node model
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-14 21:52:22 +02:00
Moritz Eysholdt
1ee6e956ef [formatter] improved API to to handle lines and indentation
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-14 21:52:20 +02:00
Moritz Eysholdt
d43dafa8be [formatter] cleaned up construction of text replacements
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-14 21:52:17 +02:00
Moritz Eysholdt
10ba865959 [formatter] ITextRegionAccess, TextSegment -> favor deleg. over inherit.
ITextRegionAccess should not inherit form AbstractTextSegment. 
It's better to use delegation: ITextRegionAccess#regionForDocument()

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-14 21:52:14 +02:00
Moritz Eysholdt
f73bc5c8db [formatter] factored out NodeModelBasedRegionAccessBuilder
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-14 21:52:11 +02:00
Moritz Eysholdt
71791b5e4b [formatter] IEObjectRegion sould extend ISemanticRegion
... because otherwise implementations of ISemanticRegion can't 
expose methods that IEOBjectRegion sould not have

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-14 21:52:09 +02:00
Moritz Eysholdt
cddd77f476 Merge pull request #153 from eclipse/me/formatter_improve_indent_api
[formatter] improve indent api
2015-04-14 21:45:14 +02:00
Moritz Eysholdt
19491ed0e1 Merge pull request #149 from eclipse/me/text_region_access
Me/text region access
2015-04-14 21:01:49 +02:00
Moritz Eysholdt
6392a08e3e [formatter] changed API to ensure indentation implies dedentation
The API useed to have the methods increaseIndentation() and
decreaseIndentation(). While this is quite flexible, it is also quite
likely that the two methods are not called symmetrically.

This can happen, if
- the developer forgets to call one of the methods
- due to a bug in the code's logic that calls one of the methods
- due to an exception that's being thrown after inc() has been called
  and before dec() would be called. Exceptions are likely to be thrown
  because formatter may be executed on syntactically broken documents.
  
If inc() and dec() aren't called symmetrically, the indenteation for the
remaining part of the document will be wrong which makes any formatter
look broken. Therefore, we can consider it to be the better solution to
apply one level of intention properly or not at all. 

The new API makes use of methods from the IFormattableDocument that are
resposnsible for two HiddenRegions at the same time. Namely, the methods
are:
- surround(ISemanticRegion)
- surround(EObject)
- interior(ISemanticRegion, ISemanticRegion)
- set(IHiddenRegion, IHiddenRegion)

When calling one of these methods, IHiddenRegionFormatting#indent() can
be used to increase the level of indentation form the first HiddenRegion
to the second one.

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-14 16:11:16 +02:00
Stefan Oehme
53613e9705 [maven] enable workspace resolution for maven dependencies 2015-04-14 10:35:56 +02:00
Moritz Eysholdt
531757ffc8 Merge pull request #148 from eclipse/mey/fix_quickfix_tests
[formatter][xtend][quickfix] assume formatted doc after sem qucikfix :)
2015-04-14 10:21:01 +02:00
Dennis Huebner
8e042ce1a8 [mvn] Fixed test projects versions
Signed-off-by: Dennis Huebner <dennis.huebner@itemis.de>
2015-04-13 18:39:35 +02:00
Dennis Huebner
51254ff49a Merge pull request #151 from eclipse/dh/replace-uberjar
Dh/replace uberjar
2015-04-13 14:53:07 +02:00
Moritz Eysholdt
3c6f47f974 [formatter] don't handle IOException from Appendable if not self-caused
Don't handle the IOException thrown by Appenadable#append(Object) when
we don't supply the implementation of Appendable.

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-13 11:05:25 +02:00
Moritz Eysholdt
f8657135a3 [formatter] JavaDoc to explain why grammar elements are of EObject
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-13 11:05:23 +02:00
Moritz Eysholdt
eca5996e4e [formatter][xtend][quickfix] assume formatted doc after sem qucikfix :)
- assume the document is formattet after applying a semantic quickfix
- in the formatter, make sure only 'unknown' hidden regions are
  formatted. 'unknown' regions are the regions that didn't exist before
  the model was programmatically modified.

Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-13 10:36:27 +02:00
Stefan Oehme
99b3a3120e [idea] turn on gradle dependency management 2015-04-13 10:31:21 +02:00
Dennis Huebner
f706946f5c [mvn] add some more modules
Signed-off-by: Dennis Huebner <dennis.huebner@itemis.de>
2015-04-10 17:50:50 +02:00
Moritz Eysholdt
63c142641e Merge pull request #146 from eclipse/mey/text_region_access_improvements
text region access improvements
2015-04-10 17:25:09 +02:00
Dennis Huebner
3a1b714dd8 Merge branch 'maintenance' 2015-04-10 16:13:52 +02:00
Dennis Huebner
6ee253a101 [releng] increased version 2.8.2 -> 2.8.3
Signed-off-by: Dennis Huebner <dennis.huebner@itemis.de>
2015-04-10 16:08:46 +02:00
Moritz Eysholdt
d3747b982f [formatter] allow access to regions representing EObjects
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-10 16:06:56 +02:00
Moritz Eysholdt
c5b88abc30 [formatter] avoid names such as 'gap' and 'token'
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-10 16:06:53 +02:00
Moritz Eysholdt
3a220ef882 [formatter] treat grammar elements as EObjects
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-10 16:06:51 +02:00
Moritz Eysholdt
9c351f2c74 [formatter] moved IText[Segment|Replacement] to package regionaccess
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-10 16:06:48 +02:00
Moritz Eysholdt
bf0b1e1927 [formatter] moved static methods into interface
Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
2015-04-10 16:06:45 +02:00