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

[languageserver] Update to Cadence v1.2.1 #441

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languageserver/cmd/languageserver/main_wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"sync"
"syscall/js"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"

"github.com/onflow/cadence-tools/languageserver/server"
)
Expand Down
6 changes: 3 additions & 3 deletions languageserver/conversion/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
package conversion

import (
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/tools/analysis"

"github.com/onflow/cadence-tools/languageserver/protocol"
Expand Down
29 changes: 15 additions & 14 deletions languageserver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ require (
github.com/google/uuid v1.6.0
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/mapstructure v1.5.0
github.com/onflow/cadence v1.0.0
github.com/onflow/cadence-tools/lint v1.0.0
github.com/onflow/cadence-tools/test v1.0.0
github.com/onflow/flow-go v0.38.0-preview.0.0.20241002124048-21cfe5aea5a8
github.com/onflow/flow-go-sdk v1.0.0
github.com/onflow/flowkit/v2 v2.0.1
github.com/onflow/cadence v1.2.1
github.com/onflow/cadence-tools/lint v1.1.0
github.com/onflow/cadence-tools/test v1.1.0
github.com/onflow/flow-go v0.38.0-preview.0.0.20241022154145-6a254edbec23
github.com/onflow/flow-go-sdk v1.2.2
github.com/onflow/flowkit/v2 v2.1.0
github.com/sourcegraph/jsonrpc2 v0.1.0
github.com/spf13/afero v1.10.0
github.com/spf13/pflag v1.0.5
Expand All @@ -21,8 +21,8 @@ require (
)

require (
github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.3.1 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.4.0 // indirect
)

require (
Expand Down Expand Up @@ -151,15 +151,16 @@ require (
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/atree v0.8.0-rc.6 // indirect
github.com/onflow/atree v0.8.0 // indirect
github.com/onflow/crypto v0.25.2 // indirect
github.com/onflow/flow-emulator v1.0.1 // indirect
github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect
github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect
github.com/onflow/flow-nft/lib/go/contracts v1.2.1 // indirect
github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect
github.com/onflow/flow-emulator v1.1.0 // indirect
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 // indirect
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
github.com/onflow/flow-nft/lib/go/contracts v1.2.2 // indirect
github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.7 // indirect
github.com/onflow/go-ethereum v1.14.7 // indirect
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0 // indirect
github.com/onflow/sdks v0.6.0-preview.1 // indirect
github.com/onflow/wal v1.0.2 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
Expand Down
2,106 changes: 30 additions & 2,076 deletions languageserver/go.sum

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions languageserver/integration/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ package integration
import (
"fmt"

"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/interpreter"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/sema"

"github.com/onflow/cadence-tools/languageserver/conversion"
"github.com/onflow/cadence-tools/languageserver/protocol"
Expand Down
6 changes: 3 additions & 3 deletions languageserver/integration/contracts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (

"github.com/stretchr/testify/assert"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions languageserver/integration/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
package integration

import (
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"

"github.com/onflow/cadence-tools/languageserver/conversion"
"github.com/onflow/cadence-tools/languageserver/protocol"
Expand Down
10 changes: 5 additions & 5 deletions languageserver/integration/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (
"fmt"
"regexp"

"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/interpreter"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/sema"

"github.com/onflow/cadence-tools/languageserver/conversion"
"github.com/onflow/cadence-tools/languageserver/protocol"
Expand Down
6 changes: 3 additions & 3 deletions languageserver/integration/entrypoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (

"github.com/stretchr/testify/assert"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion languageserver/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"errors"
"strconv"

"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/sema"

"github.com/onflow/flowkit/v2"
"github.com/spf13/afero"
Expand Down
4 changes: 2 additions & 2 deletions languageserver/integration/resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"path/filepath"
"strings"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/flow-go-sdk"
"github.com/onflow/flowkit/v2"
"github.com/onflow/flowkit/v2/config"
Expand Down
2 changes: 1 addition & 1 deletion languageserver/integration/resolvers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"
"testing"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"
"github.com/onflow/flow-go-sdk"

"github.com/spf13/afero"
Expand Down
4 changes: 2 additions & 2 deletions languageserver/integration/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package integration

import (
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/stdlib"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/stdlib"
evmstdlib "github.com/onflow/flow-go/fvm/evm/stdlib"
)

Expand Down
2 changes: 1 addition & 1 deletion languageserver/server/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"path"
"strings"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/common"

"github.com/onflow/cadence-tools/languageserver/protocol"
)
Expand Down
2 changes: 1 addition & 1 deletion languageserver/server/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package server
import (
"github.com/onflow/cadence"
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/sema"
)

type Parameter struct {
Expand Down
19 changes: 7 additions & 12 deletions languageserver/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ import (
"github.com/getsentry/sentry-go"
"github.com/google/uuid"
"github.com/mitchellh/mapstructure"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/encoding/json"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/runtime/interpreter"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/runtime/stdlib"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
"github.com/onflow/cadence/tools/analysis"
"golang.org/x/exp/maps"

Expand Down Expand Up @@ -2909,11 +2909,6 @@ func (s *Server) handleImport(
error,
) {
switch importedLocation {
case stdlib.CryptoCheckerLocation:
cryptoChecker := stdlib.CryptoChecker()
return sema.ElaborationImport{
Elaboration: cryptoChecker.Elaboration,
}, nil
case stdlib.TestContractLocation:
testChecker := stdlib.GetTestContractType().Checker
return sema.ElaborationImport{
Expand Down
10 changes: 5 additions & 5 deletions languageserver/server/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
package server

import (
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/runtime/interpreter"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/runtime/stdlib"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
)

type standardLibrary struct {
Expand Down
Loading