File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,18 @@ use serde::Deserialize;
55use serde_json:: Value ;
66
77pub mod command {
8- pub const TEST : & str = "test" ;
9- pub const GENERATE : & str = "generate" ;
8+ // older versions of gopls send code lens commands without the `gopls` prefix
9+ // so probably a good idea to maintain both for a while.
10+ pub ( super ) const TEST : & str = "test" ;
11+ pub ( super ) const GOPLS_TEST : & str = "gopls.test" ;
12+ pub ( super ) const GENERATE : & str = "generate" ;
13+ pub ( super ) const GOPLS_GENERATE : & str = "gopls.generate" ;
1014}
1115
1216impl LanguageClient {
1317 pub fn handle_gopls_command ( & self , cmd : & Command ) -> Result < bool > {
1418 match cmd. command . as_str ( ) {
15- command:: TEST => {
19+ command:: TEST | command :: GOPLS_TEST => {
1620 if let Some ( args) = & cmd. arguments {
1721 if let Some ( file) = args. get ( 0 ) {
1822 let file = String :: deserialize ( file) ?;
@@ -40,7 +44,7 @@ impl LanguageClient {
4044 }
4145 }
4246 }
43- command:: GENERATE => {
47+ command:: GENERATE | command :: GOPLS_GENERATE => {
4448 if let Some ( arguments) = & cmd. arguments {
4549 if let Some ( package) = arguments. get ( 0 ) {
4650 let package = String :: deserialize ( package) ?;
You can’t perform that action at this time.
0 commit comments