microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.53k stars 676 forks source link

Custom task list token in Visual Studio 2022 doesn't work for Python. #7151

Closed vsfeedback closed 1 year ago

vsfeedback commented 2 years ago

This issue has been moved from a ticket on Developer Community.


Hi Team,

I found that my custom task list tokens don't work in VS 2022 for Python(But it works in VS 2019).

Steps to reproduce:

  1. Open VS 2022, create a Python project.
  2. In Tools > Options > Environment > Task List > input a new name for example "Test1" > click Add to add this custom task list token.
  3. In .py file > input some comments for example "#Test1: this is a test" > save the project.
  4. Click View > Task List.
  5. In Task List window, the Test1 task list token doesn't appear.

You can test in C# projects, or in VS 2019 Python projects, they should work well.

If it's a potential issue, please fix it.

Thanks


Original Comments

Feedback Bot on 8/29/2022, 02:23 AM:

(private comment, text removed)


Original Solutions

(no solutions)

K-E-K commented 2 years ago

I am having the same problem but with even the default TODO tag, though it's working normally in VS 2019.

kue43 commented 2 years ago

Visual Studio 2022 task list not working at all for Python

AdamYoblick commented 1 year ago

More info via internal email (this is for people working on the bug, not the public)

LSP support for Task List is done via diagnostics. If you add the TaskItem tag to your diagnostic, they should be shown in Task List instead of Error List.

janestebans commented 1 year ago

C++, not working for me either. I have the Options->TextEditor->C/C++->View->Enumerate Comment Tasks = true. Tried switching it off and on and restarte VS, did not work. It is wierd because it shows the comments from boost library files but not mine. Adding a new task list token does not work either.

Thanks.

EDIT: Opening the project with VS 2019, setting the option Enumerate Comment tasks to false, then true again. Closing and reopening it with VS 2022 fixed it.

EDIT 2: Updating Visual Studio to 17.4.1 has solved the problem. No need to restart toggling the EnumerateComment task option as previous edit workaround.

AdamYoblick commented 1 year ago

Thanks for the additional info. I was going to say that the C++ language server is different from the python one, but it sounds like you found a workaround 😄

On the python side, I'm have a proof of concept working for the task list. I needed to add a feature to pylance (the language server). Now I just need to flesh it out.

K-E-K commented 1 year ago

I have upgraded to : Version 17.4.1 (Microsoft Visual Studio Professional 2022 ) and the task list is still not working at all for Python.

AdamYoblick commented 1 year ago

Yep, I'm still working on this. I get pulled into infra work and other higher priority tasks often so my work gets interrupted. I'm hoping to complete the work this week if all goes well. I'll update this issue when the fix is in.

K-E-K commented 1 year ago

Ok glad to hear that. Thank you for keeping us updated.

AdamYoblick commented 1 year ago

This is now working for me locally, I'll reply when I know what version of Visual Studio this will be released in.

pbarranis commented 1 year ago

@AdamYoblick I have found some different but similar issues with the Task List since upgrading to 17.4. I'll describe briefly - you tell me if this is close enough to the issues you are fixing that it does or doesn't warrant opening a separate ticket, please.

I have two solutions I work on routinely, both primarily C# with some TS/HTML/SASS. In one solution, the Task List went totally blank after upgrading. Now that I'm looking more closely, I see that even the column headings aren't visible.

Tools -> Options -> Environment -> Task List shows my usual, heavily-customized list, and there should be dozens of entries in the Task List at varying priorities.

In the other solution, all of my task list items show up. However, all the items that should be high & low priority show up as normal priority, and all the items that should be normal priority show up as low priority.

Per a post on SO for whom this worked, I tried doing a Repair on VS through the Installer. Unfortunately, no joy.

TIA. I can open a new ticket if needed. Excited to have this potentially fixed soon, as obviously I'm a bit of a Task List power user.

randsu commented 1 year ago

Task List for Visual Studio Professional 2022 (64 bit) version 17.4.3 does not pick up // TODO in code.

AdamYoblick commented 1 year ago

@AdamYoblick Adam Yoblick FTE I have found some different but similar issues with the Task List since upgrading to 17.4. I'll describe briefly - you tell me if this is close enough to the issues you are fixing that it does or doesn't warrant opening a separate ticket, please.

I have two solutions I work on routinely, both primarily C# with some TS/HTML/SASS. In one solution, the Task List went totally blank after upgrading. Now that I'm looking more closely, I see that even the column headings aren't visible.

Tools -> Options -> Environment -> Task List shows my usual, heavily-customized list, and there should be dozens of entries in the Task List at varying priorities.

