Skip to content

Commit

Permalink
refactor: remove unnecessary console logs for cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
0xIbra committed Dec 17, 2024
1 parent 2a897ab commit a17b9fb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
8 changes: 0 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ async function countTokens(filePath) {
try {
// First check if it's a text file
if (!await isTextFile(filePath)) {
console.log(`Skipping token count for non-text file: ${filePath}`);
return 0;
}

Expand Down Expand Up @@ -380,13 +379,6 @@ ipcMain.handle('read-file', async (event, filePath) => {
throw new Error('Invalid file path');
}

// Log paths for debugging
console.log('Reading file:', {
currentRepo,
filePath,
fullPath
});

const content = await fs.readFile(fullPath, 'utf-8');
return content;
} catch (error) {
Expand Down
9 changes: 0 additions & 9 deletions src/components/FileTree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ const formatTokenCount = (count) => {
};

function FileTree({ files, currentPath, onFileSelect, onFileView }) {
console.log('FileTree received:', {
filesType: typeof files,
isArray: Array.isArray(files),
filesLength: files?.length,
files,
currentPath
});

// Early return if no files
if (!files || files.length === 0) {
return (
Expand All @@ -27,7 +19,6 @@ function FileTree({ files, currentPath, onFileSelect, onFileView }) {
);
}

console.log('FileTree render:', { files, currentPath });
const [expandedFolders, setExpandedFolders] = useState(new Set());
const [searchQuery, setSearchQuery] = useState('');
const [previousExpandedState, setPreviousExpandedState] = useState(null);
Expand Down
2 changes: 0 additions & 2 deletions src/services/tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ export const countTokens = (text) => {
export const countFileTokens = async (filePath, fs, path, currentPath) => {
try {
const fullPath = path.join(currentPath, filePath);
console.log('Reading file for tokens:', fullPath);
const content = await fs.readFile(fullPath, 'utf-8');
const tokenCount = countTokens(content);
console.log('File token count:', filePath, tokenCount);
return tokenCount;
} catch (error) {
console.error('Error reading file for token count:', error);
Expand Down

0 comments on commit a17b9fb

Please sign in to comment.