Ⅰ. 插件描述
HTTP wrapper around NRefactory allowing C# editor plugins to be written in any language.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'nosami/omnisharpserver'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'nosami/omnisharpserver'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'nosami/omnisharpserver'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/nosami/omnisharpserver
Ⅳ. 文档说明
#Notice
This project is being replaced with OmniSharp Roslyn. I'll still accept PRs for this project, but please note that all development has stopped here.
OmniSharpServer
HTTP wrapper around [NRefactory] (https://github.com/icsharpcode/NRefactory) allowing C# editor plugins to be written for any editor in any language.
This is the server component for the Vim OmniSharp plugin, YouCompleteMe, Sublime Text 2, Sublime Text 3, Emacs OmniSharp plugin and Atom plugin
Build
OSX / Linux
Requires a minimum of Mono 3.0.12 - If you absolutely must use mono 2.10 then checkout the mono-2.10.8 tag. Updating mono on ubuntu. If you are using OSX, please use the official version of Mono as the homebrew version has known issues.
git clone https://github.com/OmniSharp/omnisharp-server.git
cd omnisharp-server
git submodule update --init --recursive
xbuildWindows
git clone https://github.com/OmniSharp/omnisharp-server.git
cd omnisharp-server
git submodule update --init --recursive
# (if using Cygwin, overwrite the default config file config.json with config-cygwin.json)
copy OmniSharp\config-cygwin.json OmniSharp\config.json
msbuildTo start the Omnisharp server manually (The Vim OmniSharp client and YouCompleteMe may start this for you automatically):
Use the current working directory
- If one solution file is found, use it. Otherwise start in folder mode.
[mono] OmniSharp.exe- To specify a solution file / project files
[mono] OmniSharp.exe -s (path\to\sln)- Without a solution file (OmniSharp will parse all C# files it finds and add references to every dll it finds)
[mono] OmniSharp.exe -s pathProblems (or just want to see what's going on)?
Try adding an extra -v Verbose to the end of the command line. You should see something like the following.
************ Request ************
POST - /autocomplete
************ Headers ************
Accept-Encoding - identity
Content-Length - 378
Host - localhost:2000
Content-Type - application/x-www-form-urlencoded
Connection - close
User-Agent - Python-urllib/2.7
************ Body ************
column=22&filename=/Users/jason/.vim/bundle/Omnisharp/server/OmniSharp/Logger.cs&buffer=using System;
namespace OmniSharp
{
class Test
{
public Test()
{
Console.B
}
}
}&WantDocumentationForEveryCompletionResult=False&line=9&wordToComplete=B
Looking for project containing file /Users/jason/.vim/bundle/Omnisharp/server/OmniSharp/Logger.cs
/Users/jason/.vim/bundle/Omnisharp/server/OmniSharp/Logger.cs belongs to /Users/jason/.vim/bundle/Omnisharp/server/OmniSharp/OmniSharp.csproj
Looking for project containing file /Users/jason/.vim/bundle/Omnisharp/server/OmniSharp/Logger.cs
/Users/jason/.vim/bundle/Omnisharp/server/OmniSharp/Logger.cs belongs to /Users/jason/.vim/bundle/Omnisharp/server/OmniSharp/OmniSharp.csproj
Getting Completion Data
Got Completion Data
************ Response ************
[{"CompletionText":"BackgroundColor","Description":"ConsoleColor BackgroundColor { get; set; }","DisplayText":"ConsoleColor BackgroundColor"},{"CompletionText":"Beep(","Description":"void Beep(int frequency, int duration);","DisplayText":"void Beep(int frequency, int duration)"},{"CompletionText":"Beep()","Description":"void Beep();","DisplayText":"void Beep()"},{"CompletionText":"BufferHeight","Description":"int BufferHeight { get; set; }","DisplayText":"int BufferHeight"},{"CompletionText":"BufferWidth","Description":"int BufferWidth { get; set; }","DisplayText":"int BufferWidth"},{"CompletionText":"CursorVisible","Description":"bool CursorVisible { get; set; }","DisplayText":"bool CursorVisible"},{"CompletionText":"KeyAvailable","Description":"bool KeyAvailable { get; }","DisplayText":"bool KeyAvailable"},{"CompletionText":"MoveBufferArea(","Description":"void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop);","DisplayText":"void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop)"},{"CompletionText":"MoveBufferArea(","Description":"void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor);","DisplayText":"void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)"},{"CompletionText":"NumberLock","Description":"bool NumberLock { get; }","DisplayText":"bool NumberLock"},{"CompletionText":"SetBufferSize(","Description":"void SetBufferSize(int width, int height);","DisplayText":"void SetBufferSize(int width, int height)"}]
/autocomplete 7ms