Skip to content

Commit 1b7ba48

Browse files
committed
language-server: hover and definition resolve void and * types
1 parent 1d0626e commit 1b7ba48

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

language-server/src/main/java/com/as3mxml/vscode/providers/DefinitionProvider.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.royale.compiler.common.ISourceLocation;
2727
import org.apache.royale.compiler.common.XMLName;
2828
import org.apache.royale.compiler.constants.IASKeywordConstants;
29+
import org.apache.royale.compiler.constants.IASLanguageConstants.BuiltinType;
2930
import org.apache.royale.compiler.constants.IMetaAttributeConstants;
3031
import org.apache.royale.compiler.css.ICSSDocument;
3132
import org.apache.royale.compiler.css.ICSSNamespaceDefinition;
@@ -314,6 +315,14 @@ private Either<List<? extends Location>, List<? extends LocationLink>> actionScr
314315
}
315316
break;
316317
}
318+
case ANY_TYPE: {
319+
definition = projectData.project.getBuiltinType(BuiltinType.ANY_TYPE);
320+
break;
321+
}
322+
case VOID: {
323+
definition = projectData.project.getBuiltinType(BuiltinType.VOID);
324+
break;
325+
}
317326
default:
318327
}
319328
if (definition == null && expressionToResolve != null) {

language-server/src/main/java/com/as3mxml/vscode/providers/HoverProvider.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.royale.compiler.common.ISourceLocation;
2424
import org.apache.royale.compiler.constants.IASKeywordConstants;
2525
import org.apache.royale.compiler.constants.IMetaAttributeConstants;
26+
import org.apache.royale.compiler.constants.IASLanguageConstants.BuiltinType;
2627
import org.apache.royale.compiler.common.XMLName;
2728
import org.apache.royale.compiler.css.ICSSDocument;
2829
import org.apache.royale.compiler.css.ICSSNamespaceDefinition;
@@ -305,6 +306,14 @@ private Hover actionScriptHover(IASNode offsetNode, ILspProject project) {
305306
}
306307
break;
307308
}
309+
case ANY_TYPE: {
310+
definition = project.getBuiltinType(BuiltinType.ANY_TYPE);
311+
break;
312+
}
313+
case VOID: {
314+
definition = project.getBuiltinType(BuiltinType.VOID);
315+
break;
316+
}
308317
default:
309318
}
310319
if (definition == null && expressionToResolve != null) {

0 commit comments

Comments
 (0)