-
Notifications
You must be signed in to change notification settings - Fork 16
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
Outline support #1
Comments
(Sorry for the short issue description; I just really wanted to be the one to post issue #1. I'll flesh it out some more soon. ;) ) |
The extension published by Gimly has multiple language features driven by inaccurate symbol data. They are contributed by shims/polyfills of common language providers. List:
Tbh this is also a chance to make the impl accurate |
FWIW the reason the competing impl is inaccurate is a lack of accurate symbol resolution for OOP - especially
|
Thank you for raising this suggestion! This is a feature we want to add, and is already being developed (http://mathworks/MATLAB-language-server#1)! |
Outline support should now be present, and will be released as an update to the extension soon. As noted in #8 , the outline currently does not display section titles. If there are any other features which you feel are missing in the outline, please feel free to open another issue. Thanks! |
Yay! I'll testi it out over the weekend if it makes it to the VS Code Marketplace by then. |
Hooray for this release!
Could we get Outline support in a future release? That's one of the feature I use the most with VS Code plugins for nontrivial code, and it doesn't seem to be supported here yet.
Requirements, Hopes, and Dreams
Semantic-level tree, instead of pure syntax: Matlab classdef syntax breaks the class definition in to separate
properties
,methods
,events
etc syntactic sections. And attributes like Access controls, Static, Hidden, and Constant are set per properties/methods/etc block, not on the individual properties etc. This means that, for me at least, nontrivial classdefs often get broken up in to many separate properties and methods blocks. If the outline tree has a level for properties/methods/etc., I'd like to see all the blocks of a given type (like, all theproperties
blocks, regardless of their attributes), combined in to a single node in the outline tree. Would make it easier to find things, see a combined list of all the things of a particular type, and save a lot of clicking to expand or collapse multiple tree nodes for a syntactic element.I can say this from experience. Gimly's unofficial Matlab extension has Outline support, but as far as I can tell it always shows each distinct properties/methods/etc block as a distinct node in the tree. I find that makes it hard to navigate or view a classdef using the outline, at least with my coding style.
I did a little Matlab classdef outline view thing for MCodeNavigator a while back that works this way, combining all the methods or properties of a class under a single "Methods" or "Properties" node in the outline tree, regardless of whether they were lexcally inside the same
methods
orproperties
block. You can have a look at that if you'd like a concrete example of what I mean here.(Those "/private" with a slash notations mean they're (GetAccess=public, SetAccess=private); mixed-mode access is shown as "getaccess/setaccess", and since public is the default value and pretty common, it is elided to avoid cluttering up the view.)
It would also be nice to have an option to elide the properties/methods/events level of tree nodes and show all the methods and properties directly under the class. But I'm guessing that shouldn't be the default.
Showing nested functions as sub-nodes under regular methods or functions would be a nice touch. Some of the code bases I work with make extensive use of nested functions, with lots of them inside a single large function, or even I think multi-level nesting.
Details and Considerations
I understand that Outline support is a significant feature and would take some work. But it would be really useful IMHO; personally, I would prioritize it.
My understanding is that there's two main ways to do outline support: in-extension grammar support, or using an external Language Server with LSP. And the LSP could be done as a standalone program, or using Matlab itself (and thus requiring a license) like some of the other features currently in this extension do. I could see advantages to all approaches:
I see the blog post announcing this VS Code extension says you're already using Matlab as an LSP, so maybe it wouldn't be a huge stretch to do Outline support that way.
Language Versioning
Matlab syntax has changed substantially over the years with new Matlab releases. First classdef, and later string literals, class property validators,
arguments
blocks and their subfeatures, etc. Many Matlab developers target older releases or multiple releases. Would be nice to be able to select the right historical version of the syntax for the program you're using. I guess this applies to other features of this extension, too.Using Matlab itself as an LSP for outlining might make this versioning easier, because selecting the right language version would basically be implicit in pointing the extension at your Matlab installation in its settings, like (I think) you already have to do?
References
The text was updated successfully, but these errors were encountered: