Repository: spyder-ide/spyder

Issue:
LSP services don't work in any split Editor pane but the first (left/topmost) one
<!--- **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! --->

## Problem Description

Any LSP services (completion, help, calltips, realtime analysis, etc) don't appear to work in any pane but the first (top/leftmost) one.

I can repro it consistently from starting from ``--safe-mode`` just by opening an empty file, typing ``import numpy as np`` and e.g. trying to get help and completions from there. I do get analysis/warning icons mirrored in the right file if I change a line on the left, but they don't get updated in either if I make changes on the right.

With regard to the logs, I get a big block of output when typing or triggering ``Tab`` completion in the left pane in all three of the Spyder log, ``client-python.log`` and ``server-python.log`` in the left pane, where LSP services work, but in the right pane (non-working), nothing gets written to the two LSP logs either when typing or hitting ``Tab``, and I get no output for the latter in the Spyder log and just the following for the former:

<details>

```
[DEBUG] [spyder.plugins.editor.widgets.editor] -Added thread <spyder.plugins.editor.widgets.editor.AnalysisThread object at 0x0000007E7144F438to queue
[DEBUG] [spyder.plugins.editor.widgets.editor] -Added thread <spyder.plugins.editor.widgets.editor.AnalysisThread object at 0x0000007E714411F8to queue
[DEBUG] [spyder.plugins.editor.widgets.editor] -Updating queue:
[DEBUG] [spyder.plugins.editor.widgets.editor] -    started: 0
[DEBUG] [spyder.plugins.editor.widgets.editor] -    pending: 1
[DEBUG] [spyder.plugins.editor.widgets.editor] -===>starting: <spyder.plugins.editor.widgets.editor.AnalysisThread object at 0x0000007E7144F438>
[DEBUG] [spyder.plugins.editor.widgets.editor] -Updating queue:
[DEBUG] [spyder.plugins.editor.widgets.editor] -    started: 0
[DEBUG] [spyder.plugins.editor.widgets.editor] -    pending: 1
[DEBUG] [spyder.plugins.editor.widgets.editor] -===>starting: <spyder.plugins.editor.widgets.editor.AnalysisThread object at 0x0000007E714411F8>
[DEBUG] [spyder.plugins.editor.widgets.editor] -Updating queue:
[DEBUG] [spyder.plugins.editor.widgets.editor] -    started: 0
[DEBUG] [spyder.plugins.editor.widgets.editor] -    pending: 0
[DEBUG] [spyder.plugins.editor.widgets.editor] -Updating queue:
[DEBUG] [spyder.plugins.editor.widgets.editor] -    started: 0
[DEBUG] [spyder.plugins.editor.widgets.editor] -    pending: 0
```

</details>


### What steps reproduce the problem?

1. Open a horizontally or vertical split pane
2. Try help/completion/etc in the new pane (doesn't work)
3. Try it in the original pane 


## Versions

* Spyder version: 4.0.0.dev0 ``386403ed52``
* Python version: 3.7.2
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Windows 8.1

### Dependencies

```
pygments >=2.0    :  2.3.1 (OK)
qdarkstyle >=2.6.4:  2.6.5 (OK)
sphinx >=0.6.6    :  1.8.4 (OK)
pyls >=0.19.0     :  0.21.5 (OK)
nbconvert >=4.0   :  5.4.0 (OK)
pandas >=0.13.1   :  0.24.1 (OK)
numpy >=1.7       :  1.15.4 (OK)
sympy >=0.7.3     :  1.3 (OK)
cython >=0.21     :  0.29.4 (OK)
qtconsole >=4.2.0 :  4.4.3 (OK)
IPython >=4.0     :  7.2.0 (OK)
matplotlib >=2.0.0:  3.0.2 (OK)
pylint >=0.25     :  2.2.2 (OK)
```



Discussion:
@ccordoba12 I think I can fix this one, maybe it is related to the LSP signal connections when a ``EditorStack`` is created
Thanks a lot @andfoy!! I was thinking exactly the same.
Thanks @andfoy !

Resolving patch:
diff --git a/spyder/plugins/editor/widgets/editor.py b/spyder/plugins/editor/widgets/editor.py
--- a/spyder/plugins/editor/widgets/editor.py
+++ b/spyder/plugins/editor/widgets/editor.py
@@ -2351,16 +2351,14 @@ def create_new_editor(self, fname, enc, txt, set_current, new=False,
         # Needs to reset the highlighting on startup in case the PygmentsSH
         # is in use
         editor.run_pygments_highlighter()
-
-        if cloned_from is None:
-            options = {
-                'language': editor.language,
-                'filename': editor.filename,
-                'codeeditor': editor
-            }
-            self.sig_open_file.emit(options)
-            if self.get_stack_index() == 0:
-                self.current_changed(0)
+        options = {
+            'language': editor.language,
+            'filename': editor.filename,
+            'codeeditor': editor
+        }
+        self.sig_open_file.emit(options)
+        if self.get_stack_index() == 0:
+            self.current_changed(0)
 
         return finfo
 


Test patch: