-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(definition): definition for variables finished
- Loading branch information
Showing
9 changed files
with
124 additions
and
100 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,39 @@ | ||
package handler | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/mrjosh/helm-ls/pkg/chartutil" | ||
lsp "go.lsp.dev/protocol" | ||
"go.lsp.dev/uri" | ||
) | ||
|
||
type ProjectFiles struct { | ||
ValuesFile string | ||
ChartFile string | ||
} | ||
|
||
func (p ProjectFiles) GetValuesFileURI() lsp.DocumentURI { | ||
return "file://" + lsp.DocumentURI(p.ValuesFile) | ||
} | ||
func (p ProjectFiles) GetChartFileURI() lsp.DocumentURI { | ||
return "file://" + lsp.DocumentURI(p.ChartFile) | ||
} | ||
|
||
func NewProjectFiles(rootURI uri.URI, valuesFileName string) ProjectFiles { | ||
|
||
if valuesFileName == "" { | ||
valuesFileName = chartutil.ValuesfileName | ||
} | ||
valuesFileName = filepath.Join(rootURI.Filename(), valuesFileName) | ||
if _, err := os.Stat(valuesFileName); errors.Is(err, os.ErrNotExist) { | ||
valuesFileName = filepath.Join(rootURI.Filename(), "values.yml") | ||
} | ||
|
||
return ProjectFiles{ | ||
ValuesFile: valuesFileName, | ||
ChartFile: filepath.Join(rootURI.Filename(), chartutil.ChartfileName), | ||
} | ||
} |
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,14 @@ | ||
package util | ||
|
||
import ( | ||
sitter "github.com/smacker/go-tree-sitter" | ||
lsp "go.lsp.dev/protocol" | ||
) | ||
|
||
func PointToPosition(point sitter.Point) lsp.Position { | ||
return lsp.Position{Line: point.Row, Character: point.Column} | ||
} | ||
|
||
func PositionToPoint(position lsp.Position) sitter.Point { | ||
return sitter.Point{Row: position.Line, Column: position.Character} | ||
} |
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
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 |
---|---|---|
|
@@ -19,7 +19,6 @@ package chartutil | |
import ( | ||
"fmt" | ||
"io" | ||
"io/ioutil" | ||
"os" | ||
"strings" | ||
|
||
|