In the other solution, all of my task list items show up. However, all the items that should be high & low priority show up as normal priority, and all the items that should be normal priority show up as low priority.

Per a post on SO for whom this worked, I tried doing a Repair on VS through the Installer. Unfortunately, no joy.

TIA. I can open a new ticket if needed. Excited to have this potentially fixed soon, as obviously I'm a bit of a Task List power user.

Sorry for the delay, I've been on vacation for the past month. Task list diagnostics are handled by each language team's language server, so any fixes I make to the python one won't trickle down to the other languages. I will reach out to the visual studio team to see if they can re-route this request for the other languages as well.

For python, my changes are in code review and will be committed in the next day or so. But it will take time to make it into a visual studio release. I'll reply back once I know what version it will be in.

AbhimanyuVS commented 1 year ago

Hello,

I have tried all of the different solutions listed in this thread, but I am still unable to see any tasks (specified by either custom or default tokens) in VS2022. It works in VS2019, for Python, C++, and C#. However, it does not work in VS2022, for any language.

For reference, I posted a bug report about this here: https://developercommunity.visualstudio.com/t/Task-list-is-not-working-in-VS2022/10192598

This was then piped here: https://github.com/microsoft/PTVS/issues/7254

That was then closed citing this thread as a duplicate.

I look forward to a solution to this problem, as both VS2022 and the task list are very nice.

Thank you.

smimon commented 1 year ago

I have been experiencing blank task list in VS 2022 with C# for months.

Doing a full repair fixes them temporarily - close down and re-open the solution a few times, they all disappear again.

Although internally to the MS team working on this, this may not be considered high priority, this is a fairly critical piece of productivity for a lot of developers, so may we please request that this is flagged as such and escalated for a quicker fix across all languages?

AdamYoblick commented 1 year ago

This is working locally with changes to both pylance and the VS Editor:

image

I still need to go through the VS PR process, etc, but good progress 😄

AdamYoblick commented 1 year ago

Note that task list work with just pylance changes, but priority requires VS changes. I'm going to get the task list PR in ASAP, then work on getting https://github.com/microsoft/PTVS/issues/7300 in.

AdamYoblick commented 1 year ago

This has been merged in and will be in the next release public release of VS 2022.

AbhimanyuVS commented 1 year ago

@AdamYoblick

I installed update 17.4.5, but I still cannot see the task list in Python projects. Will this issue be addressed in another update? Sorry if I misunderstood your last comment.

EDIT: I tested out different project types, and I noticed something curious. In Python and C++ projects, the task list does not have any task in it. In C# projects, the task list has all tasks, but the priorities of all tasks are normal, except for the default "TODO" task, which has a low priority. This is despite the fact that you cannot actually change the priority of the "TODO" task in the options. Not sure if these are related, but I just wanted to bring them to someone's attention without needing to make a new ticket on the Developer Community site.

AdamYoblick commented 1 year ago

@AbhimanyuVS This change just got merged into pylance, but there's a sequence of releases that have to happen first. Unfortunately, that means we can't just release bugfixes whenever we want.

Pylance has to release first, which happens once per week. Once there's a new version of pylance, PTVS can consume it and PTVS can insert into Visual Studio. Then Visual Studio needs to release. The GA (general availability) release of Visual Studio 2022 17.6 should be in the middle of May, 2023.

I know that's not what you wanted to hear, but since we insert into Visual Studio, we release with them as well. 😄

AbhimanyuVS commented 1 year ago

@AdamYoblick

Understood, not a problem. Now that I know the ETA, I am alright with waiting for it. Thank you for your work on the same; I look forward to receiving the fix in May.

Since this is closed, should I create separate tickets for (a) the task list not working for C++ and (b) the task list behaving strangely with C#?

AdamYoblick commented 1 year ago

@AbhimanyuVS I tested C# myself and it works for me locally, which means it will be fixed in the next release as well. But if you want to create a new issue, you definitely can. C# development is done at https://github.com/dotnet/roslyn

I'm not sure about C++ though. I think you'd need to create a feedback ticket through Visual Studio and it will get routed to the correct team as long as you specify C++ in the title. 😄

AbhimanyuVS commented 1 year ago

@AdamYoblick

Good to know that the task list will work with C#. Thank you for pointing me to the roslyn repo.

I will put in a new ticket for the task list in C++.

Thank you for your time and consideration.

CaligoLab commented 12 months ago

Just for the record: VS Version 17.4.4 (Win x64) up to date. This is my first try at creating tasks (Python) Neither TODO, nor custom markers are picked up - the task list is empty.