Skip to content

small syntax fixes #930

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

Merged
merged 1 commit into from
Jul 12, 2016
Merged

small syntax fixes #930

merged 1 commit into from
Jul 12, 2016

Conversation

datanoise
Copy link
Contributor

Fixed issues reported by @svanharmelen in comments of pull request #917.

  • do not highlight method receiver if g:go_highlight_types is not set
  • fixed highlighting of anonymous functions

- do not highlight method receiver if g:go_highlight_types is not set
- fixed highlighting of anonymous functions
@svanharmelen
Copy link
Contributor

svanharmelen commented Jul 7, 2016

FYI (from the Gophers #vim slack channel):

image

@fatih
Copy link
Owner

fatih commented Jul 7, 2016

@datanoise would you mind to check the comment from @svanharmelen?

I’m on travel this weekend, and next week I’ll be in Gophercon. I’m preparing myself for the vim-go session. So the issues are on hold till next weekend. Thanks for all the feedback and fixes!

@datanoise
Copy link
Contributor Author

This two examples are quite different. My changes added highlighting of the method's receiver types. For example, in the following Status method

func (reqCtx *requestContext) Status() int {

requestContext is the type of the receiver.

In this example, we have a plain go function NewRequest (not a method)

func NewRequest(ctx *Options) RequestContext {

and ctx *Options are parameters to this function. I don't think go syntax ever provided highlighting for function parameters. Something that we should consider adding in the future I guess.

I'm traveling until the next week. If someone can look at this problem and send a PR, it would be nice.

@svanharmelen
Copy link
Contributor

@datanoise the go syntax highlighting from before #917 did highlight this properly, so IMHO it's "bug" introduced in #917

I reverted vim-go to a commit before #917 for the time being, guess my eyes are overly sensitive to changes 😉

@datanoise
Copy link
Contributor Author

@svanharmelen maybe I misunderstand the bug report. Which part is highlighted properly before #917?

Are we talking about Option type in

func NewRequest(ctx *Options) RequestContext {

@svanharmelen
Copy link
Contributor

Yes, have a look at how it highlights the pointer sign before #917:

image

@datanoise
Copy link
Contributor Author

datanoise commented Jul 7, 2016

I'm maybe missing something, but in this particular case the pointer sign is highlighted properly even with this pull request or #917 (assuming you have let g:go_highlight_operators = 1). The syntax name of the pointer sign is detected as goOperator. My patches should not touch the syntax of function parameters.

@svanharmelen
Copy link
Contributor

Hmm... I guess I am the one missing something 😞 I forwarded this from the slack channel, without verifying it myself... I'll point your conclusions out to the guy posting this. If he want to follow up or explain it in more detail himself he should. Otherwise I guess I have to apologize myself for causing this noise....

@neumachen
Copy link
Contributor

Wait, so it shouldn't be highlighted?

@svanharmelen
Copy link
Contributor

It should... And it does (at least with this patch) in both cases (receiver and func param).

@neumachen
Copy link
Contributor

Still nothing, perhaps it's because of the colorscheme I use gruvbox

@datanoise
Copy link
Contributor Author

gruvbix doesn't highlight Operator syntax. Try something like :hi! link Operator String

@fatih fatih merged commit 7fe846b into fatih:master Jul 12, 2016
@fatih
Copy link
Owner

fatih commented Jul 12, 2016

Thanks @datanoise 👍

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

Successfully merging this pull request may close these issues.

4 participants