コード例 #1
0
 static void addCreateProposals(
     Tree.CompilationUnit cu,
     Node node,
     Collection<ICompletionProposal> proposals,
     IProject project,
     IFile file) {
   Tree.MemberOrTypeExpression smte = (Tree.MemberOrTypeExpression) node;
   String brokenName = Nodes.getIdentifyingNode(node).getText();
   if (!brokenName.isEmpty()) {
     ValueFunctionDefinitionGenerator vfdg =
         ValueFunctionDefinitionGenerator.create(brokenName, smte, cu);
     if (vfdg != null) {
       if (smte instanceof Tree.BaseMemberExpression) {
         Tree.BaseMemberExpression bme = (Tree.BaseMemberExpression) smte;
         Tree.Identifier id = bme.getIdentifier();
         if (id.getToken().getType() != CeylonLexer.AIDENTIFIER) {
           addCreateParameterProposal(proposals, project, vfdg);
         }
       }
       addCreateProposals(cu, proposals, project, file, smte, vfdg);
     }
     ObjectClassDefinitionGenerator ocdg =
         ObjectClassDefinitionGenerator.create(brokenName, smte, cu);
     if (ocdg != null) {
       addCreateProposals(cu, proposals, project, file, smte, ocdg);
     }
   }
 }
コード例 #2
0
ファイル: ImportVisitor.java プロジェクト: quintesse/ceylon
 private void checkAliasCase(Tree.Alias alias, Declaration d) {
   if (alias != null) {
     Tree.Identifier id = alias.getIdentifier();
     int tt = id.getToken().getType();
     if (d instanceof TypeDeclaration && tt != CeylonLexer.UIDENTIFIER) {
       id.addError("imported type should have uppercase alias: '" + d.getName() + "'");
     } else if (d instanceof TypedDeclaration && tt != CeylonLexer.LIDENTIFIER) {
       id.addError("imported member should have lowercase alias: '" + d.getName() + "'");
     }
   }
 }