Skip to content

Commit

Permalink
languageserver: Initialize Flow integration with commands
Browse files Browse the repository at this point in the history
  • Loading branch information
psiemens committed Jul 24, 2020
1 parent 6fe291f commit f126bd2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions languageserver/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,21 @@ func NewFlowIntegration(s *server.Server) (*FlowIntegration, error) {
accounts: make(map[flow.Address]AccountPrivateKey),
}

options := []server.Option{
server.WithInitializationOptionsHandler(integration.initialize),
server.WithDiagnosticProvider(integration.diagnostics),
server.WithCodeLensProvider(integration.codeLenses),
server.WithAddressImportResolver(integration.resolveAccountImport),
server.WithStringImportResolver(resolveFileImport),
}

var commandOptions []server.Option
for _, command := range integration.commands() {
commandOptions = append(commandOptions, server.WithCommand(command))
}

err := s.SetOptions(
server.WithInitializationOptionsHandler(integration.initialize),
server.WithDiagnosticProvider(integration.diagnostics),
server.WithCodeLensProvider(integration.codeLenses),
server.WithAddressImportResolver(integration.resolveAccountImport),
server.WithStringImportResolver(resolveFileImport),
append(options, commandOptions...)...,
)
if err != nil {
return nil, err
Expand Down

0 comments on commit f126bd2

Please sign in to comment.