Skip to content

Conversation

@Harding-Stardust
Copy link

Added code to make it work in Cursor

Copy link
Collaborator

@mrexodia mrexodia left a comment

Choose a reason for hiding this comment

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

This cannot be merged as-is.

wanted_hotkey = "Ctrl-Shift-I"

def init(self):
settings_version, ida_version = get_python_versions()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do not remove this

Copy link
Author

Choose a reason for hiding this comment

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

OK, I will put it back but I don't follow when the code is useful. Why can't the plugin use the Python that IDA has access to?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The Python version IDA uses might not match whatever is in the settings, so this needs to be detected.

DEBUG_PORT = 7066
ALLOW_UNSAFE_ORIGIN = False
LOGGING = True
SCRIPT_DIR = r"E:\backup\tools\Debug\IDA_scripts"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is hardcoded to your environment, remove any logic related to this

Copy link
Author

Choose a reason for hiding this comment

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

ops! My bad, I will fix this


if message["event"] == "set_workspace":
path = message["path"]
path = message.get("path", settings.SCRIPT_DIR)
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no meaningful default, why is this code here?

Copy link
Author

Choose a reason for hiding this comment

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

Cursor never sends any path (at least not for me) I fallback to the settings.py. If settings.py is not set (it should be set when the plugin is installed) then we fail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps the extension code needs to be updated, or fixed on Cursor's side then? Hardcoding the script path isn't an acceptable solution.

Copy link
Author

Choose a reason for hiding this comment

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

Well it went from "always crashing" to "at least work if the user sets the setting".
I found the plugin from https://youtu.be/RtkHMWBz3R0?t=391 where at 6:34 the streamer also had problems with the plugin so I did a small fix for this crash.

@Harding-Stardust
Copy link
Author

I have made the changes you requsted.

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