OneDark-Pro icon indicating copy to clipboard operation
OneDark-Pro copied to clipboard

Syntax colour highlighting a pointer to a pointer in Go(lang) is off.

Open irisida opened this issue 6 years ago • 13 comments

To me the syntax highlighting is buggy in Go when you have a pointer to a pointer. I would expect the double dereferencing operator to share the same syntax highlighting colour.

To Reproduce Steps to reproduce the behavior:

  1. install the extension
  2. create a pointer to a pointer (as per attachment)

Expected behavior Double dereferencing operator has unified syntax colour highlighting

Screenshots & Example Code Screenshot 2020-11-15 at 00 04 06

Desktop (please complete the following information):

  • OS: Mac [10.15.7]
  • VSCODE Version [1.51.1]
  • Theme version [3.9.3]

Additional context N/A

irisida avatar Nov 15 '20 00:11 irisida

could you provide the code on your screenshot?

Binaryify avatar Nov 15 '20 05:11 Binaryify

sure, apologies for not doing so initially.

package main

import "fmt"

func main() {

	p := fmt.Printf

	val := 100.0
	p1 := &val

	pp1 := &p1

	p("Type: %T Address: %p Value: %v\n", val, &val, val)
	p("Type: %T Address: %p Value: %v\n", p1, &p1, *p1)
	p("Type: %T Address: %p Value: %v\n", pp1, &pp1, *pp1)

	**pp1 = 500.

	p("Type: %T Address: %p Value: %v\n", val, &val, val)
	p("Type: %T Address: %p Value: %v\n", p1, &p1, *p1)
	p("Type: %T Address: %p Value: %v\n", pp1, &pp1, *pp1)
}

irisida avatar Nov 15 '20 15:11 irisida

Hi @irisida and @Binaryify,

I am coming from https://github.com/jeff-hykin/better-go-syntax/issues/15. I believe this is a syntax issue if you look at the Textmate scopes. That repo is the VSCode upstream syntax repo for Go I believe. I think the One Dark Pro theme is not doing anything wrong here, and is only responding to what the syntax is telling it.

tristan957 avatar Nov 16 '20 06:11 tristan957

@tristan957 thank for the feedback

@irisida you could follow this issue https://github.com/jeff-hykin/better-go-syntax/issues/15

Binaryify avatar Nov 16 '20 08:11 Binaryify

Thanks for your reply. However, just for context....

The same code on other "one dark" alike themes, (atom, vivid etc) all handle the syntax highlighting as would be expected. As does most other installed themes, radical, synthwave84 etc... Of about 8-10 installed themes one dark pro is the only one to highlight the syntax in this manner.

Not disagreeing with the issue you're highlighting of course.

irisida avatar Nov 16 '20 08:11 irisida

@irisida oh, I just check that, and it's indeed a bug

Binaryify avatar Nov 16 '20 09:11 Binaryify

is this right? image @irisida

Binaryify avatar Nov 16 '20 10:11 Binaryify

@Binaryify yes, that's the one.

irisida avatar Nov 16 '20 10:11 irisida

just released a new version,you can check it now

Binaryify avatar Nov 16 '20 10:11 Binaryify

Got it. Thank you! much appreciated.

Screenshot 2020-11-16 at 11 02 00

irisida avatar Nov 16 '20 11:11 irisida

moving to close issue

irisida avatar Nov 16 '20 11:11 irisida

resolved. Many thanks. Corrected on 3.9.6

irisida avatar Nov 16 '20 11:11 irisida

Oh good to know that's it's a bug in both places.

tristan957 avatar Nov 16 '20 14:11 tristan957