Registered Member
|
Hi,
currently, I am using Kate and KDevelop (besides Kile) for writing code and scripts and I just found the "snippet plugin". This plugin seems to have some nice features I want to use, but the auto-completion does not work in this special case. Imagine the following situation: I create a new snippet which I name "test_example" and which inserts "test example;". Now, when typing "test_ex" there should pop up an auto-completion window that suggests "test_example" and after hitting return "test example;" should be inserted, but neither the suggested "test_example" appears nor the code snippet "test example" is going to be inserted after hitting the return/enter key. Also CTRL + Space doesn't work. Auto-completion of regular C++ commands (in KDevelop) works. Also the auto-completion of words or phrases I've written before (i.e. names/identifiers of variables) works. Has anybody got an idea how to solve this issue? KDevelop 4.5.0 (using KDE Development Platform 4.10.3) Kate 3.10.3 (using KDE Development Platform 4.10.3) I also have trouble with the feature "enter = auto-completing" and that this isn't changeable*. I asked this some years ago, but haven't got an answer (link to thread). I also don't like it that pressing arrow keys* (at least up and down) is for selecting one of the suggested auto-completed words. As a result, I'm hitting ESC much more frequently than I'm using the auto-completion . But ... hm, I should open a new thread for this issue, but hmm ... well, I don't think that I'm gonna get a solution this time. It seems that this decision was made for all KDE programs and in my honest opinion it was a very bad decision . (* = I'd prefer shift or ctrl + return/enter and shift or ctrl + arrow key instead.) Regards guy.brush |
Global Moderator
|
Hi,
I'm just a casual user of the Snippets plugin myself, so I don't know too much about it
Did you enter test_example in the "Match" field? The "Name" one doesn't matter for when the snippet is displayed, it's just a name.
Maybe in that case you should just disable automatic invocation of the completion widget, and open it with Ctrl+Space (or whatever shortcut you want to configure for it) if you need it. To me that sounds like an appropriate solution for your issue. The completion widget is a KTextEditor thing, which doesn't support different hotkeys, and KTextEditor is what kate, kwrite, KDevelop, kile etc. use. This is why it's common to all applications. Greetings, Sven
I'm working on the KDevelop IDE.
|
Registered Member
|
Hi there ,
well, I have no field named "Match". I thought this is the same like "Name". My window when creating new snippets doesn't look like this one does. It looks more like this. Actually, I don't know what the "scripts" category means, but I didn't need it yet. It seems that you've got Arch, too, so I guess you have the same window with less options.
Yes, this might be a workaround, but not the best solution, though (since I'd prefer to get always some suggestions since I'm new to C++ programming ). I might play around a bit with the delay time, too. Another "misbehavior" of the auto-completion tool is that it doesn't disappear if I already wrote the complete word. Let's assume that I wrote "namespace", it still suggests me "namespace" (and it's the only thing it suggests me). So if I want to do a line break, I have to hit enter twice (or ESC + enter). And if I want to move the cursor up or down, I have to press ESC first, too. Sadly, Kate doesn't have code completion, so when using Kate (or KWrite) the problem only occurs for words I've already written at least onces (i.e. names of variables). |
Global Moderator
|
Hm, no, mine looks like it should (the first screenshot). Try reinstalling kate, maybe? I'm not sure when that editor got introduced but i feel like it has been there for a while. Maybe you should try to work with it for a while and see if you get used to it. I think it's quite well though-out as it is. There's a delay time for the completion widget? I don't think so. Yes, this is indeed a bug probably. However I find myself never hitting it, since why would I write the word if I can just hit enter to accept the completion entry? Yes, kate only does text-based completion. The widget is the same though, KDevelop just adds aditional entries to it. Greetings, Sven
I'm working on the KDevelop IDE.
|
Registered Member
|
Hi there ,
the "Code Snippets Support" plugin is version 0.1 in KDevelop. I think it's the same in Kate, but I cannot see it's version number in Kate. Currently, I am giving the auto-code-completion a 2nd try, but I am not too optimistic. I am using Kile for writing stuff in LaTeX for quite some time now and I had to deactivate the auto-completion because it was too annoying (mainly when doing manual line breaks to keep the code within 80 characters). A common situation was when I was typing "und" (German for "and") which was wrongly completed to "underbrace". But I've got some good news: I've got the auto-completion for snippets working! When setting up my test snippet repository, I typed some arbitrary characters into the "namespace" field. After deleting them, the auto-completion works. Now, there's just one more question: Why I don't have the current and up-to-date plugin. I'm gonna reinstall Kate, but I don't think that this is gonna help me with this issue.
Oh yeah, I'm sorry. I think I mixed it up with the background parser delay, I think.
In some cases I'm faster if I type the word myself before looking for it's correct entry in the auto-completion box. I also had this bug when I was fixing some names of variables (a typo + copy and paste ... hehehe ). After fixing the 2nd one, I couldn't move the curser down because the window was still opened. I had to press ESC or enter each time. Oh and if some commands are new to me, I prefer to type them several times before doing the lazy auto-completion way. I hope to remember them better when doing so . Edit: I just noticed another situation where it is a bit annoying: When writing the singular of a word, you cannot hit enter without auto-completing it to the plural or without hitting ESC before (if we assume that the plural of that word has been written before somewhere in the code).
I thought so. But it would be nice to have the auto-code-completion also available in Kate, KWrite, ... (for every known and popular language, of course, hehe ). Kate and KDevelop could share the same plugin/widget and KDevelop would still have more features than Kate. |
Global Moderator
|
Ah I see the problem, kate and KDevelop have two different dialogs. Well. I see the problem, but it's sort of unrelated, isn't it? This specific issue isn't going to be a problem for writing C++ code. Rename the declaration, press Alt+1, see the rest getting magically renamed I'm still wondering if we're talking about C++ or just text. For just text, I totally agree with you, and I just disable completion there too. I don't think completion was designed for that purpose, either. For C++ though, I don't really see a problem... That doesn't work. Code completion relies on KDevelop's language analysis, which in turn requires in the language plugins, background parser etc. I don't quite get why you'd want it though, there are two applications for a reason -- if you want/need semantic stuff, you use KDevelop, otherwise you use kate. Greetings, Sven
I'm working on the KDevelop IDE.
|
Registered Member
|
The windows are the same in both applications. Settings -> Configure KDevelop -> Plugins allows me to see which version of the snippet plugin is used/installed. In Kate, Settings -> Configure Kate -> Plugins allows me only to check or uncheck the desired plugins, but there's no "show information" button or something like this. So I just guess they use the same plugin, but (like it seems) in an outdated version. Oh, and reinstalling of Kate didn't help.
Yes, this special problem isn't C++ related.
Oh, great. But I cannot find "Alt + 1" in the shortcut settings or in any of the menus. What is its description and where do I find its shortcut settings?
I'm sorry, I was talking about both - about code and about text completion. Text completion is nice for long names of variables or if you don't remember the name of a variable or function exactly.
Ah ok . Well, I use the programs in the following ways: Kwrite: simple text files and really small stuff Kate: "the better Notepad++", I use it for stuff like HTML, CSS, JS (still learning all of them) ... code completion would be nice sometimes, but an extra IDE for HTML and CSS is too much for me KDevelop (or other 'large' IDEs): for "real stuff" like writing programs in C++ which I just started to learn some weeks ago So, maybe I can say something like this: KWrite strict subset of Kate strict subset of KDevelop This would be my approach and I'd say that code completion is a feature that I would add to Kate and KDevelop, but not KWrite. For example, I wouldn't add features like debugging tools, unit testing tools or tools helping me to create a cmake file to Kate. I was just trying to explain you why I thought it might be a nice idea, but since you already said that the plugin needs much more features from KDevelop, I can understand the issues why Kate doesn't have the auto-completion of code. Well, after all, I've got the code snippet plugin to work, but I still ask myself why I don't have the newest plugin installed. |
Global Moderator
|
Hi,
It's not. KDevelop just uses a different dialog for editing snippets than kate does. Check in kate -- you'll have "my" dialog there too. It's the shortcut to select the first option from the rename assistant, which will appear when you rename a variable. I don't understand. That's exactly what code completion does... just better than the text completion. You can have this opinion, but that's not really how the application(s) are designed There is a few plugins for kate which incorporate external tools to do semantic stuff, but extensive code analysis like KDevelop does is not in the scope of what kate wants to do. Cheers, Sven
I'm working on the KDevelop IDE.
|
Registered Member
|
Hi ,
hm, Kate and KDevelop have the same snippet editing dialog/window here. I've activated a plugin named "Snippets tool view" in Kate. So there is no visual difference here. Both plugins use the same code snippets repositories on my computer. The Alt + 1 feature is great. I've just found (but not used, yet) the "rename declaration" thing.
Oh, well, then I misunderstood something. I thought code completion means only to complete predefined commands, i.e. "namespace", "std::sin" and so on and I thought code completion doesn't implicate the completion of user defined variables and functions.
Hehe, yeah, there are different opinions and approaches and my ones are just from a noob whose opinions base on his experiences and how he uses the programs . When I'm gonna write more stuff in HTML, CSS and JS, I have to rethink about using Kate or an IDE for website programmig/scripting. But this isn't the topic of this thread anymore . |
Global Moderator
|
About the snippets dialog, I'm confused now, probably someone who knows more about the snippets needs to comment on this.
That's a matter of definitions of course, but I call that "code completion" too, yeah. There's pretty good PHP and Python language support in KDevelop, and there's also unfinished CSS and HTML language plugins... as well as JavaScript. Hopefully those will get finished in the future. Greetings
I'm working on the KDevelop IDE.
|
Registered Member
|
Hi ,
what are the verion numbers of KDevelop, Kate and both plugins of your installations? Do you have any additional repositories activated (i.e. testing)?
That would be nice and if I can trust your signature you're working on the Python stuff . I hope there's gonna be a Haskell support/plugin one day, too, since I think this is the next language I'm gonna have a look into after knowing the basic stuff of C++ . |
Global Moderator
|
Hm, I think the snippets plugins don't have any meaningful version numbers... I guess it has displayed "0.1" for like always, heh
I'm using kate 3.10.3 and kdevelop master. Anyways, your original problem is resolved, isn't it? Haskell support will get implemented iff someone wants to work on it (you?). Cheers, Sven
I'm working on the KDevelop IDE.
|
Registered Member
|
I don't know what "master" actually means, but I think I don't have it since there's just a "KDevelop 4.5" without any "master" in the information window.
And yes, my original problem is solved. I tend to expand my questions when some new and related questions appear, I'm sorry . But it's not that important - the plugin works and that's what I need .
Oh, if I could, I would do so, but I am at the very beginning and I think it needs very, very much time until I know enough to help. So, one day, when politicians are always tellung the truth and mankind doesn't destroy the earth anymore, I might have enough programming skills to do this, hehe . Ok, then thank you very much for your help. If there are any other questions, I'm gonna start a new thread for them . |
Global Moderator
|
Alright, cool. I don't know about the widgets, if you really want to find about it you can ask #kate in IRC or so.
"master" is what the current state of development is called. Additionally to the master branch, there's several "stable" branches (such as 4.4, 4.5, ...) which only get bug fixes once created, but no new features. master usually doesn't have its own version number, but just the one of the next stable branch which will be forked off (so 4.6 for example for KDevelop). Greetings, Sven
I'm working on the KDevelop IDE.
|
Registered Member
|
Ah, thanks for your explanation.
|
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]