List Info

Thread: Intentation




Intentation
country flaguser name
Russian Federation
2007-12-25 12:12:01
Hi,
one of my biggest problem with KDevelop as use is the way
source code indentation works:

1. There's auto-indentation provided by Kate, and (at least
in
3.5) there's reformat feature, which uses completely
different
code path -- and will given different results compared to
auto-indent.

2. It appears that some styles are just not possible (like
the gnu style).

I have those questions:

1. Anybody know off-hand if we can easily take over
auto-indentation.

2. Any comments about using flexible indentation scheme,
where
various "syntactic elements" are given specific
indent, that can
be changed by user. That's how Eclipse and Emacs work, for
example.

3. It it possible to extract syntax context from C++ parser
(like,
"we're inside class", or "we're in namespace
scope"?

Thanks,
Volodya


_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: Intentation
user name
2007-12-26 05:02:24
On 25.12.07 21:12:01, Vladimir Prus wrote:
> 
> Hi,
> one of my biggest problem with KDevelop as use is the
way
> source code indentation works:
> 
> 1. There's auto-indentation provided by Kate, and (at
least in
> 3.5) there's reformat feature, which uses completely
different
> code path -- and will given different results compared
to
> auto-indent.

Right, astyle does a much better job and has more options
than the
kate-indenter.

> 2. It appears that some styles are just not possible
(like
> the gnu style).
> 
> I have those questions:
> 
> 1. Anybody know off-hand if we can easily take over
auto-indentation.

I'm not sure, but I suspect the answer is no. In particular
I doubt we
can easily use astyle for auto-indenting as it needs context
to know the
proper indentation. So you'd re-indent the whole file on
each newline
which will bring performance issues. And I'm pretty sure we
don't have
the power to invent our own indenter.

> 2. Any comments about using flexible indentation
scheme, where
> various "syntactic elements" are given
specific indent, that can
> be changed by user. That's how Eclipse and Emacs work,
for example.

AFAIK thats what you do with astyle as well, however as any
other
software astyle has bugs.

> 3. It it possible to extract syntax context from C++
parser (like,
> "we're inside class", or "we're in
namespace scope"?

Yes.

Andreas

-- 
Stay away from hurricanes for a while.

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )