DisposaBoy / GoSublime

A Golang plugin collection for SublimeText 3, providing code completion and other IDE-like features.
MIT License
3.42k stars 302 forks source link

*Not* using margo extension: Error: cannot find package "margo" in any of #891

Open xiaoke1989 opened 5 years ago

xiaoke1989 commented 5 years ago

Not using margo extension: Error: cannot find package "margo" in any of [16:12:05] margo: agent#007: log: go install -v -tags=margo margo.sh/cmd/margo.sublime [16:12:07] margo: agent#007: log: C:\go\bin\margo.sublime.exe -codec msgpack [16:12:09] margo: agent#007: log: store.go:137: started [16:12:11] margo: agent#007: log: restart.go:145: Mg/Restart: exit status 1 [16:12:11] margo: agent#007: log: go install -v -tags=margo margo.sh/cmd/margo.sublime [16:12:11] margo: agent#007: log: press ctrl+.,ctrl+x to configure margo or check console for errors [16:12:11] margo: agent#007: log: Not using margo extension: Error: cannot find package "margo" in any of: [16:12:11] margo: agent#007: log: C:\go\src\margo (from $GOROOT) [16:12:11] margo: agent#007: log: D:\Program Files (x86)\Sublime Text Build\Data\Packages\User\GoSublime\src\margo (from $GOPATH) [16:12:11] margo: agent#007: log: D:\Program Files (x86)\Sublime Text Build\Data\Packages\GoSublime\src\margo [16:12:11] margo: agent#007: log: agent GOPATH is D:\Program Files (x86)\Sublime Text Build\Data\Packages\User\GoSublime;D:\Program Files (x86)\Sublime Text Build\Data\Packages\GoSublime

My Golang.sublime.setting is like this : { "env": { "GOROOT":"C:\go", "GOBIN":"C:\go\bin", "GOPATH": "E:\go", "GOARCH":"amd64", "GOOS":"windows", "PATH":"%GOBIN%;%PATH%" }, "comp_lint_enabled": true,
"use_gs_gopath":true, "comp_lint_commands": [ {"cmd": ["go", "install"]} ],

"on_save": [
    {"cmd":"gs_comp_lint"}   
]

}

How to resolve this problem?

DisposaBoy commented 5 years ago

Did you follow the instructions and press ctrl+.,ctrl+x?

xiaoke1989 commented 5 years ago

Did you follow the instructions and press ctrl+.,ctrl+x?

My submine press ctrl+.,ctrl+x can't open a window

xiaoke1989 commented 5 years ago

Did you follow the instructions and press ctrl+.,ctrl+x?

I try to change the Key Bindings to anothor one and opened the margo.go

DisposaBoy commented 5 years ago

My submine press ctrl+.,ctrl+x can't open a window

I'm not sure I understand. Are you saying the key binding doesn't do anything? You need to press ctrl+., then keep holding ctrl and press x.

In either case, the command is available via the Sublime Text command palette under the name GoSublime: Editor Margo Extension.

justay commented 5 years ago

hi, I get the same problem.

[16:21:07] margo: agent#007: ['C:\\Users\\me\\AppData\\Roaming\\Sublime Text 3\\Packages\\GoSublime\\bin\\margo.sh.exe', 'start', 'margo.sublime', '-codec', 'msgpack']
[16:21:07] margo: agent#007: log: ``` go install -v -tags=margo margo.sh/cmd/margo.sublime ```
[16:21:08] margo: agent#007: log: ``` "C:\\Users\\me\\AppData\\Roaming\\Sublime Text 3\\Packages\\GoSublime\\bin\\margo.sublime.exe" -codec msgpack ```
[16:21:08] margo: agent#007: log: store.go:137: started
[16:21:08] margo: agent#007: log: restart.go:145: Mg/Restart: exit status 1
[16:21:08] margo: agent#007: log: ``` go install -v -tags=margo margo.sh/cmd/margo.sublime ```
[16:21:08] margo: agent#007: log: press ` ctrl+. `,` ctrl+x ` to configure margo or check console for errors
[16:21:08] margo: agent#007: log: *Not* using margo extension: Error: cannot find package "margo" in any of:
[16:21:08] margo: agent#007: log:   C:\Go\src\margo (from $GOROOT)
[16:21:08] margo: agent#007: log:   C:\Users\me\AppData\Roaming\Sublime Text 3\Packages\User\GoSublime\src\margo (from $GOPATH)
[16:21:08] margo: agent#007: log:   C:\Users\me\AppData\Roaming\Sublime Text 3\Packages\GoSublime\src\margo

go version is 1.11. running on windows 10

when i open margo.go , what should i do to fix the probelm? thanks. bro.

DisposaBoy commented 5 years ago

@justay If you've followed the (admittedly poor) instructions on https://margo.sh/b/migrate/ you just need to save the file and margo should restart automatically.

rezovax commented 5 years ago
[10:17:42] margo: agent#010: stopping
[10:17:42] margo: agent#011: starting
[10:17:42] margo: agent#011: ['/home/alex/.config/sublime-text-3/Packages/GoSublime/bin/margo.sh', 'start', 'margo.sublime', '-codec', 'msgpack']
[10:17:42] margo: agent#011: log: ``` go install -v -tags=margo margo.sh/cmd/margo.sublime ```
[10:17:42] margo: agent#011: log: ``` /home/alex/go/bin/margo.sublime -codec msgpack ```
[10:17:42] margo: agent#011: log: store.go:137: started
[10:17:42] margo: agent#011: log: restart.go:145: Mg/Restart: exit status 1
[10:17:42] margo: agent#011: log: ``` go install -v -tags=margo margo.sh/cmd/margo.sublime ```
[10:17:42] margo: agent#011: log: press ` ctrl+. `,` ctrl+x ` to configure margo or check console for errors
[10:17:42] margo: agent#011: log: *Not* using margo extension: Error: /home/alex/.config/sublime-text-3/Packages/User/GoSublime/src/margo/margo.go:1:1: expected 'package', found 'import' (and 1 more errors)
[10:17:42] margo: agent#011: log: agent GOPATH is /home/alex/.config/sublime-text-3/Packages/User/GoSublime:/home/alex/.config/sublime-text-3/Packages/GoSublime

help, how to fix it? What you need to change the file margo?

DisposaBoy commented 5 years ago

@rezzovskij See my previous comment https://github.com/DisposaBoy/GoSublime/issues/891#issuecomment-446910420

tooolbox commented 4 years ago

@DisposaBoy Thanks for all the work you've done on GoSublime.

A point of feedback would be to change

press ctrl+.,ctrl+x to configure margo or check console for errors

To

to fix this, press ctrl+.,ctrl+x to configure margo or check console for errors

(It wasn't clear to me that that was what needed to be done until I found this ticket. Pressing those key combinations did the install and I was able to proceed.)

Otherwise I think this ticket can be closed, no?

DisposaBoy commented 4 years ago

@tooolbox I'll take a look when I get a chance. The error message can be improved, but I also think it's a bug. We know ahead of time if the file is missing, so we should generate it by default instead of letting the compilation fail - I think that's how it's supposed to work/worked originally.