Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Records break syntax highlighting #2048

Closed
333fred opened this issue Dec 22, 2020 · 3 comments · Fixed by #2049
Closed

Records break syntax highlighting #2048

333fred opened this issue Dec 22, 2020 · 3 comments · Fixed by #2049

Comments

@333fred
Copy link
Contributor

333fred commented Dec 22, 2020

System.Collections.Generic.KeyNotFoundException: The given key 'record name' was not present in the dictionary.\
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 \
  at OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.CreateSemanticSpan (System.Collections.Generic.IEnumerable`1[T] results, Microsoft.CodeAnalysis.Text.TextLineCollection lines) [0x000db] in <88f2819c12ee464e94d6700e849310cf>:0 \
  at OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService+<>c.<Handle>b__1_2 (System.Linq.IGrouping`2[TKey,TElement] grouping) [0x0000c] in <88f2819c12ee464e94d6700e849310cf>:0 \
  at System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].ToArray () [0x0001d] in <9ba54d07696a449db4a4279fc05aa435>:0 \
  at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <9ba54d07696a449db4a4279fc05aa435>:0 \
  at OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.Handle (OmniSharp.Models.SemanticHighlight.SemanticHighlightRequest request) [0x002fa] in <88f2819c12ee464e94d6700e849310cf>:0 \
  at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler`2[TRequest,TResponse][] handlers, TRequest request) [0x00099] in <954ed0cf974c4f038a543c1ed1dfaa98>:0 \
  at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in <954ed0cf974c4f038a543c1ed1dfaa98>:0 \
  at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in <954ed0cf974c4f038a543c1ed1dfaa98>:0 \
  at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000e7] in <60d68949688146858c57cddcbc6c56f5>:0

When a record is used as a variable or a type declaration. Looks like the semantic highlight service needs to be updated.

@timohermans
Copy link

Is this available in the c# extension 1.23.8? I'm still not seeing any syntax highlighting on a record inside a class

image

@333fred
Copy link
Contributor Author

333fred commented Jan 11, 2021

You need to set your omnisharp path to latest.

@timohermans
Copy link

Thanks, that did the trick :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants