Added project schema feature

This commit is contained in:
Martino Ferrari
2026-01-21 18:26:43 +01:00
parent 92dfa38294
commit 970b5697bd
16 changed files with 327 additions and 33 deletions

View File

@@ -137,6 +137,7 @@ type TextEdit struct {
var tree = index.NewProjectTree()
var documents = make(map[string]string)
var projectRoot string
func RunServer() {
reader := bufio.NewReader(os.Stdin)
@@ -193,6 +194,7 @@ func handleMessage(msg *JsonRpcMessage) {
}
if root != "" {
projectRoot = root
logger.Printf("Scanning workspace: %s\n", root)
tree.ScanDirectory(root)
tree.ResolveReferences()
@@ -323,7 +325,7 @@ func handleFormatting(params DocumentFormattingParams) []TextEdit {
}
func runValidation(uri string) {
v := validator.NewValidator(tree)
v := validator.NewValidator(tree, projectRoot)
v.ValidateProject()
v.CheckUnused()