Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve completion handler and wordAtPoint #192

Merged
merged 13 commits into from
Mar 4, 2020
Merged

Improve completion handler and wordAtPoint #192

merged 13 commits into from
Mar 4, 2020

Conversation

skovhus
Copy link
Collaborator

@skovhus skovhus commented Mar 3, 2020

Solves #83

This is an iteration on the great work by @thomasjm (see context in #119). It improves several aspects of the server:

  • detection of a word at a given point is now a lot more accurate (this is used for completion, hovering, etc) and fixes some issues with the tree sitter grammar
  • we now support auto-completion and documentation for bash reserved words (e.g. case, do, if, while)
  • the completion feedback should be improved a lot by doing suffix filtering (i.e. not suggesting completions that doesn't begin with the current word)
  • improved log statements that hopefully makes debugging easier

Before (left) and after (right)

I've done a bunch of manual testing, and tried to document the results here:

Removed weird autocomplete on set -x (due to improved word handling):

Screenshot 2020-03-03 21 43 08Screenshot 2020-03-03 21 52 32

Autocompletion when a word is already written (note that we have duplications here with builtins and man pages):

Screenshot 2020-03-03 22 00 53Screenshot 2020-03-03 22 00 38

Bash reserved words are now supported (e.g. if, else)

Screenshot 2020-03-03 23 15 48Screenshot 2020-03-03 23 15 35

This also solved the case / esac issue reported in #83

@skovhus skovhus changed the title Improve wordAtPoint and compeltion Improve completion handler and wordAtPoint Mar 3, 2020
@skovhus skovhus merged commit d244878 into master Mar 4, 2020
@skovhus skovhus deleted the word-at-point branch March 4, 2020 12:40
@skovhus skovhus mentioned this pull request Mar 4, 2020
akurtakov added a commit to akurtakov/shellwax that referenced this pull request Mar 4, 2020
Changes in the LS:
* Improved completion handler and support auto-completion and
documentation for bash reserved words
(bash-lsp/bash-language-server#192)
* Upgrade tree-sitter


Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
akurtakov added a commit to eclipse-shellwax/shellwax that referenced this pull request Mar 4, 2020
Changes in the LS:
* Improved completion handler and support auto-completion and
documentation for bash reserved words
(bash-lsp/bash-language-server#192)
* Upgrade tree-sitter


Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
skovhus added a commit that referenced this pull request May 19, 2020
The helper was originally introduced to make the detection of a word at a given point
more accurate (this is used for completion, hovering, etc) and fixes some issues with the tree sitter grammar.

It turns out this is really not needed and introduces a bunch of issues.

Related to #192
skovhus added a commit that referenced this pull request May 19, 2020
The helper was originally introduced to make the detection of a word at a given point
more accurate (this is used for completion, hovering, etc) and fixes some issues with the tree sitter grammar.

It turns out this is really not needed and introduces a bunch of issues.

Related to #192
domnewkirk added a commit to domnewkirk/bash-language-server that referenced this pull request Jul 20, 2024
The helper was originally introduced to make the detection of a word at a given point
more accurate (this is used for completion, hovering, etc) and fixes some issues with the tree sitter grammar.

It turns out this is really not needed and introduces a bunch of issues.

Related to bash-lsp/bash-language-server#192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants