-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring: Decouple generic HCL parsing logic
This also helps keeping CompletionCandidate immutable and allows passing around already "trimmed" candidates as opposed to letting the lsp package handle the trimming.
- Loading branch information
1 parent
010655f
commit e96b87e
Showing
21 changed files
with
311 additions
and
287 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
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,17 @@ | ||
package hcl | ||
|
||
import ( | ||
"github.com/hashicorp/hcl/v2" | ||
"github.com/hashicorp/hcl/v2/hclsyntax" | ||
) | ||
|
||
type TokenizedFile interface { | ||
BlockAtPosition(hcl.Pos) (TokenizedBlock, error) | ||
TokenAtPosition(hcl.Pos) (hclsyntax.Token, error) | ||
PosInBlock(hcl.Pos) bool | ||
} | ||
|
||
type TokenizedBlock interface { | ||
TokenAtPosition(hcl.Pos) (hclsyntax.Token, error) | ||
Tokens() hclsyntax.Tokens | ||
} |
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.