Skip to content

Commit

Permalink
chore: run go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h committed Jan 25, 2025
1 parent aee380d commit fe95175
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 37 deletions.
2 changes: 1 addition & 1 deletion lsp/protocol/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"reflect"
"testing"

"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"encoding/json"
)

func TestCancelParams(t *testing.T) {
Expand Down
20 changes: 10 additions & 10 deletions lsp/protocol/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,16 +683,16 @@ const (
//
// Here is an example how such a string can be constructed using JavaScript / TypeScript:
//
// let markdown: MarkdownContent = {
// kind: MarkupKind.Markdown,
// value: [
// '# Header',
// 'Some text',
// '```typescript',
// 'someCode();',
// '```'
// ].join('\n')
// };
// let markdown: MarkdownContent = {
// kind: MarkupKind.Markdown,
// value: [
// '# Header',
// 'Some text',
// '```typescript',
// 'someCode();',
// '```'
// ].join('\n')
// };
//
// NOTE: clients might sanitize the return markdown. A client could decide to
// remove HTML from the markdown to avoid script execution.
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package protocol
import (
"testing"

"github.com/google/go-cmp/cmp"
"encoding/json"
"github.com/google/go-cmp/cmp"

"github.com/a-h/templ/lsp/uri"
)
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/callhierarchy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"fmt"
"testing"

"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"encoding/json"

"github.com/a-h/templ/lsp/uri"
)
Expand Down
15 changes: 11 additions & 4 deletions lsp/protocol/capabilities_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1021,13 +1021,20 @@ type GeneralClientCapabilities struct {
//
// The following features from the ECMAScript 2020 regular expression specification are NOT mandatory for a client:
//
// Assertions
// Assertions
//
// Lookahead assertion, Negative lookahead assertion, lookbehind assertion, negative lookbehind assertion.
// Character classes
//
// Character classes
//
// Matching control characters using caret notation (e.g. "\cX") and matching UTF-16 code units (e.g. "\uhhhh").
// Group and ranges
//
// Group and ranges
//
// Named capturing groups.
// Unicode property escapes
//
// Unicode property escapes
//
// None of the features needs to be supported.
//
// The only regular expression flag that a client needs to support is "i" to specify a case insensitive search.
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/capabilities_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package protocol
import (
"testing"

"github.com/google/go-cmp/cmp"
"encoding/json"
"github.com/google/go-cmp/cmp"
)

func TestClientCapabilities(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/diagnostics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package protocol
import (
"testing"

"github.com/google/go-cmp/cmp"
"encoding/json"
"github.com/google/go-cmp/cmp"

"github.com/a-h/templ/lsp/uri"
)
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/general_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"path/filepath"
"testing"

"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"encoding/json"

"github.com/a-h/templ/lsp/uri"
)
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/language_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"strings"
"testing"

"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"encoding/json"

"github.com/a-h/templ/lsp/uri"
)
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/progress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"fmt"
"testing"

"github.com/google/go-cmp/cmp"
"encoding/json"
"github.com/google/go-cmp/cmp"
)

func TestWorkDoneProgressBegin(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/registration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package protocol
import (
"testing"

"github.com/google/go-cmp/cmp"
"encoding/json"
"github.com/google/go-cmp/cmp"
)

func TestRegistration(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/text_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package protocol
import (
"testing"

"github.com/google/go-cmp/cmp"
"encoding/json"
"github.com/google/go-cmp/cmp"

"github.com/a-h/templ/lsp/uri"
)
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/window_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strconv"
"testing"

"github.com/google/go-cmp/cmp"
"encoding/json"
"github.com/google/go-cmp/cmp"
)

func TestShowMessageParams(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lsp/protocol/workspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"fmt"
"testing"

"encoding/json"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"encoding/json"

"github.com/a-h/templ/lsp/uri"
)
Expand Down
14 changes: 7 additions & 7 deletions lsp/uri/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ const (
// (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
// and encoding.
//
// foo://example.com:8042/over/there?name=ferret#nose
// \_/ \______________/\_________/ \_________/ \__/
// | | | | |
// scheme authority path query fragment
// | _____________________|__
// / \ / \
// urn:example:animal:ferret:nose
// foo://example.com:8042/over/there?name=ferret#nose
// \_/ \______________/\_________/ \_________/ \__/
// | | | | |
// scheme authority path query fragment
// | _____________________|__
// / \ / \
// urn:example:animal:ferret:nose
type URI string

// Filename returns the file path for the given URI.
Expand Down
8 changes: 4 additions & 4 deletions lsp/xcontext/xcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func Detach(ctx context.Context) context.Context { return detachedContext{ctx} }

type detachedContext struct{ parent context.Context }

func (v detachedContext) Deadline() (time.Time, bool) { return time.Time{}, false }
func (v detachedContext) Done() <-chan struct{} { return nil }
func (v detachedContext) Err() error { return nil }
func (v detachedContext) Value(key any) any { return v.parent.Value(key) }
func (v detachedContext) Deadline() (time.Time, bool) { return time.Time{}, false }
func (v detachedContext) Done() <-chan struct{} { return nil }
func (v detachedContext) Err() error { return nil }
func (v detachedContext) Value(key any) any { return v.parent.Value(key) }

0 comments on commit fe95175

Please sign in to comment.