Add support for info messages from reconciler.

This commit is contained in:
Kris De Volder
2017-09-22 10:57:24 -07:00
parent 7adb4fa3cc
commit e6e960d924
5 changed files with 48 additions and 16 deletions

View File

@@ -17,6 +17,7 @@ package org.springframework.ide.vscode.commons.languageserver.reconcile;
public enum ProblemSeverity {
IGNORE,
INFO,
WARNING,
ERROR;

View File

@@ -0,0 +1,42 @@
/*******************************************************************************
* Copyright (c) 2017 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.vscode.commons.languageserver.reconcile;
public class ProblemTypes {
/**
* Creates a new problem type. The newly created problem type is not 'equals' to any other
* problem type.
*
* @param defaultSeverity
* @param typeName A unique name for this problem type. Note that it is the caller's responsibility that the typeName is unique.
* If this method is called more than once with identical typeName's it makes no attempts to veify that
* the name is uniquer, or to return the same object for the same typeName.
* @return A newly create problem type.
*/
public static ProblemType create(String typeName, ProblemSeverity defaultSeverity) {
return new ProblemType() {
@Override
public String toString() {
return typeName;
}
@Override
public ProblemSeverity getDefaultSeverity() {
return defaultSeverity;
}
@Override
public String getCode() {
return typeName;
}
};
}
}

View File

@@ -426,6 +426,8 @@ public abstract class SimpleLanguageServer implements LanguageServer, LanguageCl
return DiagnosticSeverity.Error;
case WARNING:
return DiagnosticSeverity.Warning;
case INFO:
return DiagnosticSeverity.Information;
case IGNORE:
return null;
default:

View File

@@ -15,7 +15,7 @@ import java.io.File;
/**
* Utilitity methods for working with files
*
* @authro Kris De Volder
* @author Kris De Volder
* @author Alex Boyko
*/
public class FileUtils {

View File

@@ -19,6 +19,7 @@ import org.springframework.ide.vscode.commons.languageserver.quickfix.Quickfix.Q
import org.springframework.ide.vscode.commons.languageserver.quickfix.QuickfixType;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemSeverity;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemType;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ProblemTypes;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ReconcileProblem;
import org.springframework.ide.vscode.commons.languageserver.reconcile.ReconcileProblemImpl;
import org.springframework.ide.vscode.commons.languageserver.util.DocumentRegion;
@@ -61,21 +62,7 @@ public class YamlSchemaProblems {
);
public static ProblemType problemType(final String typeName, ProblemSeverity defaultSeverity) {
return new ProblemType() {
@Override
public String toString() {
return typeName;
}
@Override
public ProblemSeverity getDefaultSeverity() {
return defaultSeverity;
}
@Override
public String getCode() {
return typeName;
}
};
return ProblemTypes.create(typeName, defaultSeverity);
}
public static ProblemType problemType(final String typeName) {