Open benschwarz opened 11 years ago
+1
Unless it's on a line that doesn't start with \s*<script
or is after </script>\s*
- then it should just be the text. etc, yada yada, dot dot dot
Unfortunately i am not sure sublime text is up to it at least as a snippet.
I think, it should be a completion. http://docs.sublimetext.info/en/latest/extensibility/completions.html
Ah that is new :) Carry on.
On Wed, Apr 3, 2013 at 10:07 AM, Ben Schwarz notifications@github.comwrote:
I think, it should be a completion. http://docs.sublimetext.info/en/latest/extensibility/completions.html
— Reply to this email directly or view it on GitHubhttps://github.com/benschwarz/sublime-bower/issues/13#issuecomment-15808495 .
That whole doc page is new! When i was a lad we had to dump python objects in the console then walk backwards up a hill.
On Wed, Apr 3, 2013 at 10:07 AM, Jared Wyles jared.wyles@gmail.com wrote:
Ah that is new :) Carry on.
On Wed, Apr 3, 2013 at 10:07 AM, Ben Schwarz notifications@github.comwrote:
I think, it should be a completion. http://docs.sublimetext.info/en/latest/extensibility/completions.html
— Reply to this email directly or view it on GitHubhttps://github.com/benschwarz/sublime-bower/issues/13#issuecomment-15808495 .
hot. want it. :lips:
The above commits add two classes, PackageDefinition
and BowerRC
.
The idea being that PackageDefinition().read('normalize-css')
will return a python object that is the contents of components/normalize.css/component.json
.
We need to read .bowerrc
to ensure that the user hasn't set another directory for the components to be stored in. If there isn't one, we default back to using the assumed path.
This code is untested, but reads okay after quickly bashing it out. It shouldn't be too hard to complete from here.
...Do want...
I am assuming that the path will be based on the directory of the .bowerrc
as well, so that it'll toss out <script src="my/weird/path/jquery/jquery.js"></script>
if my directory is set to "my/weird/path"?
@Melindrea, yeah—thats the implementation that I'm going with.
auto_complete_triggers
I don't understand your last comment @jaredwy? Will what respect??
Where do you want to go with this PR? The binding stuff is seemingly hella difficult to get right.
We could add a Default.sublime-keymap
file to the plugin, then specify a key combo:
<binding key="ctrl+alt+b" command="insert-bower-package"/>
… from there we could show a quick panel to list our packages:
Open for suggestions here.
It was in reference to bower not seeming to respect the directory attribute in my ~/.bowerrc but you said it does for you so i must have done something wrong.
I am thinking unless someone with some sublime knowledge can let us know how to go getting the autocomplete working with out modifying the user settings for a file with scope html then a command might have to be the way forward. I am pretty sure you can show the same auto complete window from a command.
If you installed bower a long time ago (before 0.3.0 - See https://github.com/twitter/bower/issues/102), .bowerc
was either broken or not implemented.
Okay, perhaps we should make a post on the sublime plugin forums, because the IRC room is quiet at the best of times.
@sublimeText, do you have any pointers?
This would be really nice +1
I might take another stab at this, the apis were just not there in sublime text 2. Would people be interested if it was sublime text 3+?
On Sat, Nov 30, 2013 at 9:29 PM, Charley Peng notifications@github.comwrote:
This would be really nice +1
— Reply to this email directly or view it on GitHubhttps://github.com/benschwarz/sublime-bower/pull/13#issuecomment-29549886 .
I dunno… I still use ST2, but thats mostly because a lot of plugins didn't bother to do all the work to run under 3. … Why don't you check it out?
I will chat to you about it. But you remember my pain ;)
On Sun, Dec 1, 2013 at 9:41 AM, Ben Schwarz notifications@github.comwrote:
I dunno… I still use ST2, but thats mostly because a lot of plugins didn't bother to do all the work to run under 3. … Why don't you check it out?
— Reply to this email directly or view it on GitHubhttps://github.com/benschwarz/sublime-bower/pull/13#issuecomment-29562743 .
Consider the following interface:
Should autocomplete / list the available packages that you have installed in a contextual menu (not sure if possible? - need to research). Pressing
<enter>
should complete the string intobower:packageName
Should insert the paths(s) of the main files outlined in the packages'
component.json
file. If you're currently focused on a HTML file, it should:<script src="components/jquery/jquery.js"></script>
for scripts<link rel="stylesheet" href="comonents/normalize-css/normalize.css">
for stylesheetsIf you're currently focused on any other kind of file, paste the raw path.
If anyone wants to start implementing this, that'd be gnarly. Otherwise, I'll roll my sleeves up and sort it out when I get the chance.