Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Add completion feature #41

Merged
merged 11 commits into from
Aug 18, 2016
Merged

Add completion feature #41

merged 11 commits into from
Aug 18, 2016

Conversation

mattn
Copy link
Contributor

@mattn mattn commented Jul 28, 2016

Make sure these boxes are checked before submitting your PR -- thanks in advance!

I wonder that you will have an interesting.

return new Promise((resolve, reject) => {
const line = position.line + 1;
const column = position.character;
console.log("line=" , line);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to remove this.

@rebornix
Copy link
Member

@mattn thanks for your contribution, it look good to me!

Do you mind adding a simple guidance in README after Lineters or putting the setup info in Wiki and adding a link in README? I don't use rct-complete so it will be awesome if there is a doc for it and it will be usefull to users as well.

@mattn
Copy link
Contributor Author

mattn commented Jul 28, 2016

Added small installation instruction for the completion feature. But I'm not native speaker, if you feel wrong, please let me known.

@rebornix
Copy link
Member

@mattn thanks again! The introduction is neat! I'm not a native speaker as well, let's release it and see people's feedback!

@HookyQR
Copy link
Contributor

HookyQR commented Jul 28, 2016

@mattn I'd like to see this with the shell dependancy. You don't need that in the call. It can affect the which (or any) version of the processor is called if you're using rbenv (or rvm). Not sure how which will work with them either.

Also, adding a filter on the retuned strings to get rid of the methods that aren't really completions. (Operators and such) with:

if (/^[^\w]/.test(items[0])) return;

Adding a completionItemKind as the second element to the CompletionItem constructor would be good. Method is probably best.

Change the filterText to be on items[0] rather than [1], otherwise it uses the source class/module prefix of the second part when picking a 'best' result.

There are a couple more console calls in there that should be removed.

* remove shell dependencies
* filter non-completion words
* add CompletionItemKind
* set the keyword it self for filterText instead of Module#method.
* remove console.log (without error)
@mattn
Copy link
Contributor Author

mattn commented Jul 29, 2016

@HookyQR Thanks for your review. Fixed.

@orta
Copy link
Contributor

orta commented Jul 29, 2016

Wow, awesome, I had booked today to look at building this same thing - thanks @mattn 👍


* rcodetools

You need to restart vscode after installation of rcodetools. Then type CTRL-Space after the leading words like below.
Copy link
Contributor

@orta orta Aug 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make this read better in English, maybe try this:

## Autocomplete

To enable method completion in ruby: `gem install rcodetools`. You may need to restart Visual Studio Code the first time.

```ruby
[1, 2, 3].e #<= Press CTRL-Space here

Move the - IntelliSense and autocomplete line from TODO into Features.

@mattn
Copy link
Contributor Author

mattn commented Aug 6, 2016

Fixed problems @HookyQR suggested. Thanks.

'--column='+column]);

var outbuf = [], errbuf = [];
child.stderr.on('data', (data) => errbuf.push(data.toString()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Push the buffer rather than the string.

@mattn
Copy link
Contributor Author

mattn commented Aug 7, 2016

used Buffer.

@rebornix rebornix merged commit 7a4a1bc into rubyide:master Aug 18, 2016
@rebornix
Copy link
Member

@mattn sorry for the late merging. The feature is insanely amazing, thanks for it!

@HookyQR
Copy link
Contributor

HookyQR commented Aug 25, 2016

Hey @rebornix, can you package and release a new version with this please. I'm still seeing 0.5.2 as the active release.

@rebornix
Copy link
Member

@HookyQR It's shiped as 0.5.3 with another PR merged.

@mattn mattn deleted the completion branch January 11, 2017 01:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants