OmniSharp / OmniSharp/csharp-language-server-protocol

CodeActions on visual studio

Open
#552 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
638
Forks
109
Avg merge
1m
Merged PRs (30d)
2

Description

Hi,

Thank you for the great library. I had a question about CodeActions and how they work with Visual Studio (not VS Code). We are seeing a weird behavior and wondering if there's something we're missing.

The scenario is simple. Using the ITextDocumentSyncHandler, we are publishing diagnostics with the below properties:
Range, Message, Severity, RelatedInfo, Source, Code, and CodeDescription.

And using the ICodeActionHandler, we are returning a codeAction with the below properties:
Title, Edit, Diagnostics, IsPreferred

The weird behavior is that the codeAction will display with no issues, as long as there are no diagnostics that we published. It doesn't display for any range where there is a diagnostic (again, that we created). For other diagnostics, there are no issues.

I have tried multiple combinations of the properties above and seem to always get this behavior. Have you seen this issue before? Let me know.

Thanks again for building this awesome library!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Visual Studio behavior described with ITextDocumentSyncHandler diagnostics and ICodeActionHandler responses, focusing on actions associated with diagnostic ranges. Compare the listed diagnostic and code action properties with cases where actions display; done means code actions appear for ranges containing published diagnostics, with a confirmed explanation or fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.