How can we help you today? How can we help you today?

Intellisence on Commented Code

SQL Prompt gives me intellisence on Commented code:
Type in -- NEW PROC CREATED
holding down the shift key while type something in caps and you get the SQL Prompt intellisense? is there a way to tell it to ignore comments ?
emails4me
0

Comments

6 comments

  • lysp
    emails4me wrote:
    SQL Prompt gives me intellisence on Commented code:
    Type in -- NEW PROC CREATED
    holding down the shift key while type something in caps and you get the SQL Prompt intellisense? is there a way to tell it to ignore comments ?

    I'd like this as an option to turn on/off. Sometimes i write code in commented out parts that i still want intellisense for.

    eg.
    UPDATE Table SET
    LookupID = x
    WHERE 1 = 2
    
    /*
    SELECT *
    FROM LookupTable
    */
    
    lysp
    0
  • nanchen
    Hello,

    for me, there is no need for an option: intellisense should not work inside comments! Indeed, if I want intellisense for code inside comments, I uncomment my comment just for the time while I am writing it, and then I "redo" my comment. While fulfilling my ususal tasks, I expect it would take longer to go in the options and to turn them on/off...

    Just my 2cents,

    Emmanuel
    nanchen
    0
  • neilpwaa
    Could we have the option to turn the inteli-comments on or off? It could be useful in certain cases when documenting code. Maybe even set the level at which it appears i.e. stored proc names, table names, view names only. Not essential tho...

    Great add-in overall!

    Cheers
    Neil

    PS Could it do all my documenting automatically please? javascript:emoticon(':wink:')
    Wink
    neilpwaa
    0
  • Bart Read
    I think what's probably happening here is that SQL Prompt is just putting up the default candidate list (which it tends to do when all else fails). I have a feeling our parser just ignores comments entirely which makes it a little tricky because you don't necessarily know when you're inside one. We'll look into this further though.
    Thanks,
    Bart
    Bart Read
    0
  • PaulLach
    The candidate list also pops-up when typing literal strings (inside single quotes). I would ask that if you get SQL Prompt to recognize when it is inside a comment section you would also teach it to recognize when it is inside a literal string.
    PaulLach
    0
  • CWuestefeld
    nanchen wrote:
    for me, there is no need for an option: intellisense should not work inside comments!
    I disagree. A common pattern for me, and some of my coworkers, is to use comments as a defense against premature execution of a data-changing query.

    I'll frequently do something like
    SELECT * FROM mytable
    -- UPDATE mytable SET x=y+1
    WHERE z IS null
    
    The idea here is that I can verify that my query targets the right rows by running it as shown. Then I select the bottom two rows (except the "--") in order to make the actual change.

    In this situation I don't want to uncomment the UPDATE because that eliminates my protection. But I would like the intellisense help for that part of the query.
    CWuestefeld
    0

Add comment

Please sign in to leave a comment.