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
New approach for lime package management #281
Conversation
) | ||
|
||
type ( | ||
Package interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me what the intent behind the interface and its methods are, please add a brief comment in the code on what each function is meant to accomplish
It's more clear now with using the new approach for loading plugins. |
// a keymap will be the file data | ||
Get() interface{} | ||
// Returns the path that the package exists | ||
Path() string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing references this method. Is it really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure really i thought it might be needed on reloading or something else.
Btw, I don't mean to be difficult, just for the I'm asking the questions because I don't know the answers myself, and I'm hoping that you or someone else watching this project might get some ideas from them. So please see my questions as trying to guide the thinking around the api and what it should accomplish rather than as a stick to punish you with :) |
Also, if you'd like more time to work on this, feel free to close the pull request and open up a new one when you are ready for a review. |
(btw2: please raise questions like this for existing code where it doesn't make sense as you stumble upon it, I'm sure there are many "wtf?!" code bits in there) |
Another point to consider is that ST3 can store packages in a zip file named "*.sublime-package", so the .py, .sublime-settings etc would all be contained inside of that zip file. |
When i started reading limetext code about 2 months ago i was thrilled by the design of |
…face name to Watched
Except reading Packages from zip files, I think we're done here. Reloading and scanning plugins, settings, commands and etc are enabled even the |
Looks like a '/' is misplaced? Are you running the tests via |
I was using |
|
||
// Initializes a new plugin whith loading all of the | ||
// settings, keymaps and python files inside the path | ||
func NewPlugin(path string, suffix string) *Plugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who makes use of this function? What does the "suffix" parameter do? Please add comment in code
Again, I hope my questions and comments aren't too demotivating. Many them are rhetorical in nature and not to imply that what you've written isn't good. My hope is to awake discussion, insight and a well defined api with clear documentation (and again, same goes for existing code already written, please question it where it doesn't make sense and add documentation where needed). But let me be clear: I do not require you to make all changes suggested here before merging. We can merge now, open up a separate issue number to deal with remaining items and you can work on something else if this is becoming tedious :) IMO it's better to move forward and make incremental improvements than to have everything be perfect on first try. Some of these things we've discussed here isn't 100% important for a 0.1 release for example, but they are good to start discuss so that we have a better idea of the problems involved and the possible solutions once we reach 1.0. |
Not at all,I really like to help this project move forward and my motivations are the same as mentioned in limetext readme
Also I am learning here that how should i think on designing a program and what questions should i ask myself before creating different components. I will fix some parts that might cause errors for merging and will create separate issues for other problems. |
No need to apologize, your help is very much appreciated and like I said, we don't need to be perfect on first try and certainly not for 0.1. This stuff is good to discuss and think about so that once we reach 1.0 we are happy with how all parts fit together. By exchanging ideas and discussing different needs we'll get a better plan for all the different parts, even if we don't end up solving all of them or will need to throw out code and re-write if we find out that the current design is insufficient or has problems that we didn't think of back then. Same goes for all existing code. If it doesn't make sense, is too complex, could be moved to another package, etc it should be discussed so that we can either figure out why it looks like it does (and add in comments about it in the code and/or wiki) or come up with an improved solution. In that spirit, please don't see this as taking up my time or any one else's. Discussing the details and trying to figure things out are very much part of the process and are absolutely necessary in arriving at a satisfying solution. Personally I'd be more worried if there wasn't any discussion as that would mean we aren't thinking enough about the code or that we are too similar and aren't able to think of potential problems that perhaps others could :) |
Thanks for opening up separate issue numbers for the various things we've discussed here. Are you still working on any bits here or looking for feedback? If not, lets merge and we can deal with the remaining bits in these other issue numbers. |
I'm working on some easy fix problems that will be finished by tomorrow after that we can merge this. |
… variable and pckts type unexported, we don't keep packet data anymore reloading plugin is better now check #281 for more details
I think we're done here. This could be merged |
New approach for lime package management
Cheers, let's continue discussion in one of the newly filed issues or open up a new one if one is missing. |
This is a suggestion for lime package managing.
For now we have these package types:
Each of them will be a type implementing
Package interface
, The init function will be responsible for scanning paths, finding packages and keeping the hierarchical priorityFor each Package type the
Get()
method will be responsible for returning useful data that we will need for adding that package for example for a Plugin it might be returning python files or for a Setting returning the the data in the settings file, The important point is we won't load the package we just will prepare it for loading the package it would be something like this:Settings
Or Plugins
If this approach is fine i will continue committing to this branch until it's done.