internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: spyder-ide/spyder

Issue:
Highlighting does not work for terminal-style completions in the iPython console
### Problem Description
When terminal-style completion is enabled, tab-completing in an iPython console should highlight the entries and allow scrolling and selection with the arrow keys.  The scrolling and selection is working, but the highlighting is invisible.

### What steps reproduce the problem?
Settings, iPython console, Completion: Terminal
Open iPython console.
type: `list.__<tab><tab>`
The list of completions comes up.
type: `<Down><Down><Down>`
Highlighting is not visible.  If you hit `<Down>` enough times it will scroll the list, showing that the selection really is there, just invisible.

### What is the expected output? What do you see instead?

In v3.1.4 the same steps will show the entries being highlighted.

## Versions
Good: v3.1.4
Bad: v3.2.0 through current


Discussion:

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole/utils/style.py b/spyder/plugins/ipythonconsole/utils/style.py
--- a/spyder/plugins/ipythonconsole/utils/style.py
+++ b/spyder/plugins/ipythonconsole/utils/style.py
@@ -74,8 +74,8 @@ def give_font_style(is_italic):
                                    in_prompt_number_font_weight,
                                    out_prompt_color, out_prompt_color,
                                    out_prompt_number_font_weight,
-                                   inverted_background_color,
-                                   inverted_font_color)
+                                   inverted_font_color,
+                                   inverted_background_color)
 
     return (sheet_formatted, dark_color(font_color))
 


Test patch:
Repository: spyder-ide/spyder

Issue:
TypeError when changing monitors
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

If I change my monitor input, spyder crashes. no way to replicate it on github, but it cant seem to handle resolution changes.

### Traceback
```python-traceback
  File "/opt/anaconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 1393, in handle_new_screen
    self.show_dpi_change_message)
TypeError: 'method' object is not connected
```

## Versions

* Spyder version: 4.1.1 
* Python version: 3.7.0
* Qt version: 5.12.5
* PyQt5 version: 5.12.3
* Operating System: Darwin 19.2.0

### Dependencies

```

# Mandatory:
applaunchservices >=0.1.7      :  0.2.1 (OK)
atomicwrites >=1.2.0           :  1.3.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.3.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.13.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.9 (OK)
qdarkstyle >=2.8               :  2.8 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.1 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  2.4.4 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  19.0.0 (OK)

# Optional:
cython >=0.21                  :  0.29.15 (OK)
matplotlib >=2.0.0             :  3.1.3 (OK)
numpy >=1.7                    :  1.17.4 (OK)
pandas >=0.13.1                :  0.25.3 (OK)
scipy >=0.17.0                 :  1.4.1 (OK)
sympy >=0.7.3                  :  None (OK)
```



Discussion:
Thanks for reporting. We'll fix this in our next release.
@dalthviz, please catch the `TypeError` above in a try/except.

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -1389,8 +1389,12 @@ def post_visible_setup(self):
 
     def handle_new_screen(self, screen):
         """Connect DPI signals for new screen."""
-        self.screen.logicalDotsPerInchChanged.disconnect(
-            self.show_dpi_change_message)
+        try:
+            self.screen.logicalDotsPerInchChanged.disconnect(
+                self.show_dpi_change_message)
+        except TypeError:
+            # See spyder-ide/spyder#11903
+            pass
         self.screen = screen
         self.screen.logicalDotsPerInchChanged.connect(
             self.show_dpi_change_message)


Test patch:
Repository: spyder-ide/spyder

Issue:
spyder-kernels dependency not correctly detected for dev version
Dependencies are not correctly detected when the installed version has a string after the last number. 
In this case I am trying to use the git version of spyder and spyder_kernels, the required version of spyder_kernels is ">=1.9.0;<1.10.0" and it is not satisfied by "2.0.0.dev0".

I believe this has to do with utils/programs/check_version.

Reproducible w/ Arch AUR packages python-spyder-kernels-git and spyder3-git (there are no official spyder4 packages on Arch atm.)


Discussion:
I had the same issue, it is because spyder imports spyder_kernel from `external-deps/spyder-kernels` and not from the pip installation (which for me is 1.9.0). 

