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

Added condition to handle .go files detected as Go language type #2

Merged
merged 1 commit into from Feb 7, 2017

Conversation

jmoscato
Copy link
Contributor

@jmoscato jmoscato commented Feb 6, 2017

Brackets version:
Release 1.8 experimental build 1.8.0-17108 (alf_localization_release_1.8 3af64fae4)
build timestamp: Wed Nov 09 2016 02:47:52 GMT+0000

bokub/brackets-gofmt version:
1.2.0

Description:
When I open a .go file, Brackets detects the language type as "Go", not "Golang". When I attempt to format the .go file with the gofmt extension the following error dialog pops up:

Go Formatter error

The current file is a Go file.
Go Formatter can format Go files only.

Proposed change:
I added another condition to handle the document language name Go in addition to Golang in main.js on line 139.

@bokub
Copy link
Owner

bokub commented Feb 6, 2017

How did your brackets detect the file type ?

I am personally using Golang Syntax for brackets, and this is what the bottom right corner looks like:

image

@jmoscato
Copy link
Contributor Author

jmoscato commented Feb 6, 2017

Hi @bokub , thanks for looking at my request.

I'm using the Go-Syntax extension. It happens to be the first search result in the Extension Manager when I start typing 'go' in the search box. Here is how my bottom right corner looks:

image

Do you think it makes sense to add another case for 'Go' language type in addition to 'Golang' as your syntax extension detected? The names seem to be used interchangeably online.

@bokub
Copy link
Owner

bokub commented Feb 7, 2017

Well, I just tried another extension that said go-lang, so I guess there are a lot of possibilities.

I'll merge your pull request as a temporary fix, but what needs to be done is a check on the file extension, not a check on which filetype is detected by brackets.

Thanks for your contribution @jmoscato, and don't hesitate to do that again !
👍

@bokub bokub merged commit e04c277 into bokub:master Feb 7, 2017
@bokub
Copy link
Owner

bokub commented Feb 7, 2017

Hi again @jmoscato,
I just edited the code so it checks the file extension instead of the language name.

The extension has been updated to version 1.2.1 in the registry, so you can upgrade right now.

@jmoscato
Copy link
Contributor Author

jmoscato commented Feb 9, 2017

Hi @bokub ,
I tried your latest update and it works great! And I like your solution; I didn't realize there was so much variety among the other extensions.

Thanks again for taking care of this so quickly! 👍

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.

None yet

2 participants