-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4975 from rlaverde/split-editor
PR: Split Editor module
- Loading branch information
Showing
43 changed files
with
165 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# (see spyder/__init__.py for details) | ||
|
||
""" | ||
Language utilities | ||
""" | ||
|
||
ALL_LANGUAGES = { | ||
'Python': ('py', 'pyw', 'python', 'ipy'), | ||
'Cython': ('pyx', 'pxi', 'pxd'), | ||
'Enaml': ('enaml',), | ||
'Fortran77': ('f', 'for', 'f77'), | ||
'Fortran': ('f90', 'f95', 'f2k'), | ||
'Idl': ('pro',), | ||
'Diff': ('diff', 'patch', 'rej'), | ||
'GetText': ('po', 'pot'), | ||
'Nsis': ('nsi', 'nsh'), | ||
'Html': ('htm', 'html'), | ||
'Cpp': ('c', 'cc', 'cpp', 'cxx', 'h', 'hh', 'hpp', 'hxx'), | ||
'OpenCL': ('cl',), | ||
'Yaml': ('yaml', 'yml'), | ||
"Markdown": ('md', ), | ||
} | ||
|
||
PYTHON_LIKE_LANGUAGES = ('Python', 'Cython', 'Enaml') | ||
|
||
CELL_LANGUAGES = {'Python': ('#%%', '# %%', '# <codecell>', '# In[')} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# (see spyder/__init__.py for details) | ||
|
||
""" | ||
spyder.plugins.editor.widgets | ||
============================= | ||
Editor related widgets (Editor,EditorStack, CodeEditor) based exclusively on Qt | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# | ||
|
||
""" | ||
Testing utilities to be used with pytest. | ||
""" | ||
|
||
try: | ||
from unittest.mock import Mock | ||
except ImportError: | ||
from mock import Mock # Python 2 | ||
|
||
# Third party imports | ||
import pytest | ||
|
||
# Local imports | ||
from spyder.plugins.editor.widgets.editor import EditorStack | ||
from spyder.widgets.findreplace import FindReplace | ||
|
||
|
||
@pytest.fixture | ||
def setup_editor(qtbot): | ||
""" | ||
Set up EditorStack with CodeEditor containing some Python code. | ||
The cursor is at the empty line below the code. | ||
Returns tuple with EditorStack and CodeEditor. | ||
""" | ||
text = ('a = 1\n' | ||
'print(a)\n' | ||
'\n' | ||
'x = 2') # a newline is added at end | ||
editorStack = EditorStack(None, []) | ||
editorStack.set_introspector(Mock()) | ||
editorStack.set_find_widget(FindReplace(editorStack)) | ||
editorStack.set_io_actions(Mock(), Mock(), Mock(), Mock()) | ||
finfo = editorStack.new('foo.py', 'utf-8', text) | ||
qtbot.addWidget(editorStack) | ||
return editorStack, finfo.editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.