MW

Tag kate

Recent Posts

Kate Highlighting for QML, JavaScript (April 17, 2014)

Hey everyone!

I’ve started my internship at KDAB this week, it’s great fun so far! Though I spent most of my time this week on Bertjans KDevelop plugin, I couldn’t resist on a bit of Kate hacking:

steveire is experimenting with QML so I couldn’t stop but notice that there is no highlighting for it in Kate. Well, there was none ;-) Now you get pretty colors, rejoice!

Note: Since QML is basically JSON with some added sugar, I reused the existing JavaScript highlighter and improved it. Hence you get imrpoved JSON and member highlighting in plain.js as well. Enjoy!

continue reading...

Kate/KDevelop Sprint 2014: First Days (January 22, 2014)

Hey all! Greetings from the joint Kate/KDevelop sprint at the Blue Systems office in Barcelona!

I only arrived yesterday but already I have great news for you: After months of work I finally merged the sharedurls branches into master for KDevelop/KDevplatform etc. pp. There I worked on a optimization in our handling of file paths.

The status quo up until know was the following: When importing a folder as a project in KDevelop, we filled a model with every file and folder in the project (recursively). For every item we also stored its path as a KUrl to the potentially remote location. KUrl and QUrl are awesome when you have to work with paths and urls, but as soon as you store potentially thousands of them at the same time it becomes quite inefficient. Assume e.g. you open /foo/bar/blub/ which contains /foo/bar/blub/bla.h. When you use KUrl/QUrl to store these paths, you cannot share any memory between the two, as internally basically a QString is used. Thus, when you import deep folder trees or folders with many files, you’ll waste a lot of memory for common sub-paths. Furthermore, due to the amount of allocations required, reading the tree is pretty slow.

continue reading...

KDevelop 4.2 Beta 1 released (December 18, 2010)

Hey all,

I’m happy to announce the immediate availability of KDevelop 4.2 Beta 1. This is a testing version and any kind of feedback would be welcome and appreciated. Please use our bugtracker. You can download the sources or wait for your distribution to create packages.

Note: Anyone who runs KDE 4.6 or later needs this version (or any later). This is because the SmartRange interface in Kate got nuked and replaced with MovingRange interface. Many thanks to David Nolden for more or less single handedly porting KDevelop to this new architecture.

