spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.11k stars 1.57k forks source link

Automatic indentation for C files #2478

Open pitrou opened 9 years ago

pitrou commented 9 years ago

Currently Spyder only seems to have automatic identation support for Python source files. It would be nice to have indentation support for other languages, such as C. (minimal support would be at least to keep the previous line's indentation...)

ccordoba12 commented 9 years ago

@goanpeca, this one seems for you after you refactor the Editor to make it more extensible.

goanpeca commented 9 years ago

yep

goanpeca commented 9 years ago

@ccordoba12, maybe we can start making the 3.1 milestone and add this one to it ?

ccordoba12 commented 9 years ago

@goanpeca, I think this should go to 4.0. I plan to use 3.1, 3.2, etc to do bugfix releases, which shouldn't include new features or big refactors, such as this one.

goanpeca commented 9 years ago

4.0 ? that seems so far away !!

ccordoba12 commented 9 years ago

I know! ;-) But 3.0 already has a lot of new things, and we need to work hard to stabilize it. I've received a lot of complaints lately about Spyder not being stable enough and still crashing too much.

So if you don't have this planned for 3.0 (which is totally fine for me because it seems to touch too much code :-), we need to leave it for our next major release. In any case, we can merge your work for this in master at any point after 3.0 is released.

goanpeca commented 9 years ago

Ok :+1:

goanpeca commented 9 years ago

How much time before alpha or beta is released @ccordoba12 ?

I will try next week to rearrange the editor, if nothing seems to be broken we can try to squueze it in 3.0 so that work in supporting C, Md and rst can be placed in 3.1 and 3.2 ?

I know we need stability but this is a crucial set of features needed and 4.0 seems like a year away or more already :-(

Nodd commented 9 years ago

I know you like developing new features and use them, But i agree with @ccordoba12 that we should wait a bit for this one. There is still lots of things to do for 3.0, we don't need another big thing. Also spyder is a python editor, not a C editor, so while it will be very nice to better support more languages, i don't see it as a high priority (for example I use geany to edit the C files I use with python). Revamping the whole editor in a hurry "just" for C indentation seems a bit excessive.

pitrou commented 9 years ago

Well, using a separate editor per programming language is not extremely practical ;) As I said the language doesn't need to be very integrated, but basic (sane) auto-indent would still be better than no identation at all. (as a data point, I'm not a Spyder user, since editing C - and possible other languages - is one of the required features for me)

goanpeca commented 9 years ago

@Nodd what I meant was: I want to refactor the code as to have a base implementation so that the language specific things can be implemented in 3.1 3.2 etc. (as it would not require a major code change) I know that there is a risk that bugs are introduced by doing the refactor, but since apparently we want to adhere to the major minor convention (major features, bug fixes) waiting for 4.0 seems too far away. Is like projects, the basic implementation is almost ready, but adding extra projects and small features on top of the base is easier and might pass as a minor (Version) feature.

For the code editor I do not plan to actually implement any language specific functionality, but rearange a base editor and take away the python specific things to another "editor". So for the user of 3.0 there would not be any major change (just code refactoring) so that the subsequent changes are not so big! Bugs introduced here can still be fixed in minor releases.

I also agree about stability and error checking, but to be honest I also code in other languages, html css, scss, js, (C not really at this point) and not having basic simple things it is getting annoying.

Changing IDE is not an option, and as @pitrou points out not practical.

Nodd commented 8 years ago

I think it's implemented, right ?

ccordoba12 commented 8 years ago

Sort of. In master I made auto-indentation to work for all file types, and not just Python. But the way it works is by maintaining the same level of indentation of the previous line. @Nodd, how do you feel it works?

We could improve this by using indentation and de-dentation rules per language. This shouldn't be hard because Atom has tons of rules (under the MIT license) that we could use in Spyder :-)

goanpeca commented 8 years ago

Until we refactor the editor, it will only make it more spaguetti...