Repository: spyder-ide/spyder

Issue:
Explain CodeEditor's parameters within the doctring
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [x] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports

## Problem Description

There is not an explanation of the multiple parameters that a `CodeEditor` instance can receive

Following suggestion at https://github.com/spyder-ide/spyder/pull/9897#discussion_r320016309


Discussion:
I would like to contribute on this if possible.
Thanks @Akashtyagi08 for wanting to help us with this!

@dalthviz, please guide @Akashtyagi08 on how to do approach this task.
Hi @Akashtyagi08 you should add a docstring for the [`setup_editor` method of the `CodeEditor`](https://github.com/spyder-ide/spyder/blob/4cc01f1bb11d6ea3ff736958b914a5feab30e8ff/spyder/plugins/editor/widgets/codeeditor.py#L796). The contents could be something like:

```python
"""
Set-up configuration for the CodeEditor instance.

Usually the parameters here are related with a configurable preference in the Preference Dialog and Editor configurations:

param_1: explanation/description
param_2: explanation/description
...

"""
```

For the params explanation/description an initial text could be:

* `linenumbers`:  Enable/Disable line number panel. Default `True`
* `language`: Set editor language for example `python`. Default `None`
* `markers`: Enable/Disable markers panel. Used to show elements like Code Analysis. Default `False`
* `font`: Base font for the Editor to use. Default `None`
* `color_scheme`: Initial color scheme for the Editor to use. Default `None`
* `wrap`: Enable/Disable line wrap. Default `False`
* `tab_mode`: Enable/Disable using Tab as delimiter between word, Default `True`
* `strip_mode`: Default `False`
* `intelligent_backspace`: Default `True`
* `automatic_completions`: Enable/Disable automatic completions. The behavior of the trigger of this the completions can be stablished with the two following kwargs. Default `True`
* `automatic_completions_after_chars`: Number of charts to type to trigger an automatic completion. Default `3`
* `automatic_completions_after_ms`: Number of milliseconds to pass before an autocompletion is triggered. Default `300`
* `completions_hint`: Enable/Disable documentation hints for completions. Default True,
* `completions_hint_after_ms`: Number of milliseconds over a completion item to show the documentation hint. Default 500
* `hover_hints`: Enable/Disable documentation hover hints. Default `True`
* `code_snippets`: Enable/Disable code snippets completions. Default `True`
* `highlight_current_line`: Enable/Disable current line highlighting. Default `True`
* `highlight_current_cell`: Enable/Disable current cell highlighting. Default `True`
* `occurrence_highlighting`: Default `True`
* `scrollflagarea`: Default `True`
* `edge_line`: Enable/Disable vertical line to show max number of characters per line. Customizable number of columns in the following kwarg. Default `True`
* `edge_line_columns`: Number of columns/characters where the editor horizontal edge line will show. Default `(79,)`
* `show_blanks`: Enable/Disable blanks highlighting. Default `False`
* `underline_errors`: Enable/Disable showing and underline to highlight errors. Default `False`
* `close_parentheses`: Enable/Disable automatic parentheses closing insertion. Default `True`
* `close_quotes`: Enable/Disable automatic closing of quotes . Default `False`
* `add_colons`: Enable/Disable automatic addition of colons. Default `True`
* `auto_unindent`: Default `True`
* `indent_chars`: Characters to use for indentation. Default `" "*4`
* `tab_stop_width_spaces`: Default `4`
* `cloned_from`: Editor instance used as template to instantiate this CodeEditor instance. Default `None`
* `filename`: Initial filename to show. Default `None`
* `occurrence_timeout`: Default `1500`
* `show_class_func_dropdown`: Enable/Disable a Matlab like widget to show classes and functions available in the current file. Default `False`
* `indent_guides`: Enable/Disable highlighting of code indentation. Default `False`
* `scroll_past_end`: Enable/Disable possibility to scroll file passed its end. Default `False`
* `debug_panel`: Enable/Disable debug panel. Default `True`
* `folding`: Enable/Disable code folding. Default `True`

There are some options which explanation/description is missing, but maybe @ccordoba12 @goanpeca or @andfoy could help (pinging them to check the list to complete it, and possible corrections/improvements to the ones I did).
> There are some options which explanation/description missing

What options @dalthviz?
@ccordoba12 the ones I just put `Default <value>` like:

* `occurence_timeout`
* `tab_stop_width_spaces`
* `auto_unindent`
* `scrollflagarea`
* `strip_mode` -> probably related with `tab_mode`?
* `occurrence_highlighting`
* `intelligent_backspace`

Thanks @dalthviz for the explanation.
@ccordoba12 Waiting for your response on the above comment.
@dalthviz, please dig into the code and find what the missing parameters do (I don't have time to do that myself).
@Akashtyagi08 the missing initial descriptions:

* `occurrence_timeout` : Timeout in milliseconds to start highlighting matches/occurrences for the current word under the cursor. Default `1500` ms.
* `tab_stop_width_spaces`: Enable/Disable using tabs for indentation. Default `True`
* `auto_unindent`: Enable/Disable automatically unindentation before `else`, `elif`, `finally` or `except` statements. Default `True`
* `scrollflagarea` : Enable/Disable flag area that shows at the left of the scroll bar. Default `True`
* `strip_mode`: Enable/Disable striping trailing spaces when modifying the file. Default `False` 
* `occurrence_highlighting`: Enable/Disable highlighting of current word occurrence in the file
* `intelligent_backspace`: Enable/Disable automatically unindenting inserted text (unindenting happens if the leading text length of the line isn't module of the length of indentation chars being use). Default `True`
Working on it.
> * `tab_stop_width_spaces`: Enable/Disable using tabs for indentation. Default `True`

@dalthviz This seems to be a numerical parameter rather than Boolean.
Totally right @Akashtyagi08 ! Actually for that it should be something like:

* `tab_stop_width_spaces`: Number of spaces a tab is equivalent. Default `4`

Resolving patch:
diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py
--- a/spyder/plugins/editor/widgets/codeeditor.py
+++ b/spyder/plugins/editor/widgets/codeeditor.py
@@ -832,6 +832,81 @@ def setup_editor(self,
                      scroll_past_end=False,
                      debug_panel=True,
                      folding=True):
+        """
+        Set-up configuration for the CodeEditor instance.
+
+        Usually the parameters here are related with a configurable preference
+        in the Preference Dialog and Editor configurations:
+
+        linenumbers: Enable/Disable line number panel. Default True.
+        language: Set editor language for example python. Default None.
+        markers: Enable/Disable markers panel. Used to show elements like
+            Code Analysis. Default False.
+        font: Base font for the Editor to use. Default None.
+        color_scheme: Initial color scheme for the Editor to use. Default None.
+        wrap: Enable/Disable line wrap. Default False.
+        tab_mode: Enable/Disable using Tab as delimiter between word,
+            Default True.
+        strip_mode: strip_mode: Enable/Disable striping trailing spaces when
+            modifying the file. Default False.
+        intelligent_backspace: Enable/Disable automatically unindenting
+            inserted text (unindenting happens if the leading text length of
+            the line isn't module of the length of indentation chars being use)
+            Default True.
+        automatic_completions: Enable/Disable automatic completions.
+            The behavior of the trigger of this the completions can be
+            established with the two following kwargs. Default True.
+        automatic_completions_after_chars: Number of charts to type to trigger
+            an automatic completion. Default 3.
+        automatic_completions_after_ms: Number of milliseconds to pass before
+            an autocompletion is triggered. Default 300.
+        completions_hint: Enable/Disable documentation hints for completions.
+            Default True.
+        completions_hint_after_ms: Number of milliseconds over a completion
+            item to show the documentation hint. Default 500.
+        hover_hints: Enable/Disable documentation hover hints. Default True.
+        code_snippets: Enable/Disable code snippets completions. Default True.
+        highlight_current_line: Enable/Disable current line highlighting.
+            Default True.
+        highlight_current_cell: Enable/Disable current cell highlighting.
+            Default True.
+        occurrence_highlighting: Enable/Disable highlighting of current word
+            occurrence in the file. Default True.
+        scrollflagarea : Enable/Disable flag area that shows at the left of
+            the scroll bar. Default True.
+        edge_line: Enable/Disable vertical line to show max number of
+            characters per line. Customizable number of columns in the
+            following kwarg. Default True.
+        edge_line_columns: Number of columns/characters where the editor
+            horizontal edge line will show. Default (79,).
+        show_blanks: Enable/Disable blanks highlighting. Default False.
+        underline_errors: Enable/Disable showing and underline to highlight
+            errors. Default False.
+        close_parentheses: Enable/Disable automatic parentheses closing
+            insertion. Default True.
+        close_quotes: Enable/Disable automatic closing of quotes.
+            Default False.
+        add_colons: Enable/Disable automatic addition of colons. Default True.
+        auto_unindent: Enable/Disable automatically unindentation before else,
+            elif, finally or except statements. Default True.
+        indent_chars: Characters to use for indentation. Default " "*4.
+        tab_stop_width_spaces: Enable/Disable using tabs for indentation.
+            Default 4.
+        cloned_from: Editor instance used as template to instantiate this
+            CodeEditor instance. Default None.
+        filename: Initial filename to show. Default None.
+        occurrence_timeout : Timeout in milliseconds to start highlighting
+            matches/occurrences for the current word under the cursor.
+            Default 1500 ms.
+        show_class_func_dropdown: Enable/Disable a Matlab like widget to show
+            classes and functions available in the current file. Default False.
+        indent_guides: Enable/Disable highlighting of code indentation.
+            Default False.
+        scroll_past_end: Enable/Disable possibility to scroll file passed
+            its end. Default False.
+        debug_panel: Enable/Disable debug panel. Default True.
+        folding: Enable/Disable code folding. Default True.
+        """
 
         self.set_close_parentheses_enabled(close_parentheses)
         self.set_close_quotes_enabled(close_quotes)


Test patch: