unable to compile simple_language_plugin project

Answered

I am trying to understand the simple language plugin. However, a couple of source files don't compile:

 

Please let me know if I missed something.

Information:java: Errors occurred while compiling module 'simple_language_plugin'
Information:javac 1.8.0_221 was used to compile java sources
Information:9/18/19, 2:47 PM - Build completed with 100 errors and 0 warnings in 1 s 683 ms
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/SimpleChooseByNameContributor.java
Error:Error:line (3)java: package com.intellij.navigation does not exist
Error:Error:line (4)java: package com.intellij.openapi.project does not exist
Error:Error:line (6)java: package org.jetbrains.annotations does not exist
Error:Error:line (10)java: cannot find symbol
symbol: class ChooseByNameContributor
Error:Error:line (13)java: cannot find symbol
symbol: class Project
location: class com.simpleplugin.SimpleChooseByNameContributor
Error:Error:line (26)java: cannot find symbol
symbol: class Project
location: class com.simpleplugin.SimpleChooseByNameContributor
Error:Error:line (26)java: cannot find symbol
symbol: class NavigationItem
location: class com.simpleplugin.SimpleChooseByNameContributor
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/SimpleFileTypeFactory.java
Error:Error:line (3)java: package com.intellij.openapi.fileTypes does not exist
Error:Error:line (4)java: package org.jetbrains.annotations does not exist
Error:Error:line (6)java: cannot find symbol
symbol: class FileTypeFactory
Error:Error:line (8)java: cannot find symbol
symbol: class FileTypeConsumer
location: class com.simpleplugin.SimpleFileTypeFactory
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/gen/com/simpleplugin/psi/SimpleVisitor.java
Error:Error:line (4)java: package org.jetbrains.annotations does not exist
Error:Error:line (5)java: package com.intellij.psi does not exist
Error:Error:line (6)java: package com.intellij.psi does not exist
Error:Error:line (8)java: cannot find symbol
symbol: class PsiElementVisitor
Error:Error:line (18)java: cannot find symbol
symbol: class PsiElement
location: class com.simpleplugin.psi.SimpleVisitor
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/gen/com/simpleplugin/psi/SimpleProperty.java
Error:Error:line (5)java: package org.jetbrains.annotations does not exist
Error:Error:line (6)java: package com.intellij.psi does not exist
Error:Error:line (7)java: package com.intellij.navigation does not exist
Error:Error:line (17)java: cannot find symbol
symbol: class PsiElement
location: interface com.simpleplugin.psi.SimpleProperty
Error:Error:line (19)java: cannot find symbol
symbol: class PsiElement
location: interface com.simpleplugin.psi.SimpleProperty
Error:Error:line (21)java: cannot find symbol
symbol: class ItemPresentation
location: interface com.simpleplugin.psi.SimpleProperty
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/psi/SimpleNamedElement.java
Error:Error:line (3)java: package com.intellij.psi does not exist
Error:Error:line (5)java: cannot find symbol
symbol: class PsiNameIdentifierOwner
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/SimpleColorSettingsPage.java
Error:Error:line (3)java: package com.intellij.openapi.editor.colors does not exist
Error:Error:line (4)java: package com.intellij.openapi.fileTypes does not exist
Error:Error:line (5)java: package com.intellij.openapi.options.colors does not exist
Error:Error:line (6)java: package org.jetbrains.annotations does not exist
Error:Error:line (11)java: cannot find symbol
symbol: class ColorSettingsPage
Error:Error:line (12)java: cannot find symbol
symbol: class AttributesDescriptor
location: class com.simpleplugin.SimpleColorSettingsPage
Error:Error:line (26)java: cannot find symbol
symbol: class SyntaxHighlighter
location: class com.simpleplugin.SimpleColorSettingsPage
Error:Error:line (49)java: cannot find symbol
symbol: class TextAttributesKey
location: class com.simpleplugin.SimpleColorSettingsPage
Error:Error:line (55)java: cannot find symbol
symbol: class AttributesDescriptor
location: class com.simpleplugin.SimpleColorSettingsPage
Error:Error:line (61)java: cannot find symbol
symbol: class ColorDescriptor
location: class com.simpleplugin.SimpleColorSettingsPage
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/SimpleSyntaxHighlighterFactory.java
Error:Error:line (3)java: package com.intellij.openapi.fileTypes does not exist
Error:Error:line (4)java: package com.intellij.openapi.project does not exist
Error:Error:line (5)java: package com.intellij.openapi.vfs does not exist
Error:Error:line (6)java: package org.jetbrains.annotations does not exist
Error:Error:line (8)java: cannot find symbol
symbol: class SyntaxHighlighterFactory
Error:Error:line (11)java: cannot find symbol
symbol: class Project
location: class com.simpleplugin.SimpleSyntaxHighlighterFactory
Error:Error:line (11)java: cannot find symbol
symbol: class VirtualFile
location: class com.simpleplugin.SimpleSyntaxHighlighterFactory
Error:Error:line (11)java: cannot find symbol
symbol: class SyntaxHighlighter
location: class com.simpleplugin.SimpleSyntaxHighlighterFactory
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/SimpleIdIndexer.java
Error:Error:line (3)java: package com.intellij.lexer does not exist
Error:Error:line (4)java: package com.intellij.psi.impl.cache.impl does not exist
Error:Error:line (5)java: package com.intellij.psi.impl.cache.impl.id does not exist
Error:Error:line (7)java: cannot find symbol
symbol: class LexerBasedIdIndexer
Error:Error:line (9)java: cannot find symbol
symbol: class OccurrenceConsumer
location: class com.simpleplugin.SimpleIdIndexer
Error:Error:line (9)java: cannot find symbol
symbol: class Lexer
location: class com.simpleplugin.SimpleIdIndexer
Error:Error:line (14)java: cannot find symbol
symbol: class OccurrenceConsumer
location: class com.simpleplugin.SimpleIdIndexer
Error:Error:line (14)java: cannot find symbol
symbol: class Lexer
location: class com.simpleplugin.SimpleIdIndexer
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/SimpleReferenceContributor.java
Error:Error:line (3)java: package com.intellij.openapi.util does not exist
Error:Error:line (4)java: package com.intellij.patterns does not exist
Error:Error:line (5)java: package com.intellij.psi does not exist
Error:Error:line (6)java: package com.intellij.util does not exist
Error:Error:line (7)java: package org.jetbrains.annotations does not exist
Error:Error:line (9)java: cannot find symbol
symbol: class PsiReferenceContributor
Error:Error:line (11)java: cannot find symbol
symbol: class PsiReferenceRegistrar
location: class com.simpleplugin.SimpleReferenceContributor
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/SimpleAnnotator.java
Error:Error:line (3)java: package com.intellij.lang.annotation does not exist
Error:Error:line (4)java: package com.intellij.openapi.editor does not exist
Error:Error:line (5)java: package com.intellij.openapi.project does not exist
Error:Error:line (6)java: package com.intellij.openapi.util does not exist
Error:Error:line (7)java: package com.intellij.psi does not exist
Error:Error:line (9)java: package org.jetbrains.annotations does not exist
Error:Error:line (13)java: cannot find symbol
symbol: class Annotator
Error:Error:line (15)java: cannot find symbol
symbol: class PsiElement
location: class com.simpleplugin.SimpleAnnotator
Error:Error:line (15)java: cannot find symbol
symbol: class AnnotationHolder
location: class com.simpleplugin.SimpleAnnotator
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/CreatePropertyQuickFix.java
Error:Error:line (3)java: package com.intellij.codeInsight.intention.impl does not exist
Error:Error:line (4)java: package com.intellij.lang does not exist
Error:Error:line (5)java: package com.intellij.openapi.application does not exist
Error:Error:line (6)java: package com.intellij.openapi.command does not exist
Error:Error:line (7)java: package com.intellij.openapi.editor does not exist
Error:Error:line (8)java: package com.intellij.openapi.fileChooser does not exist
Error:Error:line (9)java: package com.intellij.openapi.fileChooser does not exist
Error:Error:line (10)java: package com.intellij.openapi.fileChooser does not exist
Error:Error:line (11)java: package com.intellij.openapi.fileEditor does not exist
Error:Error:line (12)java: package com.intellij.openapi.project does not exist
Error:Error:line (13)java: package com.intellij.openapi.project does not exist
Error:Error:line (14)java: package com.intellij.openapi.vfs does not exist
Error:Error:line (15)java: package com.intellij.pom does not exist
Error:Error:line (16)java: package com.intellij.psi does not exist
Error:Error:line (17)java: package com.intellij.psi does not exist
Error:Error:line (18)java: package com.intellij.psi.search does not exist
Error:Error:line (19)java: package com.intellij.psi.search does not exist
Error:Error:line (20)java: package com.intellij.util does not exist
Error:Error:line (21)java: package com.intellij.util.indexing does not exist
Error:Error:line (25)java: package org.jetbrains.annotations does not exist
Error:Error:line (29)java: cannot find symbol
symbol: class BaseIntentionAction
Error:Error:line (49)java: cannot find symbol
symbol: class Project
location: class com.simpleplugin.CreatePropertyQuickFix
Error:Error:line (49)java: cannot find symbol
symbol: class Editor
location: class com.simpleplugin.CreatePropertyQuickFix
Error:Error:line (49)java: cannot find symbol
symbol: class PsiFile
location: class com.simpleplugin.CreatePropertyQuickFix
Error:Error:line (54)java: cannot find symbol
symbol: class Project
location: class com.simpleplugin.CreatePropertyQuickFix
Error:Error:line (54)java: cannot find symbol
symbol: class Editor
location: class com.simpleplugin.CreatePropertyQuickFix
Error:Error:line (54)java: cannot find symbol
symbol: class PsiFile
location: class com.simpleplugin.CreatePropertyQuickFix
Error:Error:line (55)java: cannot find symbol
symbol: class IncorrectOperationException
location: class com.simpleplugin.CreatePropertyQuickFix
Error:Error:line (76)java: cannot find symbol
symbol: class Project
location: class com.simpleplugin.CreatePropertyQuickFix
Error:Error:line (76)java: cannot find symbol
symbol: class VirtualFile
location: class com.simpleplugin.CreatePropertyQuickFix
/home/saraswat/IdeaProjects/intellij-sdk-docs/code_samples/simple_language_plugin/src/com/simpleplugin/SimpleRefactoringSupportProvider.java
Error:Error:line (3)java: package com.intellij.lang.refactoring does not exist
Error:Error:line (4)java: package com.intellij.psi does not exist
Error:Error:line (7)java: cannot find symbol
symbol: class RefactoringSupportProvider
Error:Error:line (9)java: cannot find symbol
symbol: class PsiElement
location: class com.simpleplugin.SimpleRefactoringSupportProvider

0
2 comments

Apparently the plugin can't be compiled independently. The entire sdk project must be opened which takes a very long time.

0

It looks like the IntelliJ Platform SDK wasn't setup correctly for the module.

0

Please sign in to leave a comment.