Skip to content
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

PR: Migrate the Outline Explorer to use LSP information #13109

Merged
merged 33 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
274d63e
Compute diff between symbols across codeeditor changes
andfoy Jun 26, 2020
3e5b917
Merge remote-tracking branch 'upstream/4.x' into outline_explorer_lsp
andfoy Jun 26, 2020
c2b4edd
Remove f-string
andfoy Jun 26, 2020
8e214bf
Manage to display symbols in the outline explorer
andfoy Jul 2, 2020
57d8ec5
Fix tree update logic
andfoy Jul 8, 2020
9d028b0
Re-enable click and cursor following functions
andfoy Jul 8, 2020
6a17888
Remove semicolons
andfoy Jul 8, 2020
a9416e4
Fix style issues
andfoy Jul 9, 2020
3643eb4
Remove f-strings
andfoy Jul 9, 2020
a3092c3
Fix switching regression
andfoy Jul 9, 2020
cd24ec2
Update widget tests
andfoy Jul 10, 2020
ff46a9b
Add LSP + OutlineExplorer test
andfoy Jul 14, 2020
dbd6705
Remove tests
andfoy Jul 14, 2020
c18dd73
Mark test as second
andfoy Jul 14, 2020
c70aff6
Remove extra text that cannot be retrieved without LSP
andfoy Jul 14, 2020
8e6950a
Merge remote-tracking branch 'upstream/4.x' into outline_explorer_lsp
andfoy Jul 14, 2020
f26e684
Remove more unused strings
andfoy Jul 14, 2020
b109e06
Merge remote-tracking branch 'upstream/4.x' into outline_explorer_lsp
andfoy Aug 24, 2020
8864403
Skip module definitions on Python
andfoy Aug 25, 2020
83b6c5b
git subrepo clone --branch=fix_method_attribute_symbols --force https…
andfoy Aug 26, 2020
59d0d31
Remove os and sys
andfoy Sep 2, 2020
bbfedb8
Merge remote-tracking branch 'upstream/4.x' into outline_explorer_lsp
andfoy Sep 2, 2020
b87ebf3
Add loading spinner and fix issues with multi-line class imports
andfoy Sep 4, 2020
139a401
git subrepo clone --branch=fix_method_attribute_symbols --force https…
andfoy Sep 4, 2020
0a8fb3e
git subrepo clone --branch=fix_method_attribute_symbols --force https…
andfoy Sep 4, 2020
f064378
Remove commented sections
andfoy Sep 4, 2020
141473f
Merge remote-tracking branch 'upstream/4.x' into outline_explorer_lsp
andfoy Sep 4, 2020
08ef147
Do not include imports as part of tests
andfoy Sep 4, 2020
0faf0a6
Set include import symbols option to Fals
andfoy Sep 12, 2020
da7ab18
git subrepo clone --branch=fix_method_attribute_symbols --force https…
andfoy Sep 12, 2020
772425a
git subrepo clone --branch=fix_method_attribute_symbols --force https…
andfoy Sep 12, 2020
b1ed973
git subrepo clone --branch=develop --force https://github.com/palanti…
ccordoba12 Sep 16, 2020
a3258a3
Merge branch '4.x' into outline_explorer_lsp
ccordoba12 Sep 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions spyder/plugins/completion/languageserver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,39 @@ class InsertTextFormat:
PLAIN_TEXT = 1
SNIPPET = 2


# ----------------- DOCUMENT SYMBOL RELATED VALUES ------------------


class SymbolKind:
FILE = 1
MODULE = 2
NAMESPACE = 3
PACKAGE = 4
CLASS = 5
METHOD = 6
PROPERTY = 7
FIELD = 8
CONSTRUCTOR = 9
ENUM = 10
INTERFACE = 11
FUNCTION = 12
VARIABLE = 13
CONSTANT = 14
STRING = 15
NUMBER = 16
BOOLEAN = 17
ARRAY = 18
OBJECT = 19
KEY = 20
NULL = 21
ENUM_MEMBER = 22
STRUCT = 23
EVENT = 24
OPERATOR = 25
TYPE_PARAMETER = 26


# ----------------- SAVING REQUEST RELATED VALUES -------------------


Expand Down
2 changes: 2 additions & 0 deletions spyder/plugins/editor/widgets/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,8 @@ def process_symbols(self, params):
symbols = params['params']
if symbols:
self.classfuncdropdown.update_data(symbols)
if self.oe_proxy is not None:
self.oe_proxy.update_outline_info(symbols)
except RuntimeError:
# This is triggered when a codeeditor instance was removed
# before the response can be processed.
Expand Down
55 changes: 55 additions & 0 deletions spyder/plugins/editor/widgets/tests/assets/text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""


import os
import sys


# %% functions
def d():
def inner():
return 2
return inner


# ---- func 1 and 2

def func1():
for i in range(3):
print(i)


def func2():
if True:
pass

# ---- other functions

def a():
pass

def b():
pass

def c():
pass

# %% classes
class Class1:
def __init__(self):
super(Class1, self).__init__()
self.x = 2

def method3(self):
pass

def method2(self):
pass

def method1(self):
pass
Loading