Skip to content

Commit

Permalink
Add workspace symbol support
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed Feb 17, 2019
1 parent 6dee330 commit 60b50d1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ jobs:
- image: "python:2.7-stretch"
steps:
- checkout
- run: apt-get update
- run: apt-get install exuberant-ctags
- run: pip install -e .[all] .[test]
- run: py.test test/
- run: pylint pyls test
Expand All @@ -17,6 +19,8 @@ jobs:
- image: "python:3.4-stretch"
steps:
- checkout
- run: apt-get update
- run: apt-get install exuberant-ctags
- run: pip install -e .[all] .[test]
- run: py.test test/

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ All optional providers can be installed using:

``pip install 'python-language-server[all]'``

If you get an error similar to ``'install_requires' must be a string or list of strings`` then please upgrade setuptools before trying again.
If you get an error similar to ``'install_requires' must be a string or list of strings`` then please upgrade setuptools before trying again.

``pip install -U setuptools``

Expand Down
7 changes: 5 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"

install:
- "%PYTHON%/python.exe -m pip install --upgrade pip setuptools"
- "%PYTHON%/python.exe -m pip install .[all] .[test]"
- 'appveyor DownloadFile "https://github.com/universal-ctags/ctags-win32/releases/download/2018-03-13/5010e849/ctags-2018-03-13_5010e849-x64.zip" -FileName ctags.zip'
- '7z e ctags.zip -oC:\Users\appveyor\bin ctags.exe'
- 'set PATH=%PATH%;C:\Users\appveyor\bin'
- '%PYTHON%/python.exe -m pip install --upgrade pip setuptools'
- '%PYTHON%/python.exe -m pip install .[all] .[test]'

test_script:
- "%PYTHON%/Scripts/pytest.exe test/"
Expand Down
6 changes: 3 additions & 3 deletions pyls/plugins/ctags.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def pyls_document_did_open(self, config, workspace):
ctags_exe = _ctags_exe(settings)

for tag_file in settings.get('tagFiles', []):
mode = tag_file.get('onStart', CtagMode.DEFAULT_ON_START_MODE)
mode = tag_file.get('onStart', DEFAULT_ON_START_MODE)

if mode == CtagMode.NONE:
log.debug("Skipping tag file with onStart mode NONE: %s", tag_file)
Expand All @@ -158,7 +158,7 @@ def pyls_document_did_save(self, config, document):
ctags_exe = _ctags_exe(settings)

for tag_file in settings.get('tagFiles', []):
mode = tag_file.get('onSave', CtagMode.DEFAULT_ON_SAVE_MODE)
mode = tag_file.get('onSave', DEFAULT_ON_SAVE_MODE)

if mode == CtagMode.NONE:
log.debug("Skipping tag file with onSave mode NONE: %s", tag_file)
Expand Down Expand Up @@ -210,7 +210,7 @@ def execute(ctags_exe, tag_file, directory, append=False):

def parse_tags(tag_file, query):
if not os.path.exists(tag_file):
return []
return

with io.open(tag_file, 'rb') as f:
for line in f:
Expand Down
1 change: 1 addition & 0 deletions test/plugins/test_ctags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2017 Palantir Technologies, Inc.
# pylint: disable=redefined-outer-name
import os
import tempfile

Expand Down

0 comments on commit 60b50d1

Please sign in to comment.