-
Notifications
You must be signed in to change notification settings - Fork 134
#403 introduced fallbackStubElementType
#426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <html> | ||
| <body> | ||
| <p>Allows specifying a fallback class to use for an elementType in the constructor of stub elements.</p> | ||
|
|
||
| <p>Usually the parser generator looks into the parent class file to detect which class to use. | ||
| But in some cases a parent class file may not be available (not yet compiled). | ||
| In this case, it uses `IStubElementType` by default, which may not be the case in the modern code when `IElementType` should be used. | ||
| </p> | ||
|
|
||
| <p>This is per parser option. It does not allow overriding the default per rule.</p> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright 2011-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
| * Copyright 2011-2025 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
| */ | ||
|
|
||
| package org.intellij.grammar; | ||
|
|
@@ -52,6 +52,8 @@ public class KnownAttribute<T> { | |
| public static final KnownAttribute<String> EXTENDS = create(false, String.class, "extends", BnfConstants.AST_WRAPPER_PSI_ELEMENT_CLASS); | ||
| public static final KnownAttribute<ListValue> IMPLEMENTS = create(false, ListValue.class, "implements", ListValue.singleValue( null, BnfConstants.PSI_ELEMENT_CLASS)); | ||
| public static final KnownAttribute<String> ELEMENT_TYPE = create(false, String.class, "elementType", null); | ||
| public static final KnownAttribute<String> FALLBACK_STUB_ELEMENT_TYPE = | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you mind keeping the formatting in the file? :)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't want to shift all the fields, and this does not fit |
||
| create(false, String.class, "fallbackStubElementType", BnfConstants.ISTUBELEMENTTYPE_CLASS); | ||
| public static final KnownAttribute<String> ELEMENT_TYPE_CLASS = create(false, String.class, "elementTypeClass", BnfConstants.IELEMENTTYPE_CLASS); | ||
| public static final KnownAttribute<String> ELEMENT_TYPE_FACTORY = create(false, String.class, "elementTypeFactory", null); | ||
| public static final KnownAttribute<Object> PIN = create(false, Object.class, "pin", -1); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let it be "the parent class"