Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very slow on large number of tags (yet works fine in vim) #209

Open
rubenwardy opened this issue Jun 18, 2018 · 6 comments
Open

Very slow on large number of tags (yet works fine in vim) #209

rubenwardy opened this issue Jun 18, 2018 · 6 comments

Comments

@rubenwardy
Copy link

rubenwardy commented Jun 18, 2018

The linux kernel has a large amount of symbols. Searching for a tag in vim is very fast - no noticeable delay - but in atom with this plugin it is very slow to find something, partially due to searching on every keypress. I suggest adding a delay to the search so that it doesn't search for every key press, and also using concurrency.

@jdanbrown maybe this is something you could add to your fork? Would be good if you could open issues on your fork too

@rubenwardy
Copy link
Author

@jdanbrown 's fork fixes this for me

@rubenwardy
Copy link
Author

The fork makes the editor lag massively in other places, including editing the file and using the project tree-view

@jdanbrown
Copy link

@jdanbrown maybe this is something you could add to your fork? Would be good if you could open issues on your fork too

I hesitate to for-real fork this package since I don't have much time to put into it right now, but I'd welcome someone else doing it if they wanted to get all the open PRs and issues organized. In the meantime, I vote let's keep all the discussion in this repo.

The fork makes the editor lag massively in other places, including editing the file and using the project tree-view

Hmm, that's possible but I'm skeptical since the atom-ctags commits I added don't appear to be very intrusive. Maybe double check that my fork is actually what's causing those other lags (e.g. not some other package)?—that might solve both of your problems.

@rubenwardy
Copy link
Author

rubenwardy commented Jun 18, 2018

Thanks for your quick response. Disabling the package removes the lag. It's possible that the parent plugin also has this issue - it only appears after 5/10 minutes of using it

I tried modifying the coffeescript to disable the callback that watches the editor, but to no effect. I've never done coffeescript or made an atom plugin. I didn't spend much time trying to find callbacks on editor actions though, so may have missed it.

Do you have to recompile the .coffee somehow, or does atom do that automatically?

Patch
diff --git a/lib/main.coffee b/lib/main.coffee
index c689549..0a830e0 100644
--- a/lib/main.coffee
+++ b/lib/main.coffee
@@ -10,6 +10,10 @@ module.exports =
       title: 'Disable auto complete'
       type: 'boolean'
       default: false
+    disableGoto:
+      title: 'Disable goto'
+      type: 'boolean'
+      default: false
     autoBuildTagsWhenActive:
       title: 'Automatically rebuild tags'
       description: 'Rebuild tags file each time a project path changes'
@@ -69,15 +73,16 @@ module.exports =
       'atom-ctags:go-to-declaration': => @createFileView().goto()
       'atom-ctags:return-from-declaration': => @createGoBackView().toggle()
 
-    @disposables.add atom.workspace.observeTextEditors (editor) =>
-      editorView = atom.views.getView(editor)
-      {$} = require 'atom-space-pen-views' unless $
-      $(editorView).on 'mousedown', (event) =>
-        which = atom.config.get('atom-ctags.GotoSymbolClick')
-        return unless MouseEventWhichDict[which] == event.which
-        for keyName in atom.config.get('atom-ctags.GotoSymbolKey')
-          return if not event[keyName+"Key"]
-        @createFileView().goto()
+    if not atom.config.get('atom-ctags.disableGoto')
+      @disposables.add atom.workspace.observeTextEditors (editor) =>
+        editorView = atom.views.getView(editor)
+        {$} = require 'atom-space-pen-views' unless $
+        $(editorView).on 'mousedown', (event) =>
+          which = atom.config.get('atom-ctags.GotoSymbolClick')
+          return unless MouseEventWhichDict[which] == event.which
+          for keyName in atom.config.get('atom-ctags.GotoSymbolKey')
+            return if not event[keyName+"Key"]
+          @createFileView().goto()
 
     if not atom.packages.isPackageDisabled("symbols-view")
       atom.packages.disablePackage("symbols-view")

@Caedendi
Copy link

Sorry for the necropost.

I also just ran into this issue after adding the FontAwesome folder to my small practice website project folder. That added folder's main "all.css" file already has almost 4400 lines, so yeah. Couldn't for the life of me figure out what was causing the problem until I started to randomly delete stuff to revert the folder to the state it was in before it started to massively lag.

At first, it gave a linter timeout error, which made it even more confusing, but I eventually narrowed it down to be atom-ctags in combination with autocomplete-plus.

Has anyone in the meantime figured out how this issue could be fixed?

@rubenwardy
Copy link
Author

I switched to vscode a few months ago, so I'm no longer vested in this issue. Hope you find a solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants