none
VS2015: frustration with background compiler changes

    Question

  • Why does the background compiler attempt to background compile the line of code while you are still typing it?

    In previous versions of visual studio, no syntax highlighting or auto correction or any kind of background compiling would occur until you had finished typing the line of code you are on and have moved away which made complete sense. Now in VS2015 it does the compile and syntax check etc while you are still typing the line. This is annoying - of course there are going to be syntax errors if i have not finished writing the line. It also results in issues for example if i am typing

    If ThisVar = "some text

    Before i have entered the closing quote after 'some text', the background compiler underlines the line and causes all of the code below that line to be treated as text and sometimes this results in messages which contain keywords to become capitalized for example if i have some hard coded text in a function further down which displays a messagebox saying something like "this is not to be done" then it auto corrects it so that it now says "this Is Not To be done" (because it then treats Is, Not, and To as keywords and capitalizes them accordingly since it has attempted to compile my code before i have entered the closing quote on 'some text' above). This has been really annoying at times. Can someone please explain why or even better tell me how i can disable this without turning off background compile and syntax checking altogether?





    • Edited by luker459 Wednesday, February 17, 2016 8:05 AM
    Tuesday, February 16, 2016 11:02 PM

Answers

All replies

  • Hi luker,

    Thanks for your post.

    I did a test in my side using VS2015 , VS2013 and VS2010. And the behavior in the VS2013 and VS2010 is same. The background compiler changed after I stop writing my code.

    But in VS2015, the background compiler underlines the line is always exist during writing my code.

    Also I have checked the related settings about this, but I can't find any setting to disable it.

    I think this behavior of this function should be a default design for Visual Studio 2015. And Comparison of the old version of Visual Studio. I think the behavior in VS2015 is not correct.

    In this case, I suggest you could  submit this feature request:

    http://visualstudio.uservoice.com/forums/121579-visual-studio

    The Visual Studio product team is listening to user voice there. You can send your idea there so the others can vote it.

    If you submit this suggestion, you might post that link here which will benefit others who has the similar issue, I will vote it. Thanks for your understanding.

    Best Regards,

    Lake Xiao

    Wednesday, February 17, 2016 5:47 AM
    Moderator
  • Since multiline strings are allowed, Visual Studio assumes that you are going to edit one when you press <Enter> or arrows after "some text. It then interprets the next " as the end of the multiline text.

    Since Visual Studio cannot always guess the intentions, seems that it requires some mutual help. I.e. you should not leave incomplete strings.

    Usually when you start typing " and the text, it automatically inserts the closing ". To avoid the problems, do not remove the closing ".

    The undesired changes can be revered with Undo (<Ctrl+Z>).

    Perhaps the behaviour will be revised in future versions.

    Wednesday, February 17, 2016 7:18 AM
  • Since multiline strings are allowed, Visual Studio assumes that you are going to edit one when you press <Enter> or arrows after "some text. It then interprets the next " as the end of the multiline text.

    Since Visual Studio cannot always guess the intentions, seems that it requires some mutual help. I.e. you should not leave incomplete strings.

    Usually when you start typing " and the text, it automatically inserts the closing ". To avoid the problems, do not remove the closing ".

    The undesired changes can be revered with Undo (<Ctrl+Z>).

    Perhaps the behaviour will be revised in future versions.

    I prefer not to use automatic brace completion - but enabling it would prevent the capitalization issue. I still don't understand why it tries to compile a line of code when you have not yet finished writing it.
    Wednesday, February 17, 2016 8:08 AM
  • Hi luker459,

    >>I still don't understand why it tries to compile a line of code when you have not yet finished writing it.

    Yes I agree with you on this point. I also think this behavior is not correct in VS2015.

    So I submit a feature request for this problem, you can vote it in the link below:

    http://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/12374505-why-it-tries-to-compile-a-line-of-code-when-you-ha

    Best Regards,

    Lake Xiao

    Thursday, February 18, 2016 8:00 AM
    Moderator