
Show HN: Lightweight C++ editor that understands your code - slededit
http://slededit.com/new/
======
slededit
I wanted something in between an IDE and a text editor that could properly
parse and understand C++11. I didn't see anything out there that was
lightweight and didn't want to take over my entire build system - yet could
still parse my code. So I wrote SLED.

~~~
marssaxman
Nice. Always happy to see projects like this.

Any chance of a Linux build?

~~~
slededit
The underlying code is designed to be cross platform, but I decided to focus
on windows first. Linux has been frequently requested though so I'll likely
focus on that next.

~~~
danh1979
I was also really excited to try this, but I mostly sit in front of Mac OS X,
a Linux, or a BSD, in that order. Bookmarked!

------
rwallace
I like the concept, would definitely try out again when it's a bit further
along. Main things from a quick look:

\- Today's monitors have plenty of horizontal space but a shortage of vertical
space; the context window needs to be alongside, rather than under, the code
window.

\- Ctrl-C/X without a selection should copy/cut the current line.

\- Autocomplete doesn't seem to work, e.g. type 'st' for the beginning of the
'static' keyword and nothing happens - the underlying mechanism is there and
working, because manually triggered completion with ctrl-space does work.

~~~
slededit
Thanks for the feedback I really appreciate it. Everyone uses their editor
slightly differently so I'm trying to hear from as many people as possible.

If you want to know when its more refined click the "Let me know when its
ready" button on [http://slededit.com](http://slededit.com)

~~~
mobiuscog
As the alternate opinion, I like the context editor underneath - I always
vertically split (even on widescreen), as I can't scan horizontally in that
respect.

Make it optional and provide both - always the answer ;)

Also - thanks for writing useful lightweight Windows development software -
there's a serious shortage at the moment as most tools (outside Microsoft)
have switched to Linux/OSX.

------
nebucnaut
First and most important: Great project! Writing an editor must be a whole lot
of work! Especially when source code analysis is included. You said that
you're using clang there. I've also been working with clang (for more than two
years by now) and I've got to say that it's a great tool when it comes down to
source code analysis. It's a little hard to get into, but it's totally worth
the effort - especially when templates are involved. You wouldn't wanna
analyze such code on your own ;) So I think you don't regret using clang
there, do you?

Now some feedback: \- I really like how your file search and the file tree
interact! \- It would be nice to show the definitions of local variables (e.g.
inside a function scope). Or even better: Highlight all usages that variable
throughout the scope! That would really help keeping track of things.

------
dman
Could you elaborate a bit on this statement - "SLED is poweful enough to learn
how to build your project on its own". How does this work?

~~~
slededit
One of the problems with having a non-IDE try to parse your code is it doesn't
know how its supposed to be built. I put a lot of effort to "guess" your
include directories so that libclang could do a half decent job at figuring
out the code.

When that fails it tries to make as much sense as possible with an incomplete
syntax tree - this part is still very much a work in progress.

~~~
dman
I dont know if you have looked at these options -

1\. Have wrapper scripts like sledgcc and sledg++ that keep track of compiler
flags passed into them. This way users can just change the compiler used in
their build scripts and you will be good to go.

2\.
[http://clang.llvm.org/docs/JSONCompilationDatabase.html](http://clang.llvm.org/docs/JSONCompilationDatabase.html)
seems to be a good option. Its reasonably easy to get your build system to
emit this and a few build systems can even do this out of the box.

~~~
slededit
Another option I'm exploring is using the debug info embedded in the
executable. There's lots of good info there.

------
TheCams
I'm in the office so I wont download the beta now, but I think you should add
more info on the website about the project (features, platforms supported etc)

What do you mean by "understand C++"? Does it offer features similar to
Intellisense/Visual Assist?

~~~
slededit
It offers proper auto-complete as well as fast navigation to a
function/symbols definition. It can also do a better job at syntax
highlighting than regex based highlighters. In the future I'm hoping to add
support for intelligent refactoring as well.

------
grok2
What's it developed in? C++ and Qt? I found it pretty fast, but it was buggy
(and for some reason jumped to the same file/line number) on the goto
definition selection. Maybe indexing wasn't complete. But it's really snappy!

~~~
slededit
C++ and win32 (with a light abstraction layer above it). Qt tends to be very
heavy weight and I wanted to control as much as possible so I could get near
instant boot times.

A few other library dependencies: \- libclang for heavy duty parsing (I also
have a "quick" parser that handles simple cases in real time). \- rapidxml for
the config files \- boost for Boyer Moore on the string search (but I'm trying
to move away from boost eventually).

~~~
grok2
How do you find using libclang for parsing (and I assume for indexing the
source code) -- at one point I was considering writing a C only text-editor
that understood the code using libclang for parsing, but was worried that
there would be too many corner cases for it to be useful. (Would be cool if
you can write up some blog post regarding your experience with it).

Also will sled work for browsing an entirely C codebase (without any C++)?

~~~
slededit
It should work with C code, right now it will parse it as C++ but that can
easily be fixed in the future. The 20th of this month will be the 1 year mark
of when I started writing it. Creating an editor isn't for the faint of heart.

I'll consider a writeup for libclang. The documentation isn't very good in my
opinion and I'm still not convinced I'm using it right even now.

------
jason_slack
any chance of an OS X build will be on your plate in the future?

~~~
slededit
Its on the radar, but at the moment just one platform is hard enough.

~~~
jason_slack
indeed. I had a popular app that worked on 5 platforms at the time and it
killed me to maintain all of them. This was back in 2000. The tools now help,
but still very hard.

