Im using LazyVim on MacOs and have added the omnisharp lsp plugin:
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
omnisharp = {
handlers = {
["textDocument/definition"] = require("omnisharp_extended").definition_handler,
["textDocument/typeDefinition"] = require("omnisharp_extended").type_definition_handler,
["textDocument/references"] = require("omnisharp_extended").references_handler,
["textDocument/implementation"] = require("omnisharp_extended").implementation_handler,
},
keys = {
{
"gi",
function()
require("omnisharp_extended").telescope_lsp_definitions()
end,
desc = "Goto Definition",
},
{
"gd",
function()
require("omnisharp_extended").telescope_lsp_implementation()
end,
desc = "Goto Implementation",
},
},
enable_roslyn_analyzers = true,
organize_imports_on_format = true,
enable_import_completion = true,
},
},
},
}
The issue is the formatting, :LspInfo shows correct information about the LSP loaded. But ~/.omnisharp/omnisharp.json doesnt seem to effect.
Heres my omnisharp.json:
{
"RoslynExtensionsOptions": {
"enableDecompilationSupport": true
},
"FormattingOptions": {
"EnableEditorConfigSupport": false,
"TabSize": 4,
"InsertSpaces": true
"NewLinesForBracesInMethods": true,
"NewLinesForBracesInTypes": true,
"NewLinesForBracesInProperties": true,
"NewLinesForBracesInControlBlocks": true
},
"Logging": {
"LogLevel": {
"Default": "Debug"
}
}
}
I’ve also tried to add directly settings into omni-lsp.lua file but didnt work, the only thing i got to change my formatting was to add a .editorconfig into my project, but couldnt format accordinly to example with that.
Any suggestions?
The issue is basically that i want:
var response =
_service.MyCall()
.FirstOrDefault()
?? throw new CustomException("Ops!");
To be formatted like (like i had in VSCode):
var response = _service
.MyCall()
.FirstOrDefault() ?? throw new CustomException("Ops!");
or
var response = _service.MyCall()
.FirstOrDefault() ?? throw new CustomException("Ops!");
Oskar J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.