feat: Major performance optimization and LSP stability improvements

- Add comprehensive file type filtering to prevent LSP errors on non-text files
- Fix image freezing issues during file searches in Telescope
- Optimize leader key response time (500ms → 200ms)
- Add performance monitoring tools and LSP health checks
- Implement safe file search commands to prevent crashes
- Add startup optimization and deferred heavy operations
- Enhance LSP error handling with timeouts and graceful fallbacks
- Optimize Treesitter, completion, and search performance
- Add comprehensive troubleshooting guide for LSP issues

Performance improvements:
- Faster scrolling and UI responsiveness
- Better memory management and startup times
- Reduced diagnostic updates and LSP overhead
- Automatic exclusion of problematic file types

New keymaps:
- <leader>pp - Performance monitoring
- <leader>pl - LSP health check
- <leader>pr - Restart LSP
- <leader>ff - Safe file search (prevents LSP errors)
- <leader>ft - Text files only search
This commit is contained in:
Carlos Gutierrez
2025-08-12 02:21:05 -04:00
parent 62a52c1c01
commit c1cddfdf68
13 changed files with 1102 additions and 182 deletions

View File

@@ -1,4 +1,8 @@
[
{
"key": "cmd+i",
"command": "composerMode.agent"
},
{
"key": "ctrl-h",
"command": "workbench.action.navigateLeft"
@@ -35,121 +39,13 @@
"workbench.action.focusActiveEditorGroup"
]
},
"when": "sideBarFocus && !inputFocus"
"when": "vim.mode == 'Normal' && sideBarFocus && !inputFocus"
},
{
"key": "space e",
"when": "vim.mode == 'Normal' && editorTextFocus && foldersViewVisible",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "s h",
"command": "workbench.action.splitEditor",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "s v",
"command": "workbench.action.splitEditorDown",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "space c a",
"command": "editor.action.codeAction",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "shift-k",
"command": "editor.action.moveLinesUpAction",
"when": "vim.mode == 'VisualLine' && editorTextFocus"
},
{
"key": "shift-j",
"command": "editor.action.moveLinesDownAction",
"when": "vim.mode == 'VisualLine' && editorTextFocus"
},
{
"key": "shift-k",
"command": "editor.action.showHover",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space c r",
"command": "editor.action.rename",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space c s",
"command": "workbench.action.gotoSymbol",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space b d",
"command": "workbench.action.closeActiveEditor",
"when": "(vim.mode == 'Normal' && editorTextFocus) || !inputFocus"
},
{
"key": "space b o",
"command": "workbench.action.closeOtherEditors",
"when": "(vim.mode == 'Normal' && editorTextFocus) || !inputFocus"
},
{
"key": "space space",
"command": "workbench.action.quickOpen",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "space g d",
"command": "editor.action.revealDefinition",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space g r",
"command": "editor.action.goToReferences",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space g i",
"command": "editor.action.goToImplementation",
"when": "vim.mode == 'Normal' && editorTextFocus"
},
{
"key": "space s g",
"command": "workbench.action.findInFiles",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "space g g",
"command": "runCommands",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)",
"args": {
"commands": ["workbench.view.scm", "workbench.scm.focus"]
}
},
{
"key": "ctrl-n",
"command": "editor.action.addSelectionToNextFindMatch",
"when": "(vim.mode == 'Normal' || vim.mode == 'Visual') && (editorTextFocus || !inputFocus)"
},
{
"key": "ctrl-n",
"command": "workbench.action.toggleSidebarVisibility",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "space f s",
"command": "workbench.action.findInFiles",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "n",
"command": "search.action.focusNextSearchResult",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "shift-n",
"command": "search.action.focusPreviousSearchResult",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "ctrl-w h",
"command": "workbench.action.navigateLeft",
@@ -171,51 +67,39 @@
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "r",
"key": "space r",
"command": "renameFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
"when": "vim.mode == 'Normal' && filesExplorerFocus && !inputFocus"
},
{
"key": "x",
"key": "space x",
"command": "filesExplorer.cut",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
"when": "vim.mode == 'Normal' && filesExplorerFocus && !inputFocus"
},
{
"key": "d",
"key": "space d",
"command": "deleteFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
"when": "vim.mode == 'Normal' && filesExplorerFocus && !inputFocus"
},
{
"key": "a",
"key": "space a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
"when": "vim.mode == 'Normal' && filesExplorerFocus && !inputFocus"
},
{
"key": "s",
"key": "space s",
"command": "explorer.openToSide",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "shift-s",
"command": "runCommands",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus",
"args": {
"commands": [
"workbench.action.splitEditorDown",
"explorer.openAndPassFocus",
"workbench.action.closeOtherEditors"
]
}
"when": "vim.mode == 'Normal' && filesExplorerFocus && !inputFocus"
},
{
"key": "enter",
"command": "explorer.openAndPassFocus",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceIsFolder && !inputFocus"
"when": "filesExplorerFocus && !explorerResourceIsFolder && !inputFocus"
},
{
"key": "enter",
"command": "list.toggleExpand",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && explorerResourceIsFolder && !inputFocus"
"when": "filesExplorerFocus && explorerResourceIsFolder && !inputFocus"
},
{
"key": "space d a",
@@ -227,6 +111,18 @@
"command": "workbench.action.debug.stop",
"when": "vim.mode == 'Normal' && editorTextFocus && inDebugMode && !focusedSessionIsAttached"
},
{
"key": "space shift-s",
"command": "runCommands",
"when": "vim.mode == 'Normal' && filesExplorerFocus && !inputFocus",
"args": {
"commands": [
"workbench.action.splitEditorDown",
"explorer.openAndPassFocus",
"workbench.action.closeOtherEditors"
]
}
},
{
"key": "space d o",
"command": "workbench.action.debug.stepOver",
@@ -247,11 +143,6 @@
"command": "workbench.action.debug.continue",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus) && inDebugMode && debugState == 'stopped'"
},
{
"key": "space u",
"command": "editor.action.selectAll",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "space w",
"command": "workbench.action.files.save",
@@ -267,21 +158,6 @@
"command": "workbench.action.closeAllEditors",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "y",
"command": "editor.action.clipboardCopyAction",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "d d",
"command": "editor.action.deleteLines",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "p",
"command": "editor.action.clipboardPasteAction",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "ctrl-e",
"command": "editorScroll",
@@ -296,18 +172,18 @@
},
{
"key": "space n t",
"command": "workbench.files.action.showActiveFileInExplorer",
"command": "workbench.view.explorer",
"when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus)"
},
{
"key": "o",
"key": "space o",
"command": "workbench.action.splitEditorRight",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !inputFocus"
"when": "vim.mode == 'Normal' && filesExplorerFocus && !inputFocus"
},
{
"key": "i",
"key": "space i",
"command": "workbench.action.splitEditorDown",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !inputFocus"
"when": "vim.mode == 'Normal' && filesExplorerFocus && !inputFocus"
},
{
"key": "ctrl-p",