-
Notifications
You must be signed in to change notification settings - Fork 22
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
[Feature Request] Resolution of namespaces #38
Comments
Cell structures are static while namespace and scoping functions are not. |
Since the traditional dynamic namespace is difficult to resolve, would it be easier to resolve the static new style package derivatives? Does |
The new-style package is somehow not officially documented and CodeParser recognizes it but doesn't support the full features. I doubt I can run the following code directly from Wolfram Kernel: Package["MyPackage`"]
PackageImport["CodeParser`"]
mySym := 1 Can you try it out? Thanks. I wish there will be more examples/resources of this package usage, if you'd like to provide them. Thanks |
This feature has been added since 10.x or so, and seems to be still in common use even though remaining undocumented.
As mentioned above and explained in Leonid's answer, I see new-style packaging as a modernist attempt, but is not complete for designing nested packages and contexts. I won't fully switch to this practice, but I do think since the primitives are static, they can be easier to handle for the language server. |
Thanks for the information. I just tested the new-style and it seems working correctly (on Linux. No luck on my Windows' SimplifiedChinese version). Still gonna experiment with it for a while. I am starting to think about how we can leverage the namespace info now. Gonna leave this issue open for longer time. |
The current implementation supports document structure based on MMA cell structures (like
(* ::Title:: *)
). To my knowledge the official version is a pure front-end feature, and it is of much convenience to have it handled for code editors.However, the kernel features - namespaces (contexts and packages) and scoping constructs like
Module
Block
- are not resolved. Therefore, developers will have to go through the scripts manually to tell which context a symbol is in.As most authors use namespaces concurrently along with cell structures, the current features are actually sufficient, and this issue may not be a necessity; if this is the case, this thread could be used to discuss the best practice for concurrent use of namespaces and cell structures.
The text was updated successfully, but these errors were encountered: