Skip to content

Commit 9e6e021

Browse files
committed
Factor out lsp server setup so we can use it for some unit testing
1 parent 2ba0e47 commit 9e6e021

File tree

3 files changed

+301
-251
lines changed

3 files changed

+301
-251
lines changed

internal/fourslash/baselineutil.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (f *FourslashTest) getBaselineForGroupedLocationsWithFileContents(groupedRa
157157
foundAdditionalLocation := false
158158

159159
baselineEntries := []string{}
160-
err := f.vfs.WalkDir("/", func(path string, d vfs.DirEntry, e error) error {
160+
err := f.Vfs.WalkDir("/", func(path string, d vfs.DirEntry, e error) error {
161161
if e != nil {
162162
return e
163163
}
@@ -172,7 +172,7 @@ func (f *FourslashTest) getBaselineForGroupedLocationsWithFileContents(groupedRa
172172
return nil
173173
}
174174

175-
content, ok := f.vfs.ReadFile(path)
175+
content, ok := f.Vfs.ReadFile(path)
176176
if !ok {
177177
// !!! error?
178178
return nil
@@ -198,7 +198,7 @@ func (f *FourslashTest) getBaselineForGroupedLocationsWithFileContents(groupedRa
198198
// already added the file to the baseline.
199199
if options.additionalLocation != nil && !foundAdditionalLocation {
200200
fileName := options.additionalLocation.Uri.FileName()
201-
if content, ok := f.vfs.ReadFile(fileName); ok {
201+
if content, ok := f.Vfs.ReadFile(fileName); ok {
202202
baselineEntries = append(
203203
baselineEntries,
204204
f.getBaselineContentForFile(fileName, content, []lsproto.Range{options.additionalLocation.Range}, nil, options),
@@ -212,7 +212,7 @@ func (f *FourslashTest) getBaselineForGroupedLocationsWithFileContents(groupedRa
212212
if !foundMarker && options.marker != nil {
213213
// If we didn't find the marker in any file, we need to add it.
214214
markerFileName := options.marker.FileName()
215-
if content, ok := f.vfs.ReadFile(markerFileName); ok {
215+
if content, ok := f.Vfs.ReadFile(markerFileName); ok {
216216
baselineEntries = append(baselineEntries, f.getBaselineContentForFile(markerFileName, content, nil, nil, options))
217217
}
218218
}

0 commit comments

Comments
 (0)