-
Notifications
You must be signed in to change notification settings - Fork 1
Incorrectly prepends module name for opened modules #8
Comments
I'm a committer now so you don't need to CC me ;) This is basically the reverse of #7. I've noticed it; sometimes we "use complete everything" incorrectly. I wonder if it's when completion is on a function inside a module. I wish sublime had better documentation for this :) |
by the way, I just updated ocp-index and woohoo completion for all packages! it's awesome. |
I think to fix this issue we just need to strip the module prefix for all modules opened in the current file. (Somehow) |
So you never used the option I added before ocp-index was fixed? ;) We may be able to just strip the module prefix depending on the number of underscores in the match, or the presence of a dot in the search string... it sounds horrific. I haven't really come up with good examples of "works" and "doesn't work", which would be a good place to start. |
Note that the latest ocp-index stores both the short and full path, which is exactly what you would need here ; the command-line options are somewhat limited there at the moment though, but We have a new Regretably, at the moment the functionality is present but it seems the only way to access it is through the I'm very glad you find ocp-index useful. Hope the above makes sense and will eventually solve your integration issues ? On an unrelated matter, I can't live anymore without the locate-uses function I plugged in emacs, which simply opens a grep buffer with the results of |
Ooh locate-uses uses sounds interesting. Easy to display in sublime, too. I'm not sure how it fits into an "autocomplete" plugin though ;) After that, I'd only miss one other feature of IDEs: open the definition of the function at the cursor. |
@TheSpyder Try Shift+Ctrl+R in Sublime 3. There's probably some shorter way to invoke it, too. @AltGr Custom formats sound marvelous! I don't quite have time to work on sublime-ocp-index right now, but I'll keep it in mind. Perhaps you could get the CLI options in ocp-index meanwhile? |
Just done it, as it was basically just plugging some missing wires. It's on trunk :)
|
Format for the "qualified ident" ( |
@whitequark that seems to be just listing all the symbols in a project. I want to put my cursor on a function name, hit shift+enter (In the same context we now have alt+a for type inspection), and see that function. For bonus points, be able to do it on standard library functions (unlikely, but you never know). Although I've just discovered cmd+alt+down (probably ctrl+alt+down for you) which runs it on the symbol under the cursor. This comes close, but is still just plain text searching.
So, when are we renaming this to the "Sublime OCP IDE" plugin? I no longer think I need to spend hours figuring out how to maintain a background process like vim/emacs :) I should have some time to work on these things over the weekend... maybe. |
@TheSpyder any chance you could have some time this weekend? This bug is a bit annoying :) |
Yeah, I should be able to make time. Easter is a long weekend in Australia :) On Fri, Apr 18, 2014 at 10:01 PM, Peter Zotov [email protected]
|
@AltGr I'm playing with Sublime has an "open file" command flag that knows how to parse the file:row:col format, so it all works brilliantly. @whitequark any preference for what keyboard shortcut to use for I haven't had a chance to look at qualified indent yet. |
@TheSpyder How about overriding Sublime's default and falling back to it for non-OCaml projects? Or then |
That's exactly what I'm working on ;) It was a bit tricky because goto_definition is a window command, and there isn't a way to say "abandon default command execution", but I've got something that works (although ocp-index only seems to return results in my test code, not my source code, but that's a separate issue). I'll make a branch and push up what I have so far. |
@TheSpyder ocp-index returns the file positions it can find in ocaml object files... I am a bit surprised that menhir would'nt add Otherwise, that's great to hear ! ocp-index heuristic for finding the project root is a bit tricky but intended to 'just work', so don't hesitate to report cases where it doesn't. |
It looks like menhir does that when I run it myself, but not when run via ocamlbuild which specifies ocamlc manually. I wonder if that's a bug in menhir or ocamlbuild :) I'll log an issue on the ocp-index repo when I narrow down more detail about where locate works and where it doesn't. |
|
ah, of course... I used that a lot writing the type inspection. How could I forget! It's happening because my last build failed and there was no |
OK, so now that my project is in a good state, it's the use of And hey, it looks like a recent change to ocp-index negated the need for the |
@AltGr your "locate uses" command using In the meantime, can you add a way to tell it that my ocamlbuild output folder is not _build? I get duplicate results from my build folder that magically vanish when I rename the folder to _build ;) Getting back onto the point of this issue, completion, I can't seem to pass a format string to the |
Ah, you mean in ocp-grep ? Indeed I should add a The latest features in ocp-index haven't been released yet, i'll do that as soon as I get time ! |
Fair enough. No rush, just checking :) |
So you're just going with breaking #7 again? I guess that's a less common and this will do until ocp-index is updated :) |
@TheSpyder Hmm, odd. Does that mean I also accidentally fixed #7? |
I haven't been keeping up with the changes you've made in the last couple of days :) Right now I'm just getting ocp-index errors because the current release doesn't have a |
@TheSpyder Oh, it appears that while I've been solving my problems with compiling on trunk, I've also sidestepped the unreleased |
sublime-ocp-index shouldn't prepend module name by itself if the user didn't enter it.
Steps to reproduce:
read_flo<Enter>
Pervasives.read_float
Expected behavior: substitution to
read_float
/cc @TheSpyder
The text was updated successfully, but these errors were encountered: