none
TaskList items line number bug RRS feed

  • Question

  • Hi,

    I wrote a language service which scan the source file and create Comment Tasks based on the token defined in Tool/Options... In short exactly how Visual Studio do it.

    Before adding these tasks with the TaskProvider, I set the Line property of the Task with the "true" line number (1 index based). When I double click on that task, it navigate directly to it and set the cursor at the right line number.

    Here comes the part that isn't working. When I look at the line number displayed in the Task List tool window, it's line number + 1. So basically, if I put a // TODO at line 10, it will be displayed being at line 11.

    If I try to fix the problem by setting the task line number to a 0 based index (so line number - 1), it display the right line number in the tool window but navigate to the wrong line when I double click on the task.

    If it help, here is how I set the EventListener of the task :

    task.Navigate += delegate(Object sender, EventArgs e)
    {
        taskProvider.Navigate((Task)sender, VSConstants.LOGVIEWID_TextView);
    };

    If anyone has an idea, please let me know.

    Thanks
    Francois
    • Changed type Feng Chen Monday, August 4, 2008 2:30 AM Need feedback.
    • Changed type fgervais Monday, August 4, 2008 6:44 PM I provided more information about the bug
    Tuesday, July 29, 2008 8:56 PM

Answers

  • For bug report or feature requestion, the recommended way is to submit it to the following site in the formal way: http://connect.microsoft.com/VisualStudio/

    After you submit it, we will appreciate it if you can share the feedback address so that it can be found and checked out by other community members having similar issues.

    Thanks for your valuable feedback!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Feng Chen Thursday, August 7, 2008 3:51 AM
    Friday, August 1, 2008 9:07 AM

All replies

  • For bug report or feature requestion, the recommended way is to submit it to the following site in the formal way: http://connect.microsoft.com/VisualStudio/

    After you submit it, we will appreciate it if you can share the feedback address so that it can be found and checked out by other community members having similar issues.

    Thanks for your valuable feedback!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Feng Chen Thursday, August 7, 2008 3:51 AM
    Friday, August 1, 2008 9:07 AM
  • Could you please provide the version of Visual Studio and the source code & detailed steps to reproduce this issue?

    Thanks!

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, August 1, 2008 9:08 AM
  • We are changing the issue type to “General Discussion” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions. 

    Thank you! 

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, August 4, 2008 2:30 AM
  • Hi,

    I'm using visual studio 2008 SP1 Beta with .NET 3.5 SP1 Beta and Visual Studio 2008 SDK.

    There is no real easy way to reproduce the problem since you need an IServiceProvider to create a TaskListProvider but here is what you can do :

    Open ManagedMyC example of the SDK and insert this code at the beginning of the ParseSource method in ManageBabel LanguageService.cs. These files are added as a link by default but it doesn't matter :

    Microsoft.VisualStudio.Shell.TaskProvider testTaskProvider;
    testTaskProvider = new Microsoft.VisualStudio.Shell.TaskProvider(this.Site);
    Microsoft.VisualStudio.Shell.Task testTask = new Microsoft.VisualStudio.Shell.Task();
    testTask.Text = "Test";
     testTask.Category = Microsoft.VisualStudio.Shell.TaskCategory.Comments;
     testTask.IsTextEditable = false;
    testTask.Document = req.FileName;
    testTask.Line = 1;
    testTask.Navigate += delegate(Object sender, EventArgs e)
    {
     testTaskProvider.Navigate((Microsoft.VisualStudio.Shell.Task)sender, VSConstants.LOGVIEWID_TextView);
    };
    testTaskProvider.Tasks.Add(testTask);

    This will create a dumb comment task that should be at line 1. However, when you'll open an *.myc file, you'll notice that the task is displayed at line 2 in the tasklist. Further more, when you'll double click on the task, it will work as expected and bring you to line 1. Since this dummy task is hardcoded to line one, maybe it will crash if you open an empty file so just pay attention.

    I'll try to post a bug repport about it later today.

    Francois
    Monday, August 4, 2008 6:42 PM