Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/print-mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
rwols committed Aug 26, 2019
2 parents 4d6a8e6 + 6a0651e commit dda1c80
Show file tree
Hide file tree
Showing 36 changed files with 637 additions and 153 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
docs/ export-ignore
1 change: 1 addition & 0 deletions .travis.yml
@@ -1,3 +1,4 @@
dist: trusty
env:
global:
- PACKAGE="LSP" # Package name
Expand Down
12 changes: 12 additions & 0 deletions Keymaps/Default (Linux).sublime-keymap
Expand Up @@ -32,6 +32,15 @@
// Go To Definition
// {"keys": ["UNBOUND"], "command": "lsp_symbol_definition"},

// Go To Type Definition
// {"keys": ["UNBOUND"], "command": "lsp_symbol_type_definition"},

// Go To Declaration
// {"keys": ["UNBOUND"], "command": "lsp_symbol_declaration"},

// Go To Implementation
// {"keys": ["UNBOUND"], "command": "lsp_symbol_implementation"},

// Rename Symbol
// { "keys": ["UNBOUND"], "command": "lsp_symbol_rename" },

Expand All @@ -43,4 +52,7 @@

// Document Symbols
// {"keys": ["UNBOUND"], "command": "lsp_document_symbols"},

// Symbol Hover
// {"keys": ["UNBOUND"], "command": "lsp_hover"},
]
10 changes: 9 additions & 1 deletion Keymaps/Default (OSX).sublime-keymap
Expand Up @@ -32,6 +32,15 @@
// Go To Definition
// {"keys": ["UNBOUND"], "command": "lsp_symbol_definition"},

// Go To Type Definition
// {"keys": ["UNBOUND"], "command": "lsp_symbol_type_definition"},

// Go To Declaration
// {"keys": ["UNBOUND"], "command": "lsp_symbol_declaration"},

// Go To Implementation
// {"keys": ["UNBOUND"], "command": "lsp_symbol_implementation"},

// Rename Symbol
// { "keys": ["UNBOUND"], "command": "lsp_symbol_rename" },

Expand All @@ -46,5 +55,4 @@

// Symbol Hover
// {"keys": ["UNBOUND"], "command": "lsp_hover"},

]
12 changes: 12 additions & 0 deletions Keymaps/Default (Windows).sublime-keymap
Expand Up @@ -32,6 +32,15 @@
// Go To Definition
// {"keys": ["UNBOUND"], "command": "lsp_symbol_definition"},

// Go To Type Definition
// {"keys": ["UNBOUND"], "command": "lsp_symbol_type_definition"},

// Go To Declaration
// {"keys": ["UNBOUND"], "command": "lsp_symbol_declaration"},

// Go To Implementation
// {"keys": ["UNBOUND"], "command": "lsp_symbol_implementation"},

// Rename Symbol
// { "keys": ["UNBOUND"], "command": "lsp_symbol_rename" },

Expand All @@ -43,4 +52,7 @@

// Document Symbols
// {"keys": ["UNBOUND"], "command": "lsp_document_symbols"},

// Symbol Hover
// {"keys": ["UNBOUND"], "command": "lsp_hover"},
]
26 changes: 20 additions & 6 deletions LSP.sublime-settings
Expand Up @@ -57,6 +57,9 @@
// Show a bulb in the gutter when code actions are available
"show_code_actions_bulb": false,

// Show a box next to the color if the language server provides color support.
"show_color_box": true,

