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

Could not resolve symbol definitions when using full context. #154

Open
gdelfino opened this issue Feb 27, 2020 · 1 comment
Open

Could not resolve symbol definitions when using full context. #154

gdelfino opened this issue Feb 27, 2020 · 1 comment
Assignees

Comments

@gdelfino
Copy link

Describe the bug
When the full context is used to refer to a symbol, the unresolved symbol inspection fails.

To Reproduce
A minimal example is show in the screenshot below.

Expected behaviour
Fully scoped symbols should be recognized. If this is not viable I would expect them to be ignored by this inspection.

Screenshots
IntelliJ-FullContextIssue

Please also provide:

  • OS: Windows 10
  • IntelliJ IDEA 2019.3.3
  • Wolfram Plugin Version 2019.3
@halirutan
Copy link
Owner

halirutan commented Mar 2, 2020

You are right, this is not handled well, but the warning has a reason: It tells you that refactoring such as renaming will most likely not do the correct thing. You can turn the whole inspection off if you like, which was the default behavior of the last major version.

It all boils down to the same reason I described in your last issue: I cannot make it correct without being able to evaluate code on the fly which will, for various reason, never be possible.

Just imagine you used MyPack`Private`one inside MyOtherPackage in my last example

BeginPackage["MyPack`"];
Begin["`Private`"];

one = 1;
includeMyFile["src/MyOtherPackage.wl"];

End[];
EndPackage[];

To know that it is the same symbol as the one above, I needed to be able to know what includeMyFile is doing and this is impossible without a real evaluator. This is only one trivial example of things I've seen in the wild.

However, I planned to work on improving the situation especially for the new/alternative way of writing packages. When you read carefully through the post and the references (especially, the answer from Leonid), you'll find that it improves the readability of code. I'd like to leave this issue open because your issue will work correctly after improving some of the algorithms.

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

No branches or pull requests

2 participants