Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Project wide refactor and generalization
Browse files Browse the repository at this point in the history
This updates the project with some fixes,
improves the code style and adds generalization.
  • Loading branch information
ksdme committed Jun 4, 2018
1 parent bd12657 commit a08b40e
Show file tree
Hide file tree
Showing 53 changed files with 715 additions and 1,423 deletions.
20 changes: 10 additions & 10 deletions .coafile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[Default]
files = *.py, coala_langserver/*.py, tests/**/*.py
[all]
files = coalals/*.py, coalals/**/*.py, tests/**/*.py

max_line_length = 79
use_spaces = True

[python]
[all.python]
# Patches may conflict with autopep8 so putting them in own section so they
# will be executed sequentially; also we need the LineLengthBear to double
# check the line length because PEP8Bear sometimes isn't able to correct the
Expand All @@ -13,26 +13,26 @@ bears = SpaceConsistencyBear, QuotesBear
language = python
preferred_quotation = '

[autopep8]
[all.autopep8]
bears = PEP8Bear, PycodestyleBear, PyDocStyleBear
pydocstyle_ignore = D100, D101, D102, D103, D104, D107,
D200, D203, D205, D209, D212, D213, D400
D200, D203, D205, D209, D212, D213, D400, D105, D403,

[linelength] # Sometimes autopep8 makes too long lines, need to check after!
[all.linelength] # Sometimes autopep8 makes too long lines, need to check after!
bears = LineLengthBear
ignore_length_regex = ^.*https?://

[commit]
[all.commit]
bears = GitCommitBear
shortlog_trailing_period = False
shortlog_regex = ([^:]*|[^:]+[^ ]: [A-Z0-9*].*)

[LineCounting]
[all.LineCounting]
enabled = False
bears = LineCountBear
max_lines_per_file = 1000

[TODOS]
[all.TODOS]
enabled = False
bears = KeywordBear
language = python3
Expand All @@ -42,6 +42,6 @@ language = python3
ci_keywords, keywords = \#TODO, \# TODO, \#FIXME, \# FIXME
cs_keywords =

[yml]
[all.yml]
bears = YAMLLintBear
files = *.yml
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ coverage:
project:
default:
enabled: true
target: 95%
target: 100%
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
branch = True
source = .
omit =
coala-langserver.py
coalals/__main__.py
tests/*

[report]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ ENV/

# Rope project settings
.ropeproject

# vscode directory
.vscode/
16 changes: 1 addition & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,14 @@ before_install:
fi

install:
# beheve is a dev dependeny, so not in requirements.txt.
- pip install behave
- pip install -r ./requirements.txt
# codecov is a code coverage tool.
- pip install codecov
- cd ./vscode-client
- npm install
- mkdir ./out
- npm run vscode:prepublish
- cd - > /dev/null

script:
- >
# https://github.com/coala/coala-bears/issues/1037
- sed -i.bak '/bears = GitCommitBear/d' .coafile
# Server side tests.
- coverage run $(which behave) ./tests/server.features
- coverage run -a -m unittest discover -s tests
# Frontend tests.
# - cd ./vscode-client
# - npm test
# - cd - > /dev/null
# - coverage run -a -m unittest discover -s tests

notifications:
email: false
Expand Down
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# coala-vs-code
# coala-ls

[![Build Status](https://travis-ci.org/coala/coala-vs-code.svg?branch=master)](https://travis-ci.org/coala/coala-vs-code)
[![codecov](https://codecov.io/gh/coala/coala-vs-code/branch/master/graph/badge.svg)](https://codecov.io/gh/coala/coala-vs-code)
A coala language server based on [Language Server Protocol (LSP)](https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md). Python versions 3.x is supported.

A visual studio code plugin working via [Language Server Protocol (LSP)](https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md).Python versions 3.x is supported.

## Feature preview

![](./docs/images/demo.gif)

## Setting up your dev environment, coding, and debugging

You'll need python version 3.5 or greater, run `pip3 install -r requirements.txt` to install the requirements, and run `python3 langserver-python.py --mode=tcp --addr=2087` to start a local languager server listening at port 2087.
You'll need python version 3.5 or greater, run `pip3 install -r requirements.txt` to install the requirements, and run `python3 -m coalals --mode=tcp --addr=2087` to start a local languager server listening at port 2087.

Then you should update the `./vscode-client/src/extension.ts` to make client in TCP mode.

Expand All @@ -26,10 +20,7 @@ export function activate(context: ExtensionContext) {

To try it in [Visual Studio Code](https://code.visualstudio.com), open ./vscode-client in VS Code and turn to debug view, launch the extension.

## Known bugs

* [Language server restarts when `didSave` requests come](https://github.com/coala/coala-vs-code/issues/7)

## Reference

* [python-langserver](https://github.com/sourcegraph/python-langserver)
* [python-language-server](http://github.com/palantir/python-language-server)
11 changes: 0 additions & 11 deletions coala-langserver.py

This file was deleted.

2 changes: 1 addition & 1 deletion coala-langserver.sh → coala-ls.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

cd "$(dirname "$0")" > /dev/null
exec python3 ./coala-langserver.py
exec python3 -m coalals
cd - /dev/null
30 changes: 0 additions & 30 deletions coala_langserver/coalashim.py

This file was deleted.

56 changes: 0 additions & 56 deletions coala_langserver/diagnostic.py

This file was deleted.

Loading

0 comments on commit a08b40e

Please sign in to comment.