It is definitely not the good solution but removing the folder `external-deps/spyder-kernels` & all `__pycache__`  work for me... until the next git pull.
> Dependencies are not correctly detected when the installed version has a string after the last number.

I haven't had time to update our git subrepo, that's all.

> It is definitely not the good solution but removing the folder external-deps/spyder-kernels

If you want to use Spyder from git, please **do not** do that ever again. It's there for a reason. Then people wonder why things break so badly.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -234,6 +234,7 @@ def run(self):
     'qtconsole>=4.6.0',
     'qtpy>=1.5.0',
     'sphinx>=0.6.6',
+    # Don't forget to update this to >=2.0 for Spyder 5!
     'spyder-kernels>=1.9.0,<1.10.0',
     'watchdog',
 ]
diff --git a/spyder/dependencies.py b/spyder/dependencies.py
--- a/spyder/dependencies.py
+++ b/spyder/dependencies.py
@@ -56,7 +56,7 @@
 QTPY_REQVER = '>=1.5.0'
 RTREE_REQVER = '>=0.8.3'
 SPHINX_REQVER = '>=0.6.6'
-SPYDER_KERNELS_REQVER = '>=1.9.0;<1.10.0'
+SPYDER_KERNELS_REQVER = '>=2.0.0dev0'
 WATCHDOG_REQVER = None
 
 
