enhance deprecation of coloring service

Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
This commit is contained in:
Christian Dietrich 2020-01-10 07:52:19 +01:00
parent 664fb2e8e8
commit 828d11d33b
6 changed files with 12 additions and 8 deletions

View file

@ -15,6 +15,7 @@ import org.junit.Test
*
* @author akos.kitta - Initial contribution and API
*/
@Deprecated
class ColoringTest extends AbstractTestLangLanguageServerTest {
static val MODEL = '''

View file

@ -10,10 +10,8 @@ package org.eclipse.xtext.ide.tests.testlanguage
import org.eclipse.xtext.formatting2.IFormatter2
import org.eclipse.xtext.ide.editor.syntaxcoloring.ISemanticHighlightingCalculator
import org.eclipse.xtext.ide.serializer.hooks.IReferenceUpdater
import org.eclipse.xtext.ide.server.coloring.IColoringService
import org.eclipse.xtext.ide.server.semanticHighlight.ISemanticHighlightingStyleToTokenMapper
import org.eclipse.xtext.ide.server.signatureHelp.ISignatureHelpService
import org.eclipse.xtext.ide.tests.testlanguage.coloring.ColoringServiceImpl
import org.eclipse.xtext.ide.tests.testlanguage.editor.syntaxcoloring.SemanticHighlightingCalculatorImpl
import org.eclipse.xtext.ide.tests.testlanguage.editor.syntaxcoloring.SemanticHighlightingStyleToTokenMapper
import org.eclipse.xtext.ide.tests.testlanguage.formatting2.TestLanguageFormatter
@ -33,8 +31,9 @@ class TestLanguageRuntimeModule extends AbstractTestLanguageRuntimeModule {
return SignatureHelpServiceImpl;
}
def Class<? extends IColoringService> bindIColoringService() {
return ColoringServiceImpl;
@Deprecated
def Class<? extends org.eclipse.xtext.ide.server.coloring.IColoringService> bindIColoringService() {
return org.eclipse.xtext.ide.tests.testlanguage.coloring.ColoringServiceImpl;
}
def Class<? extends ISemanticHighlightingCalculator> bindISemanticHighlightingCalculator() {

View file

@ -26,6 +26,7 @@ import org.junit.Test;
*
* @author akos.kitta - Initial contribution and API
*/
@Deprecated
@SuppressWarnings("all")
public class ColoringTest extends AbstractTestLangLanguageServerTest {
private static final String MODEL = new Function0<String>() {

View file

@ -34,6 +34,7 @@ public class TestLanguageRuntimeModule extends AbstractTestLanguageRuntimeModule
return SignatureHelpServiceImpl.class;
}
@Deprecated
public Class<? extends IColoringService> bindIColoringService() {
return ColoringServiceImpl.class;
}

View file

@ -23,8 +23,6 @@ import org.eclipse.lsp4j.CodeActionContext
import org.eclipse.lsp4j.CodeActionParams
import org.eclipse.lsp4j.CodeLens
import org.eclipse.lsp4j.CodeLensParams
import org.eclipse.lsp4j.ColoringInformation
import org.eclipse.lsp4j.ColoringParams
import org.eclipse.lsp4j.Command
import org.eclipse.lsp4j.CompletionItem
import org.eclipse.lsp4j.CompletionList
@ -365,7 +363,8 @@ abstract class AbstractLanguageServerTest implements Endpoint {
return sb.toString;
}
protected dispatch def String toExpectation(ColoringInformation it) {
@Deprecated
protected dispatch def String toExpectation(org.eclipse.lsp4j.ColoringInformation it) {
return '''«range.toExpectation» -> [«styles.join(', ')»]''';
}
@ -704,9 +703,10 @@ abstract class AbstractLanguageServerTest implements Endpoint {
].get
}
@Deprecated
protected def getColoringParams() {
languageServer.requestManager.runRead[
return notifications.map[value].filter(ColoringParams).toMap([uri], [infos]);
return notifications.map[value].filter(org.eclipse.lsp4j.ColoringParams).toMap([uri], [infos]);
].get
}

View file

@ -785,6 +785,7 @@ public abstract class AbstractLanguageServerTest implements Endpoint {
return sb.toString();
}
@Deprecated
protected String _toExpectation(final ColoringInformation it) {
StringConcatenation _builder = new StringConcatenation();
String _expectation = this.toExpectation(it.getRange());
@ -1402,6 +1403,7 @@ public abstract class AbstractLanguageServerTest implements Endpoint {
}
}
@Deprecated
protected Map<String, List<? extends ColoringInformation>> getColoringParams() {
try {
final Function1<CancelIndicator, Map<String, List<? extends ColoringInformation>>> _function = (CancelIndicator it) -> {