-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renaming packeges and other variables, coderefactor
- Loading branch information
Showing
12 changed files
with
93 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
package l2lsp | ||
|
||
import ( | ||
"github.com/HexmosTech/lama2/l2lsp/lsp_req" | ||
"github.com/HexmosTech/lama2/l2lsp/lsp_res" | ||
"github.com/HexmosTech/lama2/l2lsp/methods" | ||
"github.com/HexmosTech/lama2/l2lsp/request" | ||
"github.com/HexmosTech/lama2/l2lsp/response" | ||
) | ||
|
||
var isShutdownRequested bool | ||
|
||
func HandleMethod(request lsp_req.JSONRPCRequest) lsp_res.JSONRPCResponse { | ||
if isShutdownRequested && request.Method != "exit" { | ||
return lsp_res.InvalidReqAfterShutdown(request) | ||
func HandleMethod(req request.JSONRPCRequest) response.JSONRPCResponse { | ||
if isShutdownRequested && req.Method != "exit" { | ||
return response.InvalidReqAfterShutdown(req) | ||
} | ||
|
||
switch request.Method { | ||
switch req.Method { | ||
case "initialize": | ||
return methods.Initialize(request) | ||
return methods.Initialize(req) | ||
|
||
case "shutdown": | ||
return methods.Shutdown(request, isShutdownRequested) | ||
return methods.Shutdown(req, isShutdownRequested) | ||
|
||
case "exit": | ||
return methods.Exit(isShutdownRequested) | ||
|
||
case "suggest/environmentVariables": | ||
return methods.SuggestEnvironmentVariables(request) | ||
return methods.SuggestEnvironmentVariables(req) | ||
|
||
default: | ||
return lsp_res.DefaultResp(request) | ||
return response.DefaultResp(req) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
l2lsp/lsp_req/general_request.go → l2lsp/request/general_request.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package lsp_req | ||
package request | ||
|
||
type Params struct { | ||
ProcessID *int64 `json:"processId"` | ||
|
2 changes: 1 addition & 1 deletion
2
l2lsp/lsp_res/general_response.go → l2lsp/response/general_response.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package lsp_res | ||
package response | ||
|
||
type JSONRPCError struct { | ||
Code int `json:"code"` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package response | ||
|
||
import "github.com/HexmosTech/lama2/l2lsp/request" | ||
|
||
func CreateEnvironmentVariablesResp(req request.JSONRPCRequest, envs interface{}) JSONRPCResponse { | ||
return JSONRPCResponse{ | ||
ID: req.ID, | ||
JSONRPC: "2.0", | ||
Result: envs, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.