The good news doesn’t end here though, KDevelop 4.2 ships with lots of notable changes and new features:

  • MovingRange` support (Thanks to David Nolden)
  • Grep Plugin rewrite with replace functionality (Thanks to Silvere Lestang, Julien Desgats, Benjamin Port)
  • QtHelp plugin now supports arbitrary .qch files (Thanks to Benjamin Port)
  • ManPage plugin (Thanks to Benjamin Port, Yannick Motta)
  • new look for code assistants (Thanks to Olivier JG)
  • filter for the project model view (Thanks to Eugene Agafonov)
  • improved “Problems” toolview, along with “TODO/FIXME” browsing (Thanks to Dmitry Risenberg)
  • better standards compliance in the C++ macro implementation (Thanks to Dmitry Risenberg)
  • argument dependent lookup for the C++ plugin (Thanks to Ciprian Ciubotariu)
  • open with external application by default (esp. useful for Qt Designer .ui files)
  • PHP: rainbow colors for all vars (and no nested functions or similar), esp. useful for scripts without Classes/Functions
  • code cleanup for working sets
  • better handling of locked sessions (locked session gets activated or the user gets asked whether he wants to remove the lock file)
  • improved Snippets editing usability

continue reading...

KDevelop and Kate advancements over the last weeks (November 21, 2010)

Hey all,

I didn’t blog in a long while so I thought I’d dump some notable things I did over the last weeks. It’s probably neither complete nor thorough - you should try it all out to see it for yourself :)

Kate

Lets start small with my Kate contributions. I really concentrate on KDevelop nowadays since Kate works quite well for me and I don’t have many itches to scratch anymore :) So, what did I do these last weeks? Mostly cleanup and performance work, especially regarding MovingRanges which of course is mostly needed for a good experience in the upcoming KDevelop 4.2. With the help of Dominik Haumann I also went through our indentation unit tests and made sure we expect all currently failing test cases, as well as fixing those I could. Now we (finally!) have a passing test suite and get noticed about introduced regressions. Awesome!

KDevelop

Of course I still concentrate my contributions on KDevelop and related plugins. What I find quite interesting is that I’m now for over two months in a “polish-and-bugfixing” -mode, without adding much new features. I think that shows that I’m quite satisfied with the existing features, just not with the way they are integrated. E.g. the Kate performance improvements above were done in order to make “reformat source” not hang the IDE for a couple of seconds anymore, in KDevelop 4.2 it will only be like one second for really big source files. I’ve also tackled our black sheep, the “launch configuration” dialog. I didn’t rewrite it, but I did some polishing and have some more ideas to hopefully get it into a useable state. Oh, I just remember: I also spent some time on the “Snippets” plugin, restructured the editor dialogs a bit and made them use Katepart as well, for syntax highlighting and proper editor features :)

continue reading...

Beware of KDevelop Master and KDELibs 4.5.1 or lower (September 10, 2010)

Hey all,

please don’t use KDevelop master with KDELibs 4.5.1 or lower. Katepart in that version misses a crucial commit that makes KDevelop crash. It is fixed for 4.5.2. In the meantime you have on of the following options:

  1. Build kate from sources
  2. Switch to the stable branches, i.e.: KDevplatform 1.1, KDevelop 4.1, PHP 1.1, …
  3. wait for the 4.5.2 release

bye

continue reading...

Spotlight: Kate Scripting (July 27, 2010)

Hey ho everyone.

Dominik asked me to blog about a feature in Kate that is still (sadly!) pretty unknown and seldom used: Kate Scripting. As you should know you can script KatePart completely via JavaScript. As those articles explain, it’s rather simple to write functions and put them into a file to have them reusable. But what for those write-use-throwaway kind of cases, where you simply need to get a job done quickly and don’t want to go through the overhead of writing some full fledged, documented, action-binded, localized script?

Utility Functions and why JavaScript rocks

Note: Neither map nor filter will be shipped with 4.5 to my knowledge, sorry about that. But you can still use the each helper (see below) to achieve the same with a bit more typing…

continue reading...

Kate/KDevelop HackSprint - Up To Day 4 (February 18, 2010)

Woha, quite a few days flew by without me blogging about anything. Thankfully the others started to write so I don’t have to repeat it all ;-) Instead I’ll concentrate on stuff I did or learned.

GHNS for Snippets

Well, first I think an excuse is in oder: There is a GHNS button for Kate Snippets in 4.4.0 but it’s broken, neither me nor Joseph had time to acutally use and fix it… But anyways, I fixed it now for 4.4.1. For 4.5 we’ll also have an Upload Dialog.

I also added both now to KDevelop, you can now upload and download snippets from it. I added a few dump examples but will probably improve it steadily.

Kate Performance

On Saturday and Sunday I started to profile Kate highlighting for a large MySQL dump and managed to greatly improve the speed. Actually the funny thing is that I could improve RegExp based highlighting (you still should try to prevent using it, it will always be slower than simple char/string based highlighting). And the knowledge for this optimization I had from my time as an active contributor for GeSHi. I feel like it was ages ago, he funny :)

continue reading...

Kate/KDevelop HackSprint Day 1 (February 14, 2010)

So, first day of the Kate/KDevelop hacksprint.

We just talked and hacked at the rented flat,got to know each other and had a fun time. Everybody made it more or less in time, even last minute attendee Adymo from Ukraine, nice! Hacking-wise the productivity wasn’t that high, esp. for me, but a few patches got committed here and there.

Right now I’m working on a little speedup for Kate, esp. for big MySQL files - lets see how it turns out. Cullmann showed me a few things I could do so maybe it works out, lets see.

Over the next week I plan to push in user configurable include paths for the PHP plugin and do some more Snippets & Scripting work in Kate, lets see how it turns out. I’ll go home now, kinda sucks that I don’t stay with the others here at the flat but have to take a 1h ride into the city… Berlin is definitely too big :D

continue reading...

Snippets In KDevelop / Kate (February 03, 2010)

Hey all!

Just wanted to give you a little rundown on Snippets in Kate 4.4 (via the snippets_tng plugin) and KDevelop Beta 8 (soon to be released).

Note: The Kate plugin was written by Jowenn and introduced me to all these nice features. For KDevelop I wrote a somewhat simpler yet imo better implementation. We will try to get the best of both worlds into KDE 4.5. Stay tuned!

General Usage & Features

  • create a snippet repository (or download via GHNS [see below])
  • create snippets in that repository
  • insert snippets via the snippets view (i.e. double click), or (imo better/faster) insert them via code-completion (remember: CTRL + Space requests code completion at the current cursor position!).
  • snippet gets inserted (properly indented) and potential placeholders/variables get expanded. A variable is something like %{date} or ${email}. Also take a look at the API documentation.
  • variables that get inserted via “${…}” will be “selectable”, meaning you can jump from one var to the other by hitting TAB / Shift TAB
  • the %{...} vars will only get expanded and inserted, without getting selectable.
  • multiple occurrences of the same variable will be updated once one of them gets edited, something that is called “mirroring” in other editors.
  • once one edits ESC the cursor is placed at the end of the snippet or to the first occurrence of ${cursor} or %{cursor} and the user types something, the snippet-handler quits and you are left with your normal editor until you insert the next snippet
  • nested snippets (i.e. insert snippet than insert another one) should “just work”.

continue reading...

Kate polishing (January 21, 2010)

Phew, I just finished some last-minute backports to the KDE 4.3.5 branch. Lets hope the bug fixes I and pletourn did are as good as they look. Expect a much more stable Kate for 4.3.5 & 4.4! We managed to fix two bugs which are potentially the cause for dozens of bug reports, all seemingly random. Lets see whether our fixes hold up to our hopes!

Other than that: You should look forward to Kate scripting (with JavaScript) in 4.4. It’s dead simple but actually useful. In the utils.js file we ship with Kate there are now the following tools (all operate on the selection or - if none exists - on the whole document):

  • sort - simple sorting
  • natsort - natural sorting
  • uniq - filter duplicates
  • trim - remove leading & trailing whitespace
  • ltrim - remove leading whitespace
  • rtrim - remove trailing whitespace

Do you have more ideas for such simple helper functions?

continue reading...