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

Add textDocument/formatting. #13

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
aac18f2
.gitignore: Update gitignore
ksdme Jul 5, 2018
b1f5ae4
.vscode-client: Drop vscode client
ksdme Jun 7, 2018
e0e4f3c
README: Update README.md and assets
ksdme Jun 8, 2018
305a441
coala_langserver: Drop codebase and tests
ksdme Jun 6, 2018
6bbad87
tests: Add test helpers and resources
ksdme Jun 8, 2018
023120d
conftest.py: Add conftest.py
ksdme Jun 8, 2018
5d4c230
coalals.utils.files: Add files module
ksdme Jun 8, 2018
7a6ebac
coala.utils.log: Add log configuration
ksdme Jun 8, 2018
2ccfa25
coalals.utils.wrappers: Add wrappers
ksdme Jun 8, 2018
832f76e
coalals.concurrency: Add concurrency module
ksdme Jun 8, 2018
3e7defd
coalals.interface: Add initial coala wrapper
ksdme Jun 8, 2018
f101593
coalals.results: Add result processing module
ksdme Jun 8, 2018
9e84731
coala.langserver: Add language server module
ksdme Jun 8, 2018
1a5f1c0
coalals.main: Add main.py
ksdme Jun 8, 2018
b6dc724
__main__.py: Make module executable
ksdme Jun 8, 2018
8c64f2a
requirements.txt: Update requirements
ksdme Jun 8, 2018
5c5f87f
test-requirements.txt: Update test requirements
ksdme Jun 8, 2018
d56adf2
*: Update test configuration
ksdme Jun 8, 2018
c60a565
coala-ls.sh: Add coala-ls.sh
ksdme Jun 8, 2018
32fe61c
coalals.results: Refactor to submodule
ksdme Jul 5, 2018
e9745d3
coalals.utils.files: Add get_disk_contents()
ksdme Jul 5, 2018
88d7983
requirements.txt: Add whatthepatch
ksdme Jun 25, 2018
9cef173
coalals.results.fixes: Add fixes parsing & lsp models
ksdme Jul 5, 2018
7b4d59d
coalals.results.diagnostics: Support fixes collection
ksdme Jul 5, 2018
8e75ead
coalals.langserver: Add support for textDocument/formatting
ksdme Jul 5, 2018
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
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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ tags
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

Expand Down
13 changes: 1 addition & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ before_install:
sleep 3;
fi

- cd ./vscode-client
- npm install
- mkdir ./out
- npm run vscode:prepublish
- cd - > /dev/null

- printf '%s\n'
"$(cat test-requirements.txt requirements.txt)"
> requirements.txt
Expand All @@ -50,12 +44,7 @@ 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
- py.test --cov-report term --cov=coalals

notifications:
email: false
Expand Down
31 changes: 8 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
# 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)
[![Build Status](https://travis-ci.org/coala/coala-ls.svg?branch=master)](https://travis-ci.org/coala/coala-ls)
[![codecov](https://codecov.io/gh/coala/coala-ls/branch/master/graph/badge.svg)](https://codecov.io/gh/coala/coala-ls)

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.
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.

## Feature preview

![](./docs/images/demo.gif)
![coala-ls demo](./docs/images/demo.gif)
Watch full video on [YouTube](https://www.youtube.com/watch?v=MeybdlCB96U)

## 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.

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

```diff
export function activate(context: ExtensionContext) {
- context.subscriptions.push(startLangServer
- (require("path").resolve(__dirname, '../coala-langserver.sh'), ["python"]));
+ context.subscriptions.push(startLangServerTCP(2087, ["python"]));
console.log("coala language server is running.");
}
```

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)
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 language server listening at port 2087. Currently `stdio` mode is also supported and can be used by invoking coalals with `--mode=stdio`.

## 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.

156 changes: 0 additions & 156 deletions coala_langserver/langserver.py

This file was deleted.

6 changes: 0 additions & 6 deletions coala_langserver/log.py

This file was deleted.

18 changes: 0 additions & 18 deletions coala_langserver/uri.py

This file was deleted.

File renamed without changes.
Loading