Skip to content

Commit

Permalink
feat: support fuzzy search file name #51
Browse files Browse the repository at this point in the history
  • Loading branch information
lee88688 authored Dec 17, 2024
2 parents 72bd64a + 6584bc8 commit a730e57
Show file tree
Hide file tree
Showing 10 changed files with 2,171 additions and 89 deletions.
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ ui/**
.idea/**
.aider*
.aider*/**
node_modules
56 changes: 56 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const esbuild = require('esbuild');

const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');

async function main() {
const ctx = await esbuild.context({
entryPoints: ['src/extension.ts'],
bundle: true,
format: 'cjs',
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: 'node',
outfile: 'out/extension.js',
external: ['vscode'],
logLevel: 'silent',
plugins: [
/* add to the end of plugins array */
esbuildProblemMatcherPlugin,
],
});
if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
}
}

/**
* @type {import('esbuild').Plugin}
*/
const esbuildProblemMatcherPlugin = {
name: 'esbuild-problem-matcher',

setup(build) {
build.onStart(() => {
console.log('[watch] build started');
});
build.onEnd((result) => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
console.error(
` ${location.file}:${location.line}:${location.column}:`,
);
});
console.log('[watch] build finished');
});
},
};

main().catch((e) => {
console.error(e);
process.exit(1);
});
6 changes: 6 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module 'fuse.js/dist/fuse.cjs' {
// @ts-ignore
export * from 'fuse.js';
// @ts-ignore
export { default } from 'fuse.js';
}
Loading

0 comments on commit a730e57

Please sign in to comment.