-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add two settings to tweak completions in other editors (#224)
Testing in Helix, which uses a different grammar for SCSS than Code, revealed a few annoying nits with compleitons. This version adds two new settings that can be useful for maintainers of language clients and editor configurations: - `somesass.completion.afterModule` - `somesass.completion.beforeVariable` `afterModule` lets you control whether or not to insert a `.` when accepting a suggestion from modules. If you see for instance `module..$variable` then try setting `afterModule` to an empty string. `beforeVariable` is for non-module variables. If you see double dollars (`$$variable`) then set `beforeVariable` to the empty string.
- Loading branch information
Showing
12 changed files
with
160 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Testing in other editors | ||
|
||
While it's recommended to use Visual Studio Code or VSCodium, you can use other editors to test and debug the language server. | ||
|
||
In this document we'll look at how we can test our local development build in the Helix editor. | ||
|
||
## Install the local version globally | ||
|
||
To make the local version of `some-sass-language-server` available on `PATH`, go to its directory and run `npm install --global .`. | ||
|
||
```sh | ||
cd packages/language-server/ | ||
npm install --global . | ||
``` | ||
|
||
Editors using Some Sass from `PATH` now use your local build. | ||
|
||
## Check the logs | ||
|
||
In Helix, run the `hx` command with the `-v` verbose flag. Do your test, and then run the `:log-open` command to see the traffic between server and client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Helix | ||
|
||
You can configure new language servers in [`.config/helix/languages.toml`](https://docs.helix-editor.com/guides/adding_languages.html). | ||
|
||
[Install the language server if you haven't already](./getting-started.md), then add this config you `languages.toml`. | ||
|
||
```toml | ||
[language-server.some-sass-language-server] | ||
command = "some-sass-language-server" | ||
args = ["--stdio"] | ||
config = { somesass = { completion = { afterModule = "", beforeVariable = "" } } } | ||
|
||
[[language]] | ||
name = "scss" | ||
scope = "source.scss" | ||
injection-regex = "scss" | ||
file-types = ["scss"] | ||
block-comment-tokens = { start = "/*", end = "*/" } | ||
language-servers = [ "some-sass-language-server" ] | ||
auto-format = true | ||
indent = { tab-width = 2, unit = " " } | ||
``` | ||
|
||
The language server will start once you open an SCSS file. | ||
|
||
At time of writing there doesn't seem to be a grammar for Sass indented available in Helix. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters