Skip to content

Commit

Permalink
feat(nvim): add c# support
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyvin committed Apr 21, 2023
1 parent a30a775 commit 4d269ac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nvim/.config/nvim/lua/tobyvin/lsp/configs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ local M = {
},
},
},
omnisharp = {
-- cmd = { "dotnet", "/home/tobyv/.local/share/nvim/mason/packages/omnisharp/OmniSharp.dll" },
cmd = { "omnisharp", "--languageserver", "--hostPID", tostring(vim.fn.getpid()) },
on_attach = function(client)
-- HACK: https://github.com/OmniSharp/omnisharp-roslyn/issues/2483
local tokenModifiers = client.server_capabilities.semanticTokensProvider.legend.tokenModifiers
for i, v in ipairs(tokenModifiers) do
tokenModifiers[i] = v:gsub(" ", "_"):gsub("-_", "")
end

local tokenTypes = client.server_capabilities.semanticTokensProvider.legend.tokenTypes
for i, v in ipairs(tokenTypes) do
tokenTypes[i] = v:gsub(" ", "_"):gsub("-_", "")
end
end,
},
lua_ls = {
settings = {
Lua = {
Expand Down
1 change: 1 addition & 0 deletions nvim/.config/nvim/lua/tobyvin/plugins/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function M.config()
"c",
"cmake",
"cpp",
"c_sharp",
"css",
"diff",
"gitignore",
Expand Down
1 change: 1 addition & 0 deletions sh/.config/profile.d/20-dotnet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

export OMNISHARPHOME="$XDG_CONFIG_HOME/omnisharp"
export DOTNET_CLI_HOME="$XDG_DATA_HOME/dotnet"
export PATH="$PATH:$DOTNET_CLI_HOME/tools"

0 comments on commit 4d269ac

Please sign in to comment.