11import * as assert from 'assert'
2- import { FuzzySearch } from './fuzzySearch '
2+ import { FileSearch } from './fileSearch '
33import { testFolder } from '@aws/lsp-core'
44import * as path from 'path'
55import * as fs from 'fs/promises'
66import { TestFeatures } from '@aws/language-server-runtimes/testing'
77import { Features } from '@aws/language-server-runtimes/server-interface/server'
88
9- describe ( 'FuzzySearch Tool' , ( ) => {
9+ describe ( 'FileSearch Tool' , ( ) => {
1010 let tempFolder : testFolder . TestFolder
1111 let testFeatures : TestFeatures
1212
@@ -35,7 +35,7 @@ describe('FuzzySearch Tool', () => {
3535 } )
3636
3737 it ( 'invalidates empty path' , async ( ) => {
38- const fuzzySearch = new FuzzySearch ( testFeatures )
38+ const fileSearch = new FileSearch ( testFeatures )
3939 await assert . rejects (
4040 fileSearch . validate ( { path : '' , queryName : 'test' } ) ,
4141 / P a t h c a n n o t b e e m p t y / i,
@@ -75,8 +75,8 @@ describe('FuzzySearch Tool', () => {
7575 await tempFolder . write ( 'fileB.md' , '# fileB content' )
7676 await tempFolder . write ( 'fileC.js' , 'console.log("fileC");' )
7777
78- const fuzzySearch = new FuzzySearch ( testFeatures )
79- const result = await fuzzySearch . invoke ( {
78+ const fileSearch = new FileSearch ( testFeatures )
79+ const result = await fileSearch . invoke ( {
8080 path : tempFolder . path ,
8181 queryName : 'txt' ,
8282 maxDepth : 0 ,
@@ -97,8 +97,8 @@ describe('FuzzySearch Tool', () => {
9797 await subfolder . write ( 'fileB.txt' , 'fileB content' )
9898 await tempFolder . write ( 'fileC.md' , '# fileC content' )
9999
100- const fuzzySearch = new FuzzySearch ( testFeatures )
101- const result = await fuzzySearch . invoke ( {
100+ const fileSearch = new FileSearch ( testFeatures )
101+ const result = await fileSearch . invoke ( {
102102 path : tempFolder . path ,
103103 queryName : 'txt' ,
104104 } )
@@ -124,8 +124,8 @@ describe('FuzzySearch Tool', () => {
124124 await subfolder1 . write ( 'level1.txt' , 'level1 content' )
125125 await subfolder2 . write ( 'level2.txt' , 'level2 content' )
126126
127- const fuzzySearch = new FuzzySearch ( testFeatures )
128- const result = await fuzzySearch . invoke ( {
127+ const fileSearch = new FileSearch ( testFeatures )
128+ const result = await fileSearch . invoke ( {
129129 path : tempFolder . path ,
130130 queryName : 'txt' ,
131131 maxDepth : 1 ,
@@ -146,8 +146,8 @@ describe('FuzzySearch Tool', () => {
146146 await tempFolder . write ( 'FileUpper.txt' , 'upper case filename' )
147147 await tempFolder . write ( 'fileLower.txt' , 'lower case filename' )
148148
149- const fuzzySearch = new FuzzySearch ( testFeatures )
150- const result = await fuzzySearch . invoke ( {
149+ const fileSearch = new FileSearch ( testFeatures )
150+ const result = await fileSearch . invoke ( {
151151 path : tempFolder . path ,
152152 queryName : 'file' ,
153153 maxDepth : 0 ,
@@ -166,8 +166,8 @@ describe('FuzzySearch Tool', () => {
166166 await tempFolder . write ( 'FileUpper.txt' , 'upper case filename' )
167167 await tempFolder . write ( 'fileLower.txt' , 'lower case filename' )
168168
169- const fuzzySearch = new FuzzySearch ( testFeatures )
170- const result = await fuzzySearch . invoke ( {
169+ const fileSearch = new FileSearch ( testFeatures )
170+ const result = await fileSearch . invoke ( {
171171 path : tempFolder . path ,
172172 queryName : 'file' ,
173173 maxDepth : 0 ,
@@ -188,8 +188,8 @@ describe('FuzzySearch Tool', () => {
188188 await tempFolder . write ( 'regular.txt' , 'regular content' )
189189 await nodeModules . write ( 'excluded.txt' , 'excluded content' )
190190
191- const fuzzySearch = new FuzzySearch ( testFeatures )
192- const result = await fuzzySearch . invoke ( {
191+ const fileSearch = new FileSearch ( testFeatures )
192+ const result = await fileSearch . invoke ( {
193193 path : tempFolder . path ,
194194 queryName : 'txt' ,
195195 } )
@@ -205,7 +205,7 @@ describe('FuzzySearch Tool', () => {
205205
206206 it ( 'throws error if path does not exist' , async ( ) => {
207207 const missingPath = path . join ( tempFolder . path , 'no_such_directory' )
208- const fuzzySearch = new FuzzySearch ( testFeatures )
208+ const fileSearch = new FileSearch ( testFeatures )
209209
210210 await assert . rejects (
211211 fileSearch . invoke ( { path : missingPath , queryName : '.*' } ) ,
@@ -215,8 +215,8 @@ describe('FuzzySearch Tool', () => {
215215 } )
216216
217217 it ( 'expands ~ path' , async ( ) => {
218- const fuzzySearch = new FuzzySearch ( testFeatures )
219- const result = await fuzzySearch . invoke ( {
218+ const fileSearch = new FileSearch ( testFeatures )
219+ const result = await fileSearch . invoke ( {
220220 path : '~' ,
221221 queryName : '.*' ,
222222 maxDepth : 0 ,
0 commit comments