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 13, 2024
1 parent fc5de60 commit 2bf75f5
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 759 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ 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`.
* This also removes the duplicated class `ToStringBuilder` in packages `org.eclipse.lsp4j.debug.util` and `org.eclipse.lsp4j.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

0 comments on commit 2bf75f5

Please sign in to comment.