-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added diagnostic and CodeAction to use let to replace with
Signed-off-by: Alexander Chen <[email protected]>
- Loading branch information
Alexander Chen
committed
Mar 11, 2022
1 parent
d9b8f83
commit 11955cf
Showing
7 changed files
with
279 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...om.redhat.qute.ls/src/main/java/com/redhat/qute/parser/template/ObjectPartASTVisitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package com.redhat.qute.parser.template; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import com.redhat.qute.parser.expression.ObjectPart; | ||
|
||
/** | ||
* Collect object part names. | ||
* | ||
* @author Angelo ZERR | ||
* | ||
*/ | ||
public class ObjectPartASTVisitor extends ASTVisitor { | ||
|
||
private final Set<String> objectPartNames; | ||
|
||
public ObjectPartASTVisitor() { | ||
this.objectPartNames = new HashSet<>(); | ||
} | ||
|
||
@Override | ||
public boolean visit(ObjectPart node) { | ||
objectPartNames.add(node.getPartName()); | ||
return true; | ||
} | ||
|
||
public Set<String> getObjectPartNames() { | ||
return objectPartNames; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.