Comments (12)
Hi @nathankot
I pulled the latest code and it works well except when it tries to send the first query request to SourceKittenDaemon, it outputs the following messages:
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8081/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8082/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8083/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8084/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8085/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8086/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8087/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8088/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8089/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8090/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8081/ping.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8081/project.
Blocking call to accept-process-output with quit inhibited!!
REQUEST [error] Error (error) while connecting to http://localhost:8082/project.
Blocking call to accept-process-output with quit inhibited!! [2 times]
REQUEST [error] Error (error) while connecting to http://localhost:8083/project.
Blocking call to accept-process-output with quit inhibited!!
REQUEST [error] Error (error) while connecting to http://localhost:8084/project.
Blocking call to accept-process-output with quit inhibited!!
REQUEST [error] Error (error) while connecting to http://localhost:8085/project.
Blocking call to accept-process-output with quit inhibited!!
REQUEST [error] Error (error) while connecting to http://localhost:8086/project.
Blocking call to accept-process-output with quit inhibited!!
REQUEST [error] Error (error) while connecting to http://localhost:8087/project.
Blocking call to accept-process-output with quit inhibited!!
REQUEST [error] Error (error) while connecting to http://localhost:8088/project.
Blocking call to accept-process-output with quit inhibited!!
REQUEST [error] Error (error) while connecting to http://localhost:8089/project.
Blocking call to accept-process-output with quit inhibited!!
REQUEST [error] Error (error) while connecting to http://localhost:8090/project.
And I personally think the message [sourcekit] got query response should better be silenced when sourcekit-verbose
is nil
.
Another problem I noticed recently: when typed fast, it may establish lots of query requests and it suffers a serious delay to get the response results.
I experimented to improve the accuracy by tweaking the prefix and making company-sourcekit work with other backends, eg. company-keywords, company-yasnippet etc. I don't have enough time on this and there is only a little progress. The query results should better be filtered and cached with a flexible and robust mechanism. I see you've added a string match filter to the query result and it could be a good beginning. Thanks :)
from company-sourcekit.
I don't know if the development of this package is stopped. The last commit date on master branch was 7 months ago (Jun 5, 2016). Is there a change to improve the performance and accuracy?
It hasn't stopped, I am still using this package - I've just been satisfied with the results/performance.
It seems that SourceKittenDaemon is not actively developed either, will it improve the performance and accuracy by just using SourceKitten as the back-end?
SourceKittenDaemon does use SourceKitten as the backend, @mitsuse would be great to have your input here on the decision not to use SourcekittenDaemon and how you achieved the performance of your neovim package =D
Or could we port Autocomplete-swift into emacs?
You're more than welcome to :) If it turns out to be better I will probably switch as well. I don't think it's very feasible for company-sourcekit to switch from using SourceKittenDaemon since it will pretty much surmount to a re-write. Also, performance could be a matter of upgrading SourceKitten but looking at their changelog doesn't seem like there are any performance improvements to completion.
from company-sourcekit.
The 400k+ issue is still occurred often with endless output writing to sourcekit-output-buffer
and the completion results are often not accurate or relevant. It seems that there is still no progress made in completing middle of word (#19).
At first, I think we should compare this package with Autocomplete-swift to find out what we could achieve to improve the results/performance. @mitsuse is appropriate and welcome to do this.
I will try to make an experiment on using SourceKitten as the back-end a few days later. And I'm glad to see continuous improvement aiming at results/performance and more people are joined to make a contribution :)
from company-sourcekit.
@galeo Hi.
I don't know the implementation of company-sourcekit and whether there are problems on performance, but I can tell about the implementation of autocomplete-swift on the point of completion accuracy. My plugin for Neovim decides the offset of completion as follow:
- Trigger completion if the string matches a regular expression from the beginning of the current line to the cursor.
- Calculate the byte-offset for completion
- The offset is the byte-length from the beginning of the file to the beginning of typing word.
The second one seems to be related to this issue.
In addition, I think the difference of back-end (SourceKitten or SourceKittenDaemon) is not related to accuracy discussed here as long as I read the source of SourceKittenDaemon few months ago.
@nathankot knows this point more than I know because he is a developer of SourceKittenDaemon.
from company-sourcekit.
I'm really excited to see an issue like this. I'd love to get more info from @nathankot on what can be done to improve performance.
From what I've read it seems like the only way we can get close/improve on Xcode is by caching results from sourcekit? Maybe sourcekittendaemon would be a good place to add that layer? What are your thoughts @nathankot ? I've been casually researching this for a few days.
Some things I found which may (or may not) be useful:
- Antlr 4 now has a Swift grammar. People use Antlr to write code completion and other tools
- SwiftKitten for Sublime Text was using Pygments to cache completions, and from the screenshots is really really fast.
This stuff is a bit over my head - I've never taken a compiler course, etc. But I'd love to help work on this and it looks like other people are interested too!
from company-sourcekit.
Thanks for your insight, I've added a28ac48 which addresses the byte-offset (wasn't using byte length of the prefix.)
I did some digging and it seems like the biggest bottleneck for company-sourcekit is actually the http response results being written into the *sourcekit-output*
buffer. It takes a good ~2 seconds for 3k lines of output.
Writing response results to a buffer is inevitable in emacs I think, so the question becomes - how do we speed this up? I'm working on a new branch performance
trying things like disabling font-lock-mode
, so far results don't seem significantly faster. Will look more into it tomorrow, but feel free to take a stab at this.
I would say the second priority here would be to cache word and framework completions, you're right @rudedogg this could be a sourcekittendaemon layer. Depending on how fast we can get the output and JSON parse it, this may or may not be necessary :)
from company-sourcekit.
Hi @nathankot,
I have tried to use deferred.el to get the query results asynchronously. It just works well and the *sourcekit-output*
buffer becomes useless. As you said above, the performance seems to be improved a little. I will submit a pull request later and you can have a test.
from company-sourcekit.
@galeo not sure how much deferred.el
will help since it also outputs to a buffer internally: https://github.com/kiwanami/emacs-deferred/blob/9668749635472a63e7a9282e2124325405199b79/deferred.el#L788
But send in the PR and I can take a look :)
from company-sourcekit.
Please have a look at the PR #25 :)
from company-sourcekit.
@galeo I've taken another look and refactored the code, fixed a few things that will hopefully help with performance. Please see the 0.2.0 release notes for full details - and let me know how it goes :)
from company-sourcekit.
@galeo did you achieve any progress with this?
from company-sourcekit.
Depending on how fast we can get the output and JSON parse it, this may or may not be necessary :)
Emacs master now has JSON encoding in C by the way. Not sure how much it'll help this problem.
from company-sourcekit.
Related Issues (20)
- Constructor completion for String() is not working
- Completion of symbols in current module HOT 1
- Question: How to make company-sourcekit turn on automatically? HOT 3
- Serious perfomance problem HOT 11
- Offset seems off by 3 HOT 6
- Disabling 'Wrote ...' HOT 1
- Completing middle of word HOT 7
- Getting same completions with different prefixes HOT 2
- compan-sourcekit slow or I am missing something? HOT 2
- Why not silent the message when writing to the tmp file? HOT 2
- Can't complete in workspace
- Backends for linux support HOT 2
- Not working with '(request-backend (quote url-retrieve)) HOT 2
- yasnippet compatible? HOT 6
- company-keywoards HOT 1
- No completion in workspaces HOT 3
- xcodebuild HOT 2
- [Request] - Step by step on how to make this work
- How to setup with other backends?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from company-sourcekit.