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
Lots of seemingly unused defun's in csharp-mode #71
Comments
I guess the initial job should be map out all unused functions to get the full picture about how many lines of code we're talking about here. I guess taking out these functions, will again cause the list of actually used csharp-regexes in the regex-alist to be reduced as well. I've git grepped across all revisions. These functions have never been used by csharp-mode code: $ git grep "csharp--on-class-close-curly-p" $(git rev-list --all) | grep -v defun
$ git grep "csharp--on-ctor-close-curly-p" $(git rev-list --all) | grep -v defun
$ git grep "csharp--on-defun-close-curly-p" $(git rev-list --all) | grep -v defun
$ git grep "csharp--on-namespace-close-curly-p" $(git rev-list --all) | grep -v defun
$ git grep "csharp--on-enum-close-curly-p" $(git rev-list --all) | grep -v defun
$ git grep "csharp--on-intf-close-curly-p" $(git rev-list --all) | grep -v defun
$ git grep "csharp--on-class-close-curly-p" $(git rev-list --all) | grep -v defun
$ So if they're not used, and we don't plan to use them, I really so no need to keep them around... |
I did a big grep across all the code-base to see what things have never been referenced: $ grep "^(defun " csharp-mode.el | perl -pe "s/\(defun ([a-z0-9-]+) .*$/\1/" | sort >defuns.txt
$ for line in `cat defuns.txt` ; do echo -n "$line: " ;git grep "$line" $(git rev-list --all) | grep -v defun | wc -l ; done >use-count.txt
$ grep ": 0" use-count.txt
c-inside-bracelist-p: 0
csharp-max-beginning-of-stmt: 0
csharp-move-back-to-beginning-of-defun: 0
csharp-move-back-to-beginning-of-namespace: 0
csharp-move-fwd-to-end-of-class: 0
csharp-move-fwd-to-end-of-defun: 0
csharp--on-class-close-curly-p: 0
csharp--on-ctor-close-curly-p: 0
csharp--on-defun-close-curly-p: 0
csharp--on-defun-open-curly-p: 0
csharp--on-enum-close-curly-p: 0
csharp--on-intf-close-curly-p: 0
csharp--on-namespace-close-curly-p: 0
$ That's going back through all revisions, so these are things which has never been used. Checking the current affairs, gives equal results: $ for line in `cat defuns.txt` ; do echo -n "$line: " ;grep "$line" csharp-mode.el | grep -v defun | wc -l ; done >use-count.txt
$ grep ": 0" use-count.txt
c-inside-bracelist-p: 0
csharp-max-beginning-of-stmt: 0
csharp-move-back-to-beginning-of-defun: 0
csharp-move-back-to-beginning-of-namespace: 0
csharp-move-fwd-to-end-of-class: 0
csharp-move-fwd-to-end-of-defun: 0
csharp--on-class-close-curly-p: 0
csharp--on-ctor-close-curly-p: 0
csharp--on-defun-close-curly-p: 0
csharp--on-defun-open-curly-p: 0
csharp--on-enum-close-curly-p: 0
csharp--on-intf-close-curly-p: 0
csharp--on-namespace-close-curly-p: 0
$ Most of these seems privateish, and in like good candidates for stripping if we're not going to use them. |
There's more:
|
Not touching the monkey-patching as I too don't feel fully qualified to know if they're needed or not anymore. Not touching interactive commands either. Investigating With that done, this issue should be considered complete. |
**Main features:** * all data collected through single scan, using standard regexpes. * most code is 100% pure and functional, with near zero state kept. (Good bye FSM) * orders of magnitudes faster than before * orders of magnitudes more maintainable than before (you can make feature-requests now!) * less hierarchies, less clicky (for those using the menus) * indexes "everything": fields, props, methods, ctors, indexers, classes, enums, etc. **Inherent limitations:** * Does not support/resolve names correctly for nested types. At all. Will not be supported. * Some imenu targets are hard to pick by regexp without getting tons of noise. For this reason methods and props does *require* access-modifiers to be indexed. Other types are less strict. **Otherwise** This commit fixes or addresses the following github issues: * #71 * #68 * #67 * #60
Closed by #74. |
Amongst other the following private functions are defined, but does not seem to be used by any internal code:
In this general area of the code almost all the defined functions are unused. Maybe this should be cleaned up?
The text was updated successfully, but these errors were encountered: