OmniSharp / omnisharp-sublime

C# IDE Plugin for Sublime Text 3
http://omnisharp-sublime.readthedocs.org/en/latest/
MIT License
551 stars 64 forks source link

Using Code Actions #248

Open virella2385 opened 6 years ago

virella2385 commented 6 years ago

I've been trying to use code actions in situations like creating an interface when the cursor is on a new interface name or creating a private variable declaration when highlighting a just type variable name (i.e. _conf) but nothing happens. I get the following message on the log:

======== request ======== 
 Url: http://localhost:58936/getcodeactions 
 Data: {"column": "32", "selectionStartLine": 15, "filename": "/Users/alakratt/Documents/github/DotnetCoreFundamentals/TestNetCoreWebApp/IGreeter.cs", "selectionEndColumn": 32, "selectionStartColumn": 32, "selectionEndLine": 15, "line": "15", "buffer": "using Microsoft.Extensions.Configuration;\n\nnamespace TestNetCoreWebApp\n{\n\t\n    public interface IGreeter\n    {\n        string GetMessageOfTheDay();\n    }\n\n    public class Greeter : IGreeter\n    {\n    \tprivate IConfiguration _conf;\n\n    \tpublic Greeter(IConfiguration conf)\n    \t{\n    \t\t_conf = conf;\n    \t}\n\n    \tpublic string GetMessageOfTheDay()\n    \t{\n    \t\treturn _conf[\"Greeting\"];\n    \t}\n    }\n}"}
======== response ======== 
 {"CodeActions":[]}
{'CodeActions': []}
codeactions is :
{'CodeActions': []}
======== end ========

Is it something I'm doing wrong or is this a bug?

virella2385 commented 6 years ago

Can anybody point me to the documentation where I can find more about configuring (if needed) code actions? I've checked the online docs but it makes zero references to code actions.

Rosalie241 commented 6 years ago

The code actions are handled by omnisharp-roslyn.