Skip to content

Commit

Permalink
Add license header and class comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RadCod3 committed Feb 28, 2024
1 parent 3aa4429 commit 4fa5982
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

package io.ballerina.cli.utils;

import io.ballerina.compiler.internal.diagnostics.StringDiagnosticProperty;
Expand All @@ -12,6 +28,11 @@

import static io.ballerina.cli.utils.DiagnosticAnnotation.SEVERITY_COLORS;

/**
* This class is used to generate diagnostic annotations from diagnostics.
*
* @since 2201.9.0
*/
public class AnnotateDiagnostics {

public static String renderDiagnostic(Diagnostic diagnostic, Document document, int terminalWidth) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

package io.ballerina.cli.utils;

import io.ballerina.tools.diagnostics.DiagnosticSeverity;

import java.util.ArrayList;
import java.util.HashMap;

/**
* Represents a diagnostic annotation that is used to annotate the source code with diagnostics.
*
* @since 2201.9.0
*/
public class DiagnosticAnnotation {

private final ArrayList<String> lines;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
// Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

package io.ballerina.compiler.internal.diagnostics;

import io.ballerina.tools.diagnostics.DiagnosticProperty;
import io.ballerina.tools.diagnostics.DiagnosticPropertyKind;

import java.util.Arrays;

/**
* Represents a string diagnostic property.
*
* @since 2201.9.0
*/
public class StringDiagnosticProperty implements DiagnosticProperty<String> {
private final DiagnosticPropertyKind kind;
private final String value;
Expand Down

0 comments on commit 4fa5982

Please sign in to comment.