Skip to content
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

[IDEA 201.x] Remove macro registration hack #499

Merged
merged 1 commit into from
Feb 27, 2020
Merged

[IDEA 201.x] Remove macro registration hack #499

merged 1 commit into from
Feb 27, 2020

Conversation

tpasternak
Copy link
Contributor

In old versions of IntelliJ platform it was only possible to register
macros of custom names. The only way to provide custom macro was to
override one of the existing macros. We've been overriding
FileRelativePath macro.

Unfortunately, since version 201.x of IntelliJ platform the hack does
not work, because the data structure to keep the macros has been
changed from a HashMap to a List. This means, the entries are not
overriden, but appended to the end of the list. MacroManager looks up
only for the first ocurrence of the name, so the one in the end of the
list will never be found if the name is not unique. The change was
done in this commit JetBrains/intellij-community@6183806

Luckily, the hack is not needed since
JetBrains/intellij-community@fdf6dbc.
This means, we can use any custom name for the macro

In old versions of IntelliJ platform it was only possible to register
macros of custom names. The only way to provide custom macro was to
override one of the existing macros. We've been overriding
`FileRelativePath` macro.

Unfortunately, since version 201.x of IntelliJ platform the hack does
not work, because the data structure to keep the macros has been
changed from a HashMap to a List. This means, the entries are not
overriden, but appended to the end of the list. MacroManager looks up
only for the first ocurrence of the name, so the one in the end of the
list will never be found if the name is not unique. The change was
done in this commit JetBrains/intellij-community@6183806

Luckily, the hack is not needed since
JetBrains/intellij-community@fdf6dbc.
This means, we can use any custom name for the macro
Copy link
Collaborator

@wisechengyi wisechengyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @tpasternak !

@wisechengyi
Copy link
Collaborator

Weird that travis link didn't show up here.

https://travis-ci.com/pantsbuild/intellij-pants-plugin/builds/150842760

@wisechengyi wisechengyi merged commit 07f0d6a into pantsbuild:master Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants