Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Code-Completion

Code-Completion

Scheduled Pinned Locked Moved C#
questioncsharpjavavisual-studiohelp
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Peter Nirschl
    wrote on last edited by
    #1

    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

    H 1 Reply Last reply
    0
    • P Peter Nirschl

      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

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      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

      P L 2 Replies Last reply
      0
      • H Heath Stewart

        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

        P Offline
        P Offline
        Peter Nirschl
        wrote on last edited by
        #3

        Heath Stewart wrote: Not the best choice of editors. What else can I use? Regards

        H 1 Reply Last reply
        0
        • H Heath Stewart

          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

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          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

          P 1 Reply Last reply
          0
          • P Peter Nirschl

            Heath Stewart wrote: Not the best choice of editors. What else can I use? Regards

            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            • L leppie

              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

              P Offline
              P Offline
              Peter Nirschl
              wrote on last edited by
              #6

              How did you start? Can you give me some ideas? :confused::~ :~ :sigh: Oh, and what means this: leppie wrote: top secret ??? Regards

              L 1 Reply Last reply
              0
              • P Peter Nirschl

                How did you start? Can you give me some ideas? :confused::~ :~ :sigh: Oh, and what means this: leppie wrote: top secret ??? Regards

                L Offline
                L Offline
                leppie
                wrote on last edited by
                #7

                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

                P 1 Reply Last reply
                0
                • L leppie

                  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

                  P Offline
                  P Offline
                  Peter Nirschl
                  wrote on last edited by
                  #8

                  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!

                  L 1 Reply Last reply
                  0
                  • P Peter Nirschl

                    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!

                    L Offline
                    L Offline
                    leppie
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups