0

I use VS Code. As far as I can tell my code syntax set by my theme is getting overridden by c# extension.

When I turn the extension off it looks normal but when I turn it on it gets overridden.

In the extension settings, there is a setting to c# semantic highlighting that I have turned off since it didn't help much. In VS Code settings, the semantic highlighting is set to 'configureByTheme'.

Here's how I want it to look, and how it looks when the extension is disabled:

enter image description here

using5 chars
language    csharp
standard token type Other
foreground  #009C8F
background  #E1F4F4
contrast ratio  3.00
textmate scopes keyword.other.using.cs
source.cs
foreground  keyword.other
{ "foreground": "#009C8F" }

How it looks when the extension is enabled and how I don't want it to look:

enter image description here

using5 chars
language    csharp
standard token type Other
foreground  #D0A00F
background  #E1F4F4
contrast ratio  2.12
semantic token type keyword
foreground  keyword.control
keyword.package.go
keyword.operator.pointer.go
keyword.control
keyword.control.conditional
storage.modifier
keyword.operator.new
keyword.operator.expression
keyword.begin.blade
keyword.end.blade
keyword.blade
keyword.type-alias
keyword.type
support.class.console
keyword.other.await
storage.type.class.jsdoc
punctuation.definition.block.tag.jsdoc
keyword.other.new
keyword.other.phpdoc
keyword.other.use.php
keyword.operator.logical.python
keyword.other.import.static.groovy
keyword.other.import.groovy
punctuation.definition.attribute.swift
source.svelte meta.scope.tag.main.svelte meta.tag.start.svelte variable.function.svelte
meta.directive.on.svelte entity.name.type.svelte
keyword.other.special-method.elixir
keyword.edge
entity.name.function.edge
support.constant.edge
keyword.other.gdscript
keyword.other.onready.gdscript
source.graphql meta.fragment.graphql keyword.on.graphql
source.graphql meta.type.interface.graphql keyword.implements.graphql
source.graphql meta.type.interface.graphql meta.type.object.graphql meta.type.list.graphql keyword.operator.nulltype.graphql
source.graphql meta.variables.graphql keyword.operator.nulltype.graphql
source.graphql meta.type.interface.graphql meta.type.object.graphql keyword.operator.nulltype.graphql
keyword.operator.class.php
keyword.operator.spread.php
keyword.operator.type.php
keyword.operator.increment-decrement.php
keyword.operator.increment-increment.php
punctuation.support.type.property-name.begin.json
punctuation.support.type.property-name.end.json
keyword.operator.string.php
keyword.operator.ternary.php
keyword.operator.variadic.php
keyword.operator.nullable-type.php
keyword.other.use-as.php
keyword.import.go
keyword.operator.address.go
keyword.operator.null-coalescing
keyword.operator.arrow
keyword.struct.go
keyword.operator.liquid
keyword.operator.optional.ts
keyword.cmake
{ "foreground": "#d0a00f" }
textmate scopes keyword.other.using.cs
source.cs
foreground  keyword.other
{ "foreground": "#009C8F" }

Here is the extension I have been mentioning: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp.

rioV8
  • 24,506
  • 3
  • 32
  • 49
Bruno.
  • 37
  • 4
  • That worked! Thanks for the help! I did turn it off in the settings of the extension. but apparently, the VS Code settings had to be set too. Sorry for the trouble. – Bruno. Aug 04 '23 at 18:30
  • not sure, but you might want to read this: https://stackoverflow.com/q/76850403/11107541 – starball Aug 07 '23 at 09:32

1 Answers1

1

You say you turned semantic highlighting off, but then next say that it is set to "configuredByTheme"? Try the following in your settings.json file:

"csharp.semanticHighlighting.enabled": false, // I'm not sure if this line is actually necessary
"editor.semanticHighlighting.enabled": false,
starball
  • 20,030
  • 7
  • 43
  • 238
  • That worked! Thanks for the help! I did turn it off in the settings of the extension. but apparently, the VS Code settings had to be set too. Sorry for the trouble – Bruno. Aug 04 '23 at 18:36