Skip to content

Commit

Permalink
decoder: bootstrap Expression implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Jan 5, 2023
1 parent fbf7e72 commit 5b41891
Show file tree
Hide file tree
Showing 14 changed files with 543 additions and 2 deletions.
40 changes: 40 additions & 0 deletions decoder/expr_keyword.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type Keyword struct {
expr hcl.Expression
cons schema.Keyword
}

func (kw Keyword) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (kw Keyword) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (kw Keyword) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (kw Keyword) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (kw Keyword) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
40 changes: 40 additions & 0 deletions decoder/expr_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type List struct {
expr hcl.Expression
cons schema.List
}

func (l List) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (l List) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (l List) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (l List) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (l List) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
40 changes: 40 additions & 0 deletions decoder/expr_literal_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type LiteralType struct {
expr hcl.Expression
cons schema.LiteralType
}

func (lt LiteralType) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (lt LiteralType) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (lt LiteralType) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (lt LiteralType) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (lt LiteralType) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
40 changes: 40 additions & 0 deletions decoder/expr_literal_value.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type LiteralValue struct {
expr hcl.Expression
cons schema.LiteralValue
}

func (lv LiteralValue) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (lv LiteralValue) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (lv LiteralValue) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (lv LiteralValue) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (lv LiteralValue) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
40 changes: 40 additions & 0 deletions decoder/expr_map.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type Map struct {
expr hcl.Expression
cons schema.Map
}

func (m Map) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (m Map) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (m Map) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (m Map) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (m Map) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
70 changes: 70 additions & 0 deletions decoder/expr_object.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type Object struct {
expr hcl.Expression
cons schema.Object
}

func (obj Object) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (obj Object) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (obj Object) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (obj Object) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (obj Object) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}

type ObjectAttributes struct {
expr hcl.Expression
cons schema.ObjectAttributes
}

func (oa ObjectAttributes) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (oa ObjectAttributes) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (oa ObjectAttributes) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (oa ObjectAttributes) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (oa ObjectAttributes) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
40 changes: 40 additions & 0 deletions decoder/expr_one_of.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type OneOf struct {
expr hcl.Expression
cons schema.OneOf
}

func (oo OneOf) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (oo OneOf) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (oo OneOf) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (oo OneOf) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (oo OneOf) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
40 changes: 40 additions & 0 deletions decoder/expr_reference.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type Reference struct {
expr hcl.Expression
cons schema.Reference
}

func (ref Reference) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (ref Reference) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (ref Reference) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (ref Reference) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (ref Reference) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
40 changes: 40 additions & 0 deletions decoder/expr_set.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package decoder

import (
"context"

"github.com/hashicorp/hcl-lang/lang"
"github.com/hashicorp/hcl-lang/reference"
"github.com/hashicorp/hcl-lang/schema"
"github.com/hashicorp/hcl/v2"
)

type Set struct {
expr hcl.Expression
cons schema.Set
}

func (s Set) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate {
// TODO
return nil
}

func (s Set) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData {
// TODO
return nil
}

func (s Set) SemanticTokens(ctx context.Context) []lang.SemanticToken {
// TODO
return nil
}

func (s Set) ReferenceOrigins(allowSelfRefs bool) reference.Origins {
// TODO
return nil
}

func (s Set) ReferenceTargets(attrAddr *schema.AttributeAddrSchema) reference.Targets {
// TODO
return nil
}
Loading

0 comments on commit 5b41891

Please sign in to comment.