OmniSharp / OmniSharp/csharp-language-server-protocol

Issue trying to implement codeAction/resolve in omnisharp-roslyn

Open
#511 1 comment 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

I am sure I am missing something (maybe I just don't understand dynamic registration) but I am not able to implement codeAction/resolve in omnisharp-roslyn.

The first thing that makes me confused is why omnisharp-roslyn reports no codeActionProvider as response to initialize, as evidenced by this log:

[Trace - 01:25:24 PM] Received response 'initialize - (19)' in 768ms.
Result: {
  "serverInfo": {
    "version": "1.0.0+c802f8ea91d8ab24d07564c917d0bab8326b3f71",
    "name": "OmniSharp"
  },
  "capabilities": {
    "workspace": {
      "fileOperations": {
      },
      "workspaceFolders": {
        "changeNotifications": true,
        "supported": true
      }
    },
    "implementationProvider": {
    },
    "experimental": {
    },
    "executeCommandProvider": {
      "commands": [
        "omnisharp/executeCodeAction",
        "omnisharp/executeCodeAction"
      ]
    },
    "documentOnTypeFormattingProvider": {
      "moreTriggerCharacter": [
        "}",
        ")"
      ],
      "firstTriggerCharacter": ";"
    },
    "codeLensProvider": {
      "resolveProvider": true
    },
    "workspaceSymbolProvider": {
    },
    "documentSymbolProvider": {
    },
    "referencesProvider": {
    },
    "definitionProvider": {
    },
    "signatureHelpProvider": {
      "triggerCharacters": [
        ".",
        "?",
        "["
      ]
    },
    "completionProvider": {
      "triggerCharacters": [
        "."
      ]
    },
    "hoverProvider": {
    },
    "textDocumentSync": {
      "save": {
        "includeText": true
      },
      "change": 1,
      "openClose": true
    }
  }

Then I tried to implement codeAction/resolve support here:

  • https://github.com/razzmatazz/omnisharp-roslyn/commit/04ed94b43198d24c72fa58e66154c247e6e02cbe

But I really not sure if I am dabbling in the right direction, do we really need separate OmniSharpCodeActionResolveHandler or not -- and can I use data on CodeAction? -- it seems to be serialized properly though so I assume it is.

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 with the initialize response in the issue and the linked commit 04ed94b43198d24c72fa58e66154c247e6e02cbe. Inspect how codeActionProvider, CodeAction data, and codeAction/resolve are represented, then verify that the server advertises the capability and handles resolution correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Feature
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.