Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Snippet inserted. #7858

Closed
AdamSpeight2008 opened this issue Jan 8, 2016 · 5 comments
Closed

Wrong Snippet inserted. #7858

AdamSpeight2008 opened this issue Jan 8, 2016 · 5 comments
Labels
Area-IDE Resolution-By Design The behavior reported in the issue matches the current design

Comments

@AdamSpeight2008
Copy link
Contributor

I happen upon this issue today.

Example

Module Module1

    Sub Main()
        Dim used = {1, 3, 5}
        Dim unused = Enumerable.Range(0, 10).E ' Highlight Except then do double tab.
    End Sub

End Module

Actual Output

Module Module1

    Sub Main()
        Dim used = {1, 3, 5}
        Dim unused = Enumerable.Range(0, 10).Public Class 
    Inherits System.Exception

    Public Sub New(ByVal message As String)
        MyBase.New(message)
    End Sub

    Public Sub New(ByVal message As String, ByVal inner As Exception)
        MyBase.New(message, inner)
    End Sub
    End Class
    End Sub

End Module

Expected Output

Module Module1

    Sub Main()
        Dim used = {1, 3, 5}
        Dim unused = Enumerable.Range(0, 10).Except( || ) ' || Caret position.

    End Sub

End Module

@gafter gafter added the Area-IDE label Jan 8, 2016
@Pilchie
Copy link
Member

Pilchie commented Jan 11, 2016

This happens because Except is the snippet shortcut for the "Define an Exception type" snippet. It doesn't matter what was selected in completion before that - the snippet insertion logic just matches the characters in the editor when the second tab is pressed.

@Pilchie Pilchie closed this as completed Jan 11, 2016
@Pilchie Pilchie added the Resolution-By Design The behavior reported in the issue matches the current design label Jan 11, 2016
@AdamSpeight2008
Copy link
Contributor Author

@Pilchie
It looks it shouldn't do that from the intellisense.
vs intellisense issue

@Pilchie
Copy link
Member

Pilchie commented Jan 11, 2016

The Except snippet is actually the one to define a new exception type.

@AdamSpeight2008
Copy link
Contributor Author

@Pilchie yes, I know it outputs Expection snippet, but from the Note: in the intellisense it suggest that. It suggests something to do with Enumerable.Expect

@Pilchie
Copy link
Member

Pilchie commented Jan 11, 2016

It's not referring to the method, it's referring to the snippet which has the shortcut Except. The tooltip logic just adds that text any time there is a snippet with a shortcut that matches the selected item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Resolution-By Design The behavior reported in the issue matches the current design
Projects
None yet
Development

No branches or pull requests

3 participants