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

query: alternative syntax definitions break GoSublime? #866

Open
kortschak opened this Issue Sep 28, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@kortschak
Contributor

kortschak commented Sep 28, 2018

I am trying out using semantic syntax highlighting. In order to do this in a way that allows me to swap between this and normal Go syntax highlighting I have forked the GoSublime-Go-Legacy.sublime-syntax definition file to put it into a separate name space. (.sem.go instead of .go). The files are here.

With this I can change between "Go" syntax and "Go Semantic" syntax. However, when in sematic syntax highlighting, most of GoSublime/Go functionality goes away; no tab-completion, no fmt on save etc.

I suspect this is just part of how Sublime works, and is possibly offtopic for here, but thought I would ask. Is there a reason using this alternative syntax definition file is breaking the rest of the Go functionality?

@kortschak kortschak changed the title from query: alterntative syntax definitions break GoSublime? to query: alternative syntax definitions break GoSublime? Sep 28, 2018

@kortschak

This comment has been minimized.

Contributor

kortschak commented Sep 28, 2018

Looking more carefully, it appears that I need to be in source.go to get all the goodies, so I expect I'll just fork all those def files as well.

@DisposaBoy

This comment has been minimized.

Owner

DisposaBoy commented Sep 28, 2018

I can just add a special-case for source.sem.go. I will push a new release later today or tomorrow, but in the mean time you can change pattern for _scope_lang_pat in gosubl/margo_state.py#L348 to _scope_lang_pat = re.compile(r'(?:source\.\w+|source|text)[.]([^\s.]+)') and restart Sublime Text.

@kortschak

This comment has been minimized.

Contributor

kortschak commented Sep 28, 2018

That's great. Thank you.

@kortschak

This comment has been minimized.

Contributor

kortschak commented Oct 3, 2018

There appears to be a similar situation with CTRL+.CTRL+B (actually all the CTRL+.CTRL+X where X is a GoSublime key (e.g. P, N, T, etc).

@DisposaBoy

This comment has been minimized.

Owner

DisposaBoy commented Oct 4, 2018

#852 would probably help here... but there's so few of them (less than 10), so I don't mind just duplicating the bindings until I get around to auto-generation. Many of them need cleaning up anyway e.g. .h and .space don't work and others will become unrestricted like .d

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