jetbrains-plugin-sample icon indicating copy to clipboard operation
jetbrains-plugin-sample copied to clipboard

Adding new custom keywords leads to errors

Open robinvandernoord opened this issue 3 years ago • 1 comments

Hello,

Today I have been trying to use this plugin to create a new language for a JetBrains product. I however can't extend the plugin with new keywords.

I keep getting errors such as:

image image

While the ANTLR preview works just fine: image

I have tried to add a block keywords (e.g. 'class') that works very similar to a func definition:

script
	:	vardef* define_class* function* statement* EOF
	;

define_class
    : 'class' ID block
    ;

// ...

CLASS : 'class' ;

And I have tried to copy the print() definition to log(), which also leads to errors in the IDE (but not in the preview):

image image

	|	'print' '(' expr? ')'								# Print
	|	'log' '(' expr? ')'								 # Log

// ...

PRINT : 'print' ;
LOG : 'log' ;

When replacing print with log, it does work:

image


I have tried editing and copying Java files/classes and cases/rules to match my new keywords, but this did not help at all. What am I missing/supposed to be doing in order to create new keywords?

robinvandernoord avatar Jan 03 '22 18:01 robinvandernoord

Hi! Thanks for posting here. Unfortunately I haven't looked at plug-in stuff in six or seven years, but maybe @bjansen has some ideas.

parrt avatar Jan 03 '22 18:01 parrt