williamboman / mason-lspconfig.nvim

Extension to mason.nvim that makes it easier to use lspconfig with mason.nvim.
Apache License 2.0
2.68k stars 165 forks source link

Omnisharp Giving: E5248: Invalid character in group name #211

Closed EliSauder closed 1 year ago

EliSauder commented 1 year ago

Problem description

After installing the omnisharp from the :Mason page, I will get E5248: Invalid character in group name whenever I open a .cs file.

Why do you think this is an issue with mason-lspconfig.nvim?

The issue only shows up when I have installed omnisharp from Mason, I have also tried the omnisharp-vim plugin and I haven't gotten dhe same issue.

Also I see several of this in the LspLog:

    6 [WARN][2023-04-25 11:15:29] ...lsp/handlers.lua:537 "OmniSharp.Extensions.LanguageServer.Server.LspServerOutputFilter: Tried to send request or notification before initialization was completed and will be sent later OutgoingNotification ...

Neovim version (>= 0.7)

NVIM v0.9.0 Build Type: Release LuaJIT 2.1.0-beta3

Operating system/version

Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000

I've manually reviewed the Nvim LPS client log (:LspLog) to find potential errors

I've recently downloaded the latest plugin version of mason.nvim, mason-lspconfig.nvim, and nvim-lspconfig

Affected language servers

omnisharp

Steps to reproduce

  1. Install the omnisharp lsp
  2. Re-open nvim
  3. Open a .cs file
  4. Wait for LSP to start

Actual behavior

The LSP appears to work, but the E5248 error keeps poping up whenever I move around in the file.

Expected behavior

The E5248 should not show up and it should work normally.

LspInfo

Press q or <Esc> to close this window. Press <Tab> to view server doc.

 Language client log: /Users/esauder/.local/state/nvim/lsp.log
 Detected filetype:   cs

 1 client(s) attached to this buffer: 

 Client: omnisharp (id: 1, bufnr: [5])
    filetypes:       cs, vb
    autostart:       true
    root directory:  /Users/<UserName>/source/repos/<RepoName>
    cmd:             omnisharp -z -s /Users/esauder/source/repos/<RepoName> --hostPID 23775 DotNet:enablePackageRestore=false --encoding utf-8 --languageserver FormattingOptions:EnableEditorConfigSupport=true FormattingOptions:OrganizeImports=true RoslynExtensionsOptions:EnableImportCompletion=true Sdk:IncludePrereleases=true

 Configured servers list: yamlls, ghdl_ls, cssls, dockerls, clangd, tsserver, eslint, ltex, lua_ls, omnisharp, rust_analyzer, bashls, jsonls

LspLog

Yes, it says not to paste them, what should I do with them then?

Healthcheck

==============================================================================
mason: require("mason.health").check()

mason.nvim ~
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2023-04-25-open-goby` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
- OK wget: `GNU Wget 1.21.3 built on darwin22.1.0.`
- OK curl: `curl 7.87.0 (x86_64-apple-darwin22.0) libcurl/7.87.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.51.0`
- OK gzip: `Apple gzip 403.100.6`
- OK tar: `bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 `
- OK bash: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- WARNING Go: not available
  - ADVICE:
    - spawn: go failed with exit code - and signal -. go is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. composer is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- WARNING luarocks: not available
  - ADVICE:
    - spawn: luarocks failed with exit code - and signal -. luarocks is not executable
- OK Ruby: `ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]`
- OK cargo: `cargo 1.67.1 (8ecd4f20a 2023-01-10)`
- OK java: `openjdk version "20" 2023-03-21`
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
- OK RubyGem: `3.0.3.1`
- OK python3: `Python 3.11.3`
- OK javac: `javac 20`
- OK node: `v20.0.0`
- OK pip3: `pip 23.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)`
- OK npm: `9.6.4`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 5000. Limit: 5000. Reset: Tue Apr 25 12:38:43 2023.

Screenshots or recordings

image image
Minebomber commented 1 year ago

I'm having this issue as well when using omnisharp-mono after reinstalling NeoVim due to an unrelated issue. This could be related to omnisharp-roslyn/#2483. What's strange is that this was working about a month ago when I first installed omnisharp-mono, but after reinstalling I'm getting this issue.

williamboman commented 1 year ago

Semantic highlighting was somewhat recently added to neovim. Try

To opt-out of semantic highlighting with a server that supports it, you can delete the semanticTokensProvider table from the {server_capabilities} of your client in your |LspAttach| callback or your configuration's on_attach callback:

       client.server_capabilities.semanticTokensProvider = nil
Minebomber commented 1 year ago

Semantic highlighting was somewhat recently added to neovim. Try

To opt-out of semantic highlighting with a server that supports it, you can delete the semanticTokensProvider table from the {server_capabilities} of your client in your |LspAttach| callback or your configuration's on_attach callback:

       client.server_capabilities.semanticTokensProvider = nil

Thanks! That stopped the spam of E5248 errors.