// Request completions for all characters if set to true,
// or just after trigger characters only otherwise.
"complete_all_chars": true,
Expand Down Expand Up @@ -269,7 +272,8 @@
},
"dart": {
"command": [
"dart_language_server"
// Specify a dart command like the below in your LSP User settings.
// "dart", "/usr/local/opt/dart/libexec/bin/snapshots/analysis_server.dart.snapshot", "--lsp"
],
"languageId": "dart",
"scopes": [
Expand Down Expand Up @@ -305,10 +309,16 @@
},
"intelephense-ls":
{
"command": ["intelephense", "--stdio"],
"scopes": ["source.php", "embedding.php"],
"syntaxes": ["Packages/PHP/PHP.sublime-syntax"],
"languageId": "php"
"command": ["intelephense", "--stdio"],
"scopes": ["source.php", "embedding.php"],
"syntaxes": ["Packages/PHP/PHP.sublime-syntax"],
"languageId": "php",
// "initializationOptions": {
// "clearCache": false,
// "storagePath": "/tmp/intelephense",
// "globalStoragePath": "/tmp/intelephense",
// "licenceKey": "",
// },
},
"reason":
{
Expand Down Expand Up @@ -452,7 +462,11 @@
"Packages/Rails/Ruby on Rails.sublime-syntax",
"Packages/Rails/HTML (Rails).sublime-syntax"
],
"tcp_port": 7658
"tcp_port": 7658,
// Enable RuboCop linting
// "initializationOptions": {
// "diagnostics": true
// },
},
"vscode-css":
{
Expand Down
12 changes: 12 additions & 0 deletions Menus/Context.sublime-menu
Expand Up @@ -8,6 +8,18 @@
"command": "lsp_symbol_definition",
"caption": "Go To Symbol Definition"
},
{
"command": "lsp_symbol_type_definition",
"caption": "Go To Symbol Type Definition"
},
{
"command": "lsp_symbol_declaration",
"caption": "Go To Symbol Declaration"
},
{
"command": "lsp_symbol_implementation",
"caption": "Go To Symbol Implementation"
},
{
"command": "lsp_symbol_rename",
"caption": "Rename Symbol"
Expand Down
1 change: 1 addition & 0 deletions Menus/Main.sublime-menu
Expand Up @@ -9,6 +9,7 @@
"children": [
{
"caption": "LSP",
"id": "lsp-settings",
"children": [
{
"caption": "Settings",
Expand Down
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -37,6 +37,7 @@ Documentation is available at [LSP.readthedocs.io](https://LSP.readthedocs.io).
* [CSS/LESS/SASS (SCSS only)](https://lsp.readthedocs.io/en/latest/#css)
* [D](https://lsp.readthedocs.io/en/latest/#d)
* [Dart](https://lsp.readthedocs.io/en/latest/#dart)
* [Elm](https://lsp.readthedocs.io/en/latest/#elm)
* [Flow (JavaScript)](https://lsp.readthedocs.io/en/latest/#flow)
* [Go](https://lsp.readthedocs.io/en/latest/#go)
* [HTML](https://lsp.readthedocs.io/en/latest/#html)
Expand All @@ -60,6 +61,14 @@ Documentation is available at [LSP.readthedocs.io](https://LSP.readthedocs.io).

See [Language Server Protocol](https://microsoft.github.io/language-server-protocol/implementors/servers/) for more available implementations. Please create issues/pull requests so we can get support for more languages.

## Customisation of the popup

LSP uses [mdpopups](https://github.com/facelessuser/sublime-markdown-popups) to display the popup. If you want to customise it, check the [doc](http://facelessuser.github.io/sublime-markdown-popups/).

tl;dr?

Create/modify the file `Packages/User/mdpopups.css` and put your own style.

## Getting help

If you have any problems, see the [troubleshooting](https://lsp.readthedocs.io/en/latest/#troubleshooting) guide for tips and known limitations. If the documentation cannot solve your problem, help can be found in the [gitter chat](https://gitter.im/SublimeLSP) or by searching/creating [creating a new issue](https://github.com/tomv564/LSP/issues).
Expand Down
4 changes: 2 additions & 2 deletions boot.py
Expand Up @@ -10,11 +10,12 @@
from .plugin.configuration import *
from .plugin.formatting import *
from .plugin.highlights import *
from .plugin.definition import *
from .plugin.goto import *
from .plugin.hover import *
from .plugin.references import *
from .plugin.signature_help import *
from .plugin.code_actions import *
from .plugin.color import *
from .plugin.symbols import *
from .plugin.rename import *
from .plugin.execute_command import *
Expand All @@ -26,4 +27,3 @@ def plugin_loaded():

def plugin_unloaded():
shutdown()
remove_all_highlights()
20 changes: 19 additions & 1 deletion docs/cplusplus.md
Expand Up @@ -10,6 +10,7 @@ Build and install from source, see (ccls wiki)[https://github.com/MaskRay/ccls/w
### Cquery

Build and install from source, see (cquery wiki)[https://github.com/cquery-project/cquery/wiki/Building-cquery]
Note that work on cquery has stopped. Prefer using ccls or clangd.

### Clangd

Expand All @@ -20,6 +21,14 @@ adjust your `"clients"` dictionary in your user preferences.

To use clangd on Mac, use Homebrew: `brew install llvm`. The clangd executable
will be present in /usr/local/Cellar/llvm/*version*/bin
You probably need to install the Xcode developer command-line tools. Run the following in a terminal:
```bash
xcode-select --install
```
And if you're on macOS 10.14, also run the following to install essential headers like `wchar_t.h`:
```bash
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
```

To use clangd on Windows, install LLVM with the [LLVM installer](http://releases.llvm.org/download.html),
and then add C:\\Program Files\\LLVM\\bin to your %PATH%.
Expand All @@ -34,6 +43,8 @@ might include things like:
* Define directives,
* Compiler-specific flags.

#### compile_commands.json

Like any language server, clangd works on a per-file (or per-buffer) basis. But
unlike most other language servers, it must also be aware of the exact compile
flags that you pass to your compiler. For this reason, people have come up with
Expand Down Expand Up @@ -64,4 +75,11 @@ enhancing your compilation database with your header files using [this project c
To generate headers with compdb, read [this closed issue](https://github.com/Sarcasm/compdb/issues/2).

You can also read about attempts to address this [on the CMake issue tracker](https://gitlab.kitware.com/cmake/cmake/issues/16285), along with the problem
of treating header files as translation units.
of treating header files as translation units.

#### compile_flags.txt

Another way to let your language server know what the include dirs are is by hand-writing a compile_flags.txt file in
your source root. Each line is one flag. This can be useful for projects that e.g. only have a Visual Studio solution
file. For more information, see [these instructions](https://releases.llvm.org/8.0.0/tools/clang/tools/extra/docs/clangd/Installation.html#compile-flags-txt). Creating this file by hand is a reasonable place to start if your project is quite
simple.
3 changes: 2 additions & 1 deletion docs/features.md
Expand Up @@ -14,7 +14,7 @@
* Symbol References: `shift+f12`
* Rename Symbol: UNBOUND
* Recommendation: Override `F2` (next bookmark)
* Go to definition: UNBOUND
* Go to definition / type definition / declaration / implementation: UNBOUND
* Recommendation: Override `f12` (built-in goto definition),
* LSP falls back to ST3's built-in goto definition command in case LSP fails.
* Format Document: UNBOUND
Expand Down Expand Up @@ -81,6 +81,7 @@ Global plugin settings and settings defined at project level are merged together
* `document_highlight_scopes`: *customize your sublime text scopes for document highlighting*
* `diagnostics_gutter_marker` `"dot"` *gutter marker for code diagnostics: "dot", "circle", "bookmark", "cross" or ""*
* `show_code_actions_bulb` `false` *show a bulb in the gutter when code actions are available*
* `show_color_box` `true` *Show a box next to the color if the language server provides color support*
* `log_debug` `false` *show debug logging in the sublime console*
* `log_server` `true` *show server/logMessage notifications from language servers in the console*
* `log_stderr` `false` *show language server stderr output in the console*
Expand Down
51 changes: 48 additions & 3 deletions docs/index.md
Expand Up @@ -77,6 +77,20 @@ Alternatively, Microsoft's python language server (using .NET Core runtime)

[Instructions here](https://github.com/Microsoft/python-language-server/blob/master/Using_in_sublime_text.md)

Use virtualenv adding the following settings :

```json
"settings": {
"LSP": {
"pyls": {
"env": {
"PYTHONPATH": "/Users/mike/.virtualenvs/my-virtual-env/lib/python3.7/site-packages"
}
}
}
}
```

### PHP<a name="php"></a>

#### Intelephense
Expand Down Expand Up @@ -152,6 +166,37 @@ Add to LSP settings' clients:
}
```

### Elm<a name="elm"></a>

See instructions for installing the [elm-language-server](https://github.com/elm-tooling/elm-language-server).
Install [Elm Syntax Higlighting](https://packagecontrol.io/packages/Elm%20Syntax%20Highlighting) from Package Control for syntax highlighting.

Add to LSP settings' clients:

```json
"elm": {
"command": [
"elm-language-server",
"--stdio"
],
"enabled": true,
"languageId": "elm",
"scopes":
[
"source.elm"
],
"syntaxes":
[
"Packages/Elm Language Support/Syntaxes/Elm.sublime-syntax"
],
"initializationOptions": {
"elmPath": "elm",
"elmFormatPath": "elm-format",
"elmTestPath": "elm-test"
}
}
```


### Ocaml/Reason<a name="reason"></a>

Expand Down Expand Up @@ -199,11 +244,11 @@ More info: https://github.com/Polymer/polymer-editor-service

### Dart<a name="dart"></a>

`pub global activate dart_language_server`
Install the Dart Sublime package and the [Dart SDK](https://dart.dev/get-dart)

Make sure the pub bin directory is part of your path.
Then locate the "snapshots/bin" directory of the SDK, and specify the path to `analysis_server.dart.snapshot` in the LSP user settings under "clients", "dart", then "command".

See: [natebosch/dart_language_server](https://github.com/natebosch/dart_language_server)
The older [natebosch/dart_language_server](https://github.com/natebosch/dart_language_server) is now deprecated

### Kotlin

Expand Down
3 changes: 2 additions & 1 deletion messages.json
Expand Up @@ -18,5 +18,6 @@
"0.8.2": "messages/0.8.2.txt",
"0.8.3": "messages/0.8.3.txt",
"0.8.4": "messages/0.8.4.txt",
"0.8.5": "messages/0.8.5.txt"
"0.8.5": "messages/0.8.5.txt",
"0.8.6": "messages/0.8.6.txt"
}
2 changes: 1 addition & 1 deletion messages/0.8.5.txt
Expand Up @@ -16,6 +16,6 @@ Deprecations:

`highlight_active_signature_parameter` setting removed, this is now default behaviour.

See https://github.com/tomv564/LSP/releases/tag/0.8.4 for full update details.
See https://github.com/tomv564/LSP/releases/tag/0.8.5 for full update details.

Thanks to all contributors & reporters!
10 changes: 10 additions & 0 deletions messages/0.8.6.txt
@@ -0,0 +1,10 @@
=> 0.8.6

Bug fixes:
Server logging at startup now appears in the console (instead of "unhandled notfication: window/logMessage")
Go to type definition/declaration/implementation capabilities properly advertised to servers.


See https://github.com/tomv564/LSP/releases/tag/0.8.6 for full update details.

Thanks to all contributors & reporters!

0 comments on commit dda1c80

Please sign in to comment.