You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: loader_fs.go
    path of file: ./repos/linguist/tools/grammars/compiler
    
    the code of the file until where you have to start completion: package compiler

import (
	"io/ioutil"
	"os"
	"os/exec"
	"path"
	"path/filepath"
	"sort"
	"strings"
)

type fsLoader struct {
	*Repository
	abspath string
}

var preferredGrammars = map[string]int{
	".tmlanguage":      0,
	".cson":            1,
	".json":            1,
	".plist":           2,
	".yaml-tmlanguage": 3,
}

func findPreferredExtension(ext []string) string {
	if len(ext) > 1 {
		sort.Slice(ext, func(i, j int) bool {
			a := strings.ToLower(ext[i])
			b := strings
    
func (l *fsLoader) load() {
	grammars, err := l.findGrammars()
	if err != nil {
		l.Fail(err)
		return
	}

	for _, path := range grammars {
		rel, err := filepath.Rel("/src/linguist/vendor/grammars/", path)
		if err != nil {
			l.Fail(err)
			return
		}

		// Ignore all files under src directories
		if ok, _ := filepath.Match("*/src/*", rel); ok {
			continue
		}

		if IgnoredFiles[rel] {
			continue
		}

		data, err := ioutil.ReadFile(path)
		if err != nil {
			l.Fail(err)
			continue
		}

		if rel, err := filepath.Rel(l.abspath, path); err == nil {
			path = rel
		}

		rule, unknown, err := ConvertProto(path, filepath.Ext(path), data)
		if err != nil {
			l.Fail(&ConversionError{path, err})
			continue
		}

		if _, ok := l.Files[rule.ScopeName]; ok {
			continue
		}

		l.AddFile(path, rule, unknown)
	}
}