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

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

Closed
irisida opened this issue Nov 15, 2020 · 13 comments
Closed

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

irisida opened this issue Nov 15, 2020 · 13 comments
Labels

Comments

@irisida
Copy link

irisida commented Nov 15, 2020

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 irisida added the bug label Nov 15, 2020
@Binaryify
Copy link
Owner

Binaryify commented Nov 15, 2020

could you provide the code on your screenshot?

@irisida
Copy link
Author

irisida commented Nov 15, 2020

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)
}

@tristan957
Copy link

Hi @irisida and @Binaryify,

I am coming from jeff-hykin/better-go-syntax#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.

@Binaryify
Copy link
Owner

@tristan957 thank for the feedback

@irisida you could follow this issue jeff-hykin/better-go-syntax#15

@irisida
Copy link
Author

irisida commented Nov 16, 2020

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.

@Binaryify
Copy link
Owner

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

@Binaryify
Copy link
Owner

Binaryify commented Nov 16, 2020

is this right?
image
@irisida

@irisida
Copy link
Author

irisida commented Nov 16, 2020

@Binaryify yes, that's the one.

@Binaryify
Copy link
Owner

just released a new version,you can check it now

@irisida
Copy link
Author

irisida commented Nov 16, 2020

Got it. Thank you! much appreciated.

Screenshot 2020-11-16 at 11 02 00

@irisida
Copy link
Author

irisida commented Nov 16, 2020

moving to close issue

@irisida irisida closed this as completed Nov 16, 2020
@irisida
Copy link
Author

irisida commented Nov 16, 2020

resolved. Many thanks. Corrected on 3.9.6

@tristan957
Copy link

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

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

No branches or pull requests

3 participants