-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improve static analysis compatibility #44
Comments
Related to julia-vscode/julia-vscode#2548 from @MariusDrulea. cc @Shuenhoy @pfitzseb @davidanthoff in case of interest |
Tricking language server could be possible. I used to do that in https://github.com/Shuenhoy/ThinModules.jl, which takes an even smaller step that still keeps the standard The problem here is there are bigger gaps between the semantics of But if it could be proved that the wrong situations are rare or easily avoided, this would be a very practical and cheap way. |
I think since this package was made as a proposal for issue 4600, we should expect these things to be supported by the Julia compiler in some way instead of special case in LanguageServer (otherwise, other package defines a macro named I'm not a fan of changing the syntax as this is more of a technical problem rather than the issue of the syntax design.
IMO, this just seems wrong for a language server... one cannot guarantee the correctness of linting a macro, as the syntax is customed. The only way is. to specialize the corresponding linting for a specific macro. |
Very fair points! If language server can be fixed soon that would be great. But it is definitely a significant change vs simply allowing “include” in the syntax. Since (1) I just want hover help to work, and (2) the technical issue seems like it has an undefined timeline, I think modifying the syntax to allow |
As a temporary solution to this problem, I have forked the StaticLint package here: https://github.com/MariusDrulea/StaticLint.jl. This fork has support for the |
I am strongly in favor of keeping the syntax of FromFile as it is. The problems are elsewhere and we shall focus on these problems by:
As a short-term solution I think it's best to maintain the StaticLint fork mentioned in the above comment. |
@MariusDrulea i did the steps you described to replace StaticLint but the LanguageServer stopped working altogether. Luckily, i figure out how to make it work with the following steps:
|
Right now when you use
@from "..."
, IDEs are not smart enough to expand the macro and locate the definition of a symbol. This means that useful features like hover help will not work when developing locally withFromFile.jl
. I think this really hurts the rate of adoption.I see two ways of fixing this:
include
.include
. For example:it is one more symbol, but would successfully trick the language server to pick up the definition of symbols. (You can even trick the language server with
macro ignore(args...) end; @ignore include("types.jl")
, which is useful for enabling hover help in test files).For 2, since this is slightly different syntax, I would also encourage you to use a different macro name instead, like
@import include("types.jl"): ...
, which is closer to existing Julia style (and would help win support from any core devs with allergic reactions to Python).The text was updated successfully, but these errors were encountered: