Skip to content

Commit

Permalink
Supply a ToStringBuilder in common location
Browse files Browse the repository at this point in the history
When the dependency on xbase.lib was removed in #529 it put the
implicit requirement that there is a class called ToStringBuilder
in a sub-package of the xtend class called `util`.

This change provides the ToStringBuilder in an util package
in the org.eclipse.lsp4j.jsonrpc bundle so that consumers
of LSP4J do not need to copy ToStringBuilder into their
own source code.

Fixes #742
  • Loading branch information
jonahgraham committed Feb 12, 2024
1 parent fc5de60 commit 8266805
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 760 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Breaking API changes:
* See [#768](https://github.com/eclipse-lsp4j/lsp4j/issues/768) for detailed discussion.
* The name field in WorkspaceFolder is no longer optional according to the specification.
* See [#741](https://github.com/eclipse-lsp4j/lsp4j/issues/741) for detailed discussion.
* The LSP4J generator when applied to `@JsonRpcData` annotated classes generates a dependency on package `org.eclipse.lsp4j.jsonrpc.util` in the `org.eclipse.lsp4j.jsonrpc` bundle.
* This removes the implied requirement in LSP4J 0.21.0 that there is a class called `ToStringBuilder` in a sub-package called `util`.
* See [#742](https://github.com/eclipse-lsp4j/lsp4j/issues/742) for detailed discussion.

Nightly japicmp report: <https://download.eclipse.org/lsp4j/builds/main/japicmp-report/>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,7 @@ class JsonRpcDataProcessor extends AbstractClassProcessor {
returnType = string
addAnnotation(newAnnotationReference(Override))
val accessorsUtil = new AccessorsProcessor.Util(context)
val fqn = impl.qualifiedName
val char dot = '.'
val pkg = fqn.substring(0, fqn.lastIndexOf(dot))
val toStringBuilderClassName = (pkg+".util.ToStringBuilder")
val toStringBuilderClassName = ("org.eclipse.lsp4j.jsonrpc.util.ToStringBuilder")
body = '''
«toStringBuilderClassName.newTypeReference()» b = new «toStringBuilderClassName.newTypeReference()»(this);
«FOR field : toStringFields»
Expand Down
Loading

0 comments on commit 8266805

Please sign in to comment.