SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Code auto-complete [VB.NET]

Last post 09-03-2008 3:36 PM by DanielGrunwald. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-31-2008 5:34 PM

    Code auto-complete [VB.NET]

    Sometimes the Code auto-complete doesn't work for no particular reason...

    If I write "If 1 = 1" and then press ENTER SD shoult auto-complete this to

     "If 1 = 1 Then

     End If"

     

    But is doesn't. I found out that this sometimes depends on the fact, that the "Then" is missing anywhere in the whole code

    e.g.:

    If 1 = 1

        Messagebox.Show("Möp")

    End If

    Or if you write 2 commands in one line (e.g.: "Catch : End Try")

    Compiling is still possible, but tue auto-complete is de-activated by this.

     

    Now if I write "If 1 = 1" and press ENTER, SD doesn't complete it anymore...

    But in the Project I'm working at i couldn't find anything like this. And it's nasty to check every If and Try you use in your Code, especially if it is more then 1200 Lines long...

     

    I hope someone knows how to solve this problem, because always writing the "Then" and the "End If" is making me crazy.

    It would help me a lot.

     

    Thx to everyone who can help me - cca_ccb

  • 09-01-2008 4:52 PM In reply to

    Re: Code auto-complete [VB.NET]

     I found out wha also causes this problem:

    A comment behind an If like this:

     If True = True Then 'comment here

    End If

     Now the problem appears.

    It would be great, if someone can solve this...

    Here some Code how to check Code: (All If/Then should be written with a capital starting letter)

     Start:

     Dim Reader As New IO.StringReader(Me.richTextBox1.Text)
            Dim eError As Boolean = False
            Dim i As Integer
            Dim Trys As Integer
            Dim EndTrys As Integer

            Try
                While eError = False
                    Dim z As String = Reader.ReadLine()
                    z = z.Replace("ify", "") 'replace some stuff like "notify or so...

                   If z.Contains("If") Or z.Contains("Elseif") Then
                        If Not z.Contains("Then") And Not z.Contains("End If") or z.Contains(Chr(39)) Then
                            Messagebox.Show("If: " & i + 1)
                        End If
                    End If
                    If z.Contains("  ") Then
                        Messagebox.Show("Space : " & i + 1)
                    End If
                    If z.Contains("Try") And Not z.Contains("End Try") Then
                        Trys += 1
                    End If
                    If z.Contains("End Try")  Then
                        EndTrys += 1
                    End If
                    i += 1
                End While
            Catch
                eError = True
            End Try
            Messagebox.Show("Trys: " & EndTrys - Trys)
            Messagebox.Show("Finished")

     

  • 09-03-2008 3:36 PM In reply to

    Re: Code auto-complete [VB.NET]

     Entered into issue tracker: SD2-1448

    Daniel Grunwald
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.