Code-Completion
-
Hello everybody! I've written a JavaCoder. With this program I can create,edit,... my java source files. I have even been able to highlight the syntax ( like in Visual Studio. NET ;) ). Now I've got a question: :(( How can I make a code-completion? :sigh: I use a richt-text-box to edit my files. Can anyone help???? Thanks petermax2
-
Hello everybody! I've written a JavaCoder. With this program I can create,edit,... my java source files. I have even been able to highlight the syntax ( like in Visual Studio. NET ;) ). Now I've got a question: :(( How can I make a code-completion? :sigh: I use a richt-text-box to edit my files. Can anyone help???? Thanks petermax2
petermax2 wrote: I use a richt-text-box to edit my files. Not the best choice of editors. You spend more time overriding functionality than just doing a code editor from scratch. There are also many examples out there (see http://www.gotdotnet.com/workspaces[^]) that could give you some hints. How do you get command-completion to work? For languages that support it, you use reflection (which Java supports). When you hit the member separator (typically "."), you reflect (and cache, if you haven't already - which is a good idea) the members. I assume you're doing this in C# since you're in the C# forum, so you'll need to use a native JNI DLL and encapsulate that in a managed class. Click "My Articles" in my sig and see my Java/.NET article for a discussion on that. See the JNI docs on Sun's http://java.sun.com[^] site for more information about using Java classes from C/C++.
Microsoft MVP, Visual C# My Articles
-
petermax2 wrote: I use a richt-text-box to edit my files. Not the best choice of editors. You spend more time overriding functionality than just doing a code editor from scratch. There are also many examples out there (see http://www.gotdotnet.com/workspaces[^]) that could give you some hints. How do you get command-completion to work? For languages that support it, you use reflection (which Java supports). When you hit the member separator (typically "."), you reflect (and cache, if you haven't already - which is a good idea) the members. I assume you're doing this in C# since you're in the C# forum, so you'll need to use a native JNI DLL and encapsulate that in a managed class. Click "My Articles" in my sig and see my Java/.NET article for a discussion on that. See the JNI docs on Sun's http://java.sun.com[^] site for more information about using Java classes from C/C++.
Microsoft MVP, Visual C# My Articles
Heath Stewart wrote: Not the best choice of editors. What else can I use? Regards
-
petermax2 wrote: I use a richt-text-box to edit my files. Not the best choice of editors. You spend more time overriding functionality than just doing a code editor from scratch. There are also many examples out there (see http://www.gotdotnet.com/workspaces[^]) that could give you some hints. How do you get command-completion to work? For languages that support it, you use reflection (which Java supports). When you hit the member separator (typically "."), you reflect (and cache, if you haven't already - which is a good idea) the members. I assume you're doing this in C# since you're in the C# forum, so you'll need to use a native JNI DLL and encapsulate that in a managed class. Click "My Articles" in my sig and see my Java/.NET article for a discussion on that. See the JNI docs on Sun's http://java.sun.com[^] site for more information about using Java classes from C/C++.
Microsoft MVP, Visual C# My Articles
Heath Stewart wrote: You spend more time overriding functionality than just doing a code editor from scratch. Exactly what I have been doing the last 3 months, doing a custom rendered code editor. Still needs some work, but its almost done. :) top secret
-
Heath Stewart wrote: Not the best choice of editors. What else can I use? Regards
As I mentioned, right your own or borrow ideas appropriately from vast numbers of examples out there on the web. I even gave you a link to the GotDotNet workspaces where you'll find many examples. leppie - another regular on CodeProject - replied below that he's been working on one. There are tons of examples - just do some research if you don't know how to write a text editor.
Microsoft MVP, Visual C# My Articles
-
Heath Stewart wrote: You spend more time overriding functionality than just doing a code editor from scratch. Exactly what I have been doing the last 3 months, doing a custom rendered code editor. Still needs some work, but its almost done. :) top secret
How did you start? Can you give me some ideas? :confused::~ :~ :sigh: Oh, and what means this: leppie wrote: top secret ??? Regards
-
How did you start? Can you give me some ideas? :confused::~ :~ :sigh: Oh, and what means this: leppie wrote: top secret ??? Regards
petermax2 wrote: How did you start? I started thinking it wouldnt be more than a 1000 lines. Its 7000+ now! Most of the time was spent designing and developing fast algorithms to replace known slow operations. Thanks to my design, adding a new language hilighting scheme is a breeze (not always, need to make it better still), and it currently supports 5 langauges: C#, C, MSIL, Nemerle, and XML (beta). petermax2 wrote: Can you give me some ideas? I'm going to be releasing the source under a GPL/LGPL license within the next 3 months. Some ideas you mite wanna ponder on if you cant wait: - Write down your goals and get the big picture on paper and stick to it. If you change it, start from scratch. - Design, design, design (you can never be too sure). - KISS, think how things exponitanally can affect future dependant operations. - Fimiliarise yourself with how painting and clipping is done (a new article on CP is very informative on some painting stuff). Know the limits of related Drawing objects (like the maximum area of a region). - Modularize all aspects, but keep them tighly integrated so information is not required to be duplicated. Memory and speed are your biggest enemies! - Dont write any code until u know exactly what your design spec specifies and that it is known to work correctly. Run simulations in your head. - DO NOT look at SharpDevelops attempt. It was a good design ruined by terribly sloppy coding. - Think how things can be speeded up. eg you have a big file and you are near the end of the file, it will obviously be better to do calculations from the end (or even some nearer known point). Now that I have scared you enough, I think a small wait will be worthwhile :) petermax2 wrote: ??? It's meant to be an IRC link. Install mIRC! Feel free to ask anymore questions. :) top secret
-
petermax2 wrote: How did you start? I started thinking it wouldnt be more than a 1000 lines. Its 7000+ now! Most of the time was spent designing and developing fast algorithms to replace known slow operations. Thanks to my design, adding a new language hilighting scheme is a breeze (not always, need to make it better still), and it currently supports 5 langauges: C#, C, MSIL, Nemerle, and XML (beta). petermax2 wrote: Can you give me some ideas? I'm going to be releasing the source under a GPL/LGPL license within the next 3 months. Some ideas you mite wanna ponder on if you cant wait: - Write down your goals and get the big picture on paper and stick to it. If you change it, start from scratch. - Design, design, design (you can never be too sure). - KISS, think how things exponitanally can affect future dependant operations. - Fimiliarise yourself with how painting and clipping is done (a new article on CP is very informative on some painting stuff). Know the limits of related Drawing objects (like the maximum area of a region). - Modularize all aspects, but keep them tighly integrated so information is not required to be duplicated. Memory and speed are your biggest enemies! - Dont write any code until u know exactly what your design spec specifies and that it is known to work correctly. Run simulations in your head. - DO NOT look at SharpDevelops attempt. It was a good design ruined by terribly sloppy coding. - Think how things can be speeded up. eg you have a big file and you are near the end of the file, it will obviously be better to do calculations from the end (or even some nearer known point). Now that I have scared you enough, I think a small wait will be worthwhile :) petermax2 wrote: ??? It's meant to be an IRC link. Install mIRC! Feel free to ask anymore questions. :) top secret
leppie wrote: Now that I have scared you enough I'm not scared about this. I know that I can't write a code editor on one day. You said Sharp Develop! I've got an idea! Is it possible to use components like CodeEditor,Windows Forms Designer from the Sharp Develop components? Thank you for the information you gave me!
-
leppie wrote: Now that I have scared you enough I'm not scared about this. I know that I can't write a code editor on one day. You said Sharp Develop! I've got an idea! Is it possible to use components like CodeEditor,Windows Forms Designer from the Sharp Develop components? Thank you for the information you gave me!
petermax2 wrote: You said Sharp Develop! I've got an idea! Is it possible to use components like CodeEditor,Windows Forms Designer from the Sharp Develop components? Its possible, but I can gaurentee you that you will be pulling your hair out, fixing bugs, and trying to understand someones idea of logic. Also there codeeditor component is a huge memory hog. My control uses a fraction of the memory used by the former. Try loading a big file in it say about 10mb, it will use close to 300mb of memory, where mine "only" use about 70-80mb. Well if you decide to go for it, good luck! top secret