diff --git a/spyder/plugins/ipythonconsole/plugin.py b/spyder/plugins/ipythonconsole/plugin.py
--- a/spyder/plugins/ipythonconsole/plugin.py
+++ b/spyder/plugins/ipythonconsole/plugin.py
@@ -680,12 +680,12 @@ def create_new_client(self, give_focus=True, filename='', is_cython=False,
             has_spyder_kernels = programs.is_module_installed(
                 'spyder_kernels',
                 interpreter=pyexec,
-                version='>=1.9.0;<1.10.0')
+                version='>=2.0.0.dev0')
             if not has_spyder_kernels and not running_under_pytest():
                 client.show_kernel_error(
                     _("Your Python environment or installation doesn't have "
                       "the <tt>spyder-kernels</tt> module or the right "
-                      "version of it installed (>= 1.9.0 and < 1.10.0). "
+                      "version of it installed (>= 2.0.0dev0). "
                       "Without this module is not possible for Spyder to "
                       "create a console for you.<br><br>"
                       "You can install it by running in a system terminal:"


Test patch:
Repository: spyder-ide/spyder

Issue:
An issue with the "File Association" example in the settings
## Problem Description
When adding file associations, the example in the pop-up dialog "x.json,x,csv" should be "x.json,x.csv".(I don’t know how to enter the star symbol, sometimes it is displayed successfully, sometimes it is not displayed)

Same for edit dialog!

![image](https://user-images.githubusercontent.com/1759365/77279046-da1ac500-6cfb-11ea-8826-5a33e963783b.png)

### What steps reproduce the problem?

Click Preferences-Files-File Associations-File Types Add

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 4.1.1
* Python version: 3.7.5
* Qt version: 5.9.6
* PyQt version: 5.9.2
* Operating System name/version: win10



Discussion:
> I don’t know how to enter the star symbol, sometimes it is displayed successfully, sometimes it is not displayed

This is probably an issue because you're using a Chinese version of Windows. Please confirm.
> > I don’t know how to enter the star symbol, sometimes it is displayed successfully, sometimes it is not displayed
> 
> This is probably an issue because you're using a Chinese version of Windows. Please confirm.

I mean enter the star symbol in the edit box of github issue, so I use "x" instead when describing the problem.
Please see my screenshot, an example of file association. Obviously, the comma in front of csv should be a dot.
This is just a display issue
Oh, I see. I understand now. We'll fix it in a future release.

Resolving patch:
diff --git a/spyder/plugins/explorer/widgets/fileassociations.py b/spyder/plugins/explorer/widgets/fileassociations.py
--- a/spyder/plugins/explorer/widgets/fileassociations.py
+++ b/spyder/plugins/explorer/widgets/fileassociations.py
@@ -424,7 +424,7 @@ def _create_association_dialog(self):
                 _('Enter new file extension. You can add several values '
                   'separated by commas.<br>Examples include:')
                 + '<ul><li><code>*.txt</code></li>'
-                + '<li><code>*.json,*,csv</code></li>'
+                + '<li><code>*.json,*.csv</code></li>'
                 + '<li><code>*.json,README.md</code></li></ul>'
             ),
         )


Test patch:
Repository: spyder-ide/spyder

Issue:
Shortcuts on tips not adapted to platform
On Mac, Ctrl should become Cmd (with the correct symbol)

Currently we have:

![image](https://user-images.githubusercontent.com/3627835/78568761-31cf2b00-77e8-11ea-96f8-8eb0db2371d9.png)



Discussion:

Resolving patch:
diff --git a/spyder/utils/qthelpers.py b/spyder/utils/qthelpers.py
--- a/spyder/utils/qthelpers.py
+++ b/spyder/utils/qthelpers.py
@@ -27,7 +27,7 @@
 from spyder.config.base import get_image_path, MAC_APP_NAME
 from spyder.config.manager import CONF
 from spyder.config.gui import is_dark_interface
-from spyder.py3compat import is_text_string, to_text_string, PY2
+from spyder.py3compat import configparser, is_text_string, to_text_string, PY2
 from spyder.utils import icon_manager as ima
 from spyder.utils import programs
 from spyder.utils.icon_manager import get_icon, get_std_icon
@@ -327,8 +327,18 @@ def add_shortcut_to_tooltip(action, context, name):
         # are changed by the user over the course of the current session.
         # See spyder-ide/spyder#10726.
         action._tooltip_backup = action.toolTip()
-    action.setToolTip(action._tooltip_backup + ' (%s)' %
-                      CONF.get_shortcut(context=context, name=name))
+
+    try:
+        # Some shortcuts might not be assigned so we need to catch the error
+        shortcut = CONF.get_shortcut(context=context, name=name)
+    except (configparser.NoSectionError, configparser.NoOptionError):
+        shortcut = None
+
+    if shortcut:
+        keyseq = QKeySequence(shortcut)
+        # See: spyder-ide/spyder#12168
+        string = keyseq.toString(QKeySequence.NativeText)
+        action.setToolTip(u'{0} ({1})'.format(action._tooltip_backup, string))
 
 
 def add_actions(target, actions, insert_before=None):


Test patch:
Repository: spyder-ide/spyder

Issue:
If main window is closed with undocked panes, those are not shown during the next session
I undocked the Plots pane - when restarted Spyder, it was no longer where it was previously docked (or in any other window; had to Tools -> Panes -> Plots). Bug or feature? If latter, it'd help to have an option to have Spyder dock to latest position after undock + restart.


Discussion:
Oh, actually the pane docks itself back if closed before shutting down Spyder itself - better, but can be a slight nuisance with a taskbar salad.

So maybe it should read "Close undocked panes before closing Spyder"
@andfoy, please take a look at this one. The idea is to close all undocked windows before closing the main one.
> The idea is to close all undocked windows before closing the main one.

It seems that we're already doing this:
https://github.com/spyder-ide/spyder/blob/d6e2e849b1969e531aad65f7b9afcf439726bbbd/spyder/app/mainwindow.py#L2477

https://github.com/spyder-ide/spyder/blob/d6e2e849b1969e531aad65f7b9afcf439726bbbd/spyder/plugins/base.py#L338
@andfoy [demo.mp4](https://puu.sh/FwzCO/ca76b9d91c.mp4) of what I'm seeing

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -2461,26 +2461,38 @@ def closing(self, cancelable=False):
         """Exit tasks"""
         if self.already_closed or self.is_starting_up:
             return True
+
         if cancelable and CONF.get('main', 'prompt_on_exit'):
             reply = QMessageBox.critical(self, 'Spyder',
                                          'Do you really want to exit?',
                                          QMessageBox.Yes, QMessageBox.No)
             if reply == QMessageBox.No:
                 return False
-        prefix = 'window' + '/'
-        self.save_current_window_settings(prefix)
+
         if CONF.get('main', 'single_instance') and self.open_files_server:
             self.open_files_server.close()
+
         if not self.completions.closing_plugin(cancelable):
             return False
+
         for plugin in (self.widgetlist + self.thirdparty_plugins):
             plugin._close_window()
             if not plugin.closing_plugin(cancelable):
                 return False
+
+        # Save window settings *after* closing all plugin windows, in order
+        # to show them in their previous locations in the next session.
+        # Fixes spyder-ide/spyder#12139
+        prefix = 'window' + '/'
+        self.save_current_window_settings(prefix)
+
         self.dialog_manager.close_all()
+
         if self.toolbars_visible:
             self.save_visible_toolbars()
+
         self.completions.shutdown()
+
         self.already_closed = True
         return True
 


Test patch:
Repository: spyder-ide/spyder

Issue:
Spyder is opening bootstrap.py when using "python bootstrap.py"
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

I think that this issue is from #11704.
That PR changed "CLI_OPTIONS, CLI_ARGS = get_options()" to "CLI_OPTIONS, CLI_ARGS = get_options(sys_argv)" of 108 line of mainwindow.py


I am sorry if it was the problem you intended or already knew.
Have a nice day.

![bootstrap](https://user-images.githubusercontent.com/22970578/79164699-8c860980-7e1c-11ea-854b-a6ba424ac9d5.gif)



## Versions

* Spyder version: 5.0.0.dev0 856a88456
* Python version: 3.7.6
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Linux 4.15.0-96-generic

### Dependencies

```

# Mandatory:
atomicwrites >=1.2.0        :  1.3.0 (OK)
chardet >=2.0.0             :  3.0.4 (OK)
cloudpickle >=0.5.0         :  1.3.0 (OK)
diff_match_patch >=20181111 :  20181111 (OK)
intervaltree                :  None (OK)
IPython >=4.0               :  7.13.0 (OK)
jedi =0.15.2                :  0.15.2 (OK)
keyring                     :  None (OK)
nbconvert >=4.0             :  5.6.1 (OK)
numpydoc >=0.6.0            :  0.9.2 (OK)
parso =0.5.2                :  0.5.2 (OK)
pexpect >=4.4.0             :  4.8.0 (OK)
pickleshare >=0.4           :  0.7.5 (OK)
psutil >=5.3                :  5.7.0 (OK)
pygments >=2.0              :  2.6.1 (OK)
pylint >=0.25               :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0       :  0.31.9 (OK)
qdarkstyle >=2.8            :  2.8 (OK)
qtawesome >=0.5.7           :  0.7.0 (OK)
qtconsole >=4.6.0           :  4.7.2 (OK)
qtpy >=1.5.0                :  1.9.0 (OK)
rtree >=0.8.3               :  0.9.3 (OK)
sphinx >=0.6.6              :  2.4.4 (OK)
spyder_kernels >=2.0.0dev0  :  2.0.0.dev0 (OK)
watchdog                    :  None (OK)
xdg >=0.26                  :  0.26 (OK)
zmq >=17                    :  18.1.1 (OK)

# Optional:
cython >=0.21               :  0.29.15 (OK)
matplotlib >=2.0.0          :  3.1.3 (OK)
numpy >=1.7                 :  1.18.1 (OK)
pandas >=0.13.1             :  1.0.3 (OK)
scipy >=0.17.0              :  1.4.1 (OK)
sympy >=0.7.3               :  1.5.1 (OK)
```



Discussion:

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -109,9 +109,9 @@
 # Ignore args if running tests or Spyder will try and fail to parse pytests's.
 if running_under_pytest():
     sys_argv = [sys.argv[0]]
+    CLI_OPTIONS, CLI_ARGS = get_options(sys_argv)
 else:
-    sys_argv = sys.argv
-CLI_OPTIONS, CLI_ARGS = get_options(sys_argv)
+    CLI_OPTIONS, CLI_ARGS = get_options()
 
 # **** Set OpenGL implementation to use ****
 if CLI_OPTIONS.opengl_implementation:


Test patch:
Repository: spyder-ide/spyder

Issue:
Don't save files as ascii in the editor if there's no coding line
Right now we have the following problems with these operations, that could be causing issues with our LSP architecture:

* Files that don't have the initial `coding` line (i.e. `# -*- coding: utf-8 -*-`) are saved as ascii. Instead, we should be save them as unicode, as VSCode does.

    I've seen that a lot of people remove all contents from our template before starting to code, which causes this issue.

* Our process to load files from the previous session or after opening a project is very convoluted (it seems we're opening and closing those files several times), and that can confuse LSP servers a lot. Instead we should simply open files once.

    This problem could have been introduced in PR https://github.com/spyder-ide/spyder/pull/3858

@andfoy, please take a look at this one.


Discussion:
We could disable the repaints on the widget so that it remains "static" while other files load? 

Also, opening files on startup has a noticeable lag.

Opening 10 o 20 files should not feel stucked on every file. If we are doing some GUI blocking stuff on each file on open we should defer them until the file is focused.

Resolving patch:
diff --git a/spyder/utils/encoding.py b/spyder/utils/encoding.py
--- a/spyder/utils/encoding.py
+++ b/spyder/utils/encoding.py
@@ -209,12 +209,6 @@ def encode(text, orig_coding):
         except (UnicodeError, LookupError):
             pass
 
-    # Try saving as ASCII
-    try:
-        return text.encode('ascii'), 'ascii'
-    except UnicodeError:
-        pass
-
     # Save as UTF-8 without BOM
     return text.encode('utf-8'), 'utf-8'
 


Test patch:
Repository: spyder-ide/spyder

Issue:
Change text for collapse and expand selection, remove restore in Code Analysis pane



Discussion:

Resolving patch:
diff --git a/spyder/widgets/onecolumntree.py b/spyder/widgets/onecolumntree.py
--- a/spyder/widgets/onecolumntree.py
+++ b/spyder/widgets/onecolumntree.py
@@ -61,16 +61,19 @@ def setup_common_actions(self):
                                      tip=_('Restore original tree layout'),
                                      icon=ima.icon('restore'),
                                      triggered=self.restore)
-        self.collapse_selection_action = create_action(self,
-                                     text=_('Collapse selection'),
-                                     icon=ima.icon('collapse_selection'),
-                                     triggered=self.collapse_selection)
-        self.expand_selection_action = create_action(self,
-                                     text=_('Expand selection'),
-                                     icon=ima.icon('expand_selection'),
-                                     triggered=self.expand_selection)
-        return [self.collapse_all_action, self.expand_all_action,
-                self.restore_action, None,
+        self.collapse_selection_action = create_action(
+            self,
+            text=_('Collapse section'),
+            icon=ima.icon('collapse_selection'),
+            triggered=self.collapse_selection
+        )
+        self.expand_selection_action = create_action(
+            self,
+            text=_('Expand section'),
+            icon=ima.icon('expand_selection'),
+            triggered=self.expand_selection
+        )
+        return [self.collapse_all_action, self.expand_all_action, None,
                 self.collapse_selection_action, self.expand_selection_action]
 
     def get_menu_actions(self):


Test patch:
Repository: spyder-ide/spyder

Issue:
Change menu item to run code analysis

<!--- **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

* [ ] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [ ] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [ ] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [ ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [ ] Tried basic troubleshooting (if a bug/error)
    * [ ] Restarted Spyder
    * [ ] Reset preferences with ``spyder --reset``
    * [ ] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [ ] Tried the other applicable steps from the Troubleshooting Guide
* [ ] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description

The name of the pane was changed so this menu item should be changed too to match the name of the pane. 

![Screen Shot 2020-05-13 at 9 14 36 PM](https://user-images.githubusercontent.com/18587879/81885308-b471a580-955f-11ea-88dd-5b552f25e7c1.png)

### What steps reproduce the problem?

1. 
2. 
3. 

### What is the expected output? What do you see instead?



### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 
* Python version: 
* Qt version: 
* PyQt version: 
* Operating System name/version: 

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:

Resolving patch:
diff --git a/spyder/plugins/pylint/plugin.py b/spyder/plugins/pylint/plugin.py
--- a/spyder/plugins/pylint/plugin.py
+++ b/spyder/plugins/pylint/plugin.py
@@ -105,7 +105,7 @@ def register_plugin(self):
             self.main.redirect_internalshell_stdio)
         self.add_dockwidget()
 
-        pylint_act = create_action(self, _("Run static code analysis"),
+        pylint_act = create_action(self, _("Run code analysis"),
                                    triggered=self.run_pylint)
         pylint_act.setEnabled(is_module_installed('pylint'))
         self.register_shortcut(pylint_act, context="Pylint",


Test patch: