c#开发的小项目准备扔给我,提前把基础语法过一遍
1,安装sdk:https://dotnet.microsoft.com/zh-cn/download
2,在sublime安装Omnisharp
3,安装msbuild(否则omnisharp报错:Error talking to http://localhost:60375/checkreadystatus)
4,在sublime安装LSP-Omnisharp(前提已安装LSP)
5,新建编译系统c#:
{
“cmd”: [“dotnet”, “run”, “–project”, “$file_path”],
“working_dir”: “$file_path”,
“selector”: “source.cs”,
“shell”: true,
“encoding”: “utf-8”,
“variants”: [
{
“name”: “Run”,
“cmd”: [“dotnet”, “run”, “–project”, “$file_path”]
}
]
}
6,在lsp-setting配置:
// Settings in here override those in “LSP/LSP.sublime-settings”
{
“clients”: {
“pylsp”: {
“enabled”: true,
“command”: [“pylsp”],
“selector”: “source.python”,
“settings”: {
“pylsp.plugins.jedi_completion.enabled”: true,
“pylsp.plugins.jedi_completion.include_params”: true,
“pylsp.plugins.pylsp_mypy.enabled”: true,
“pylsp.plugins.flake8.enabled”: true,
“pylsp.plugins.pylsp_black.enabled”: false,
“pylsp.plugins.pylsp_isort.enabled”: false
}
},
“omnisharp”: {
“enabled”: true,
“command”: [“dotnet”, “C:/Users/Administrator/AppData/Local/Sublime Text/Package Storage/LSP-OmniSharp/OmniSharp.dll”],
“args”: [“–hostPID”, “${pid}”, “–hostIpc”, “pipes”, “–threads”, “1”],
“selector”: “source.cs”,
“settings”: {
“DotNetPath”: {
“Path”: “C:\Program Files\dotnet\dotnet.exe”
},
“RoslynExtensionsOptions”: {
“EnableEditorConfigSupport”: true,
“LocationPaths”: []
},
“FormattingOptions”: {
“EnableEditorConfigForFormatting”: true
},
“OmniSharp”: {
“UseGlobalMono”: “never”,
“RoslynServerPort”: “60777”,
“SdkVersion”: “8.0.414” // 替换为您的 dotnet –version 输出
}
}
}
}
}