-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
adding support of code completion [imported] #849
Comments
As was said before, but follows for registration. https://github.com/CriativaSoft/Arduino/tree/ide-1.5.x-autocomplete |
As we talked on the list of developers, did the new implementation based on the structure in branche 1.5.x.
Summary of changes and tests: How was launched from the IDE version 1.6, I believe you may have a few more adjustments. PS: O Link of repo has changed: https://github.com/OpenDevice/Arduino |
Was made the merge with the 1.6.1 version of the master and created a new branche to facilitate integration: Autocomplete (95%) only need help to test Summary of changes and tests: |
So... Has this been cancelled? |
Would hate if this was cancelled. 👎 |
I did not have any further feedback from the Arduino team. It seems to me that is not as priority |
Can you provide a windows build for the current version of the Arduino IDE with your extensions? I would love to use that! |
Always the useful stuff is considered low priority 😞 Would be great if this could be implemented, since it would make coding a lot easier. @arduino team: Please give some feedback on whether you're willing to merge this and what needs to be done if you think there are any issues! All the hard work was obviously done by @ricardojlrufino already... |
IMHO, the code as it is somehow forces a choice between cpp/c & completion OR multiple file types (like editing keywords.txt or the lib descriptor). There might also be athe need for a legal advice on distributing the cdt code inside arduino. |
sorry for being late, I tried to answer yesterday, but this is a very busy week.
@ricardojlrufino autocomplete is in our priority and has not been cancelled. I've already reviewed and commented your PR, this is my last email from the developer list:
@Ede123 To be more specific, the main reasons blocking this PR:
|
For having written an implementation of code completion, it is possible to shrink the contact surface to a couple lines of code, with all the logic in an external jar file. One of the added benefits is that you can also support different completion scheme based on the file type (i deal with keywords files, lib descriptors and c/c++ code). For having read the patch, I do not think that it will let you do that easily (not that this is what you have to do). |
@cmaglie I think I might have a sense of the hit&miss that you described, as I did identify some inadequacies with the code driving the cdt parser: the problem is that it builds a model that is too simplistic as it is, and the complete cdt model layer depends on the eclipse workspace layer to run (if I recall there was also an issue with includes) I made a test where I managed to start the workspace layer inside Arduino IDE (it actually mapped naturally to the ide's usage of a single root folder for work). It worked... but then might as well use eclipse. So then I wrote my own model of c++ that has more info than ricardo's but less than cdt. the code is not dependent on the parser as I was considering writing a libclang version (written as a standalone local cpp server) and does good enough for my own usage. |
If Arduino IDE (Processing fork) does not wish to implement this, what about creating official support for CLion and adding all the Arduino tools to it? |
Hi, Since the discussion has started again. I made the implementation several times of the functionality of autocomplete, a had to adapt the changes that had been taking place of the IDE. Without the original team making the merge, it became impossible to maintain. Yes, true, I had to do a lot of refactoring in IDE for it to be able to ACCEPT the auto-complete system. A lot of refactoring was accepted (like new code editor), but the autocomplete itself was not.
Yes that may be possible. Part was made and isolated in the project: What I can do is to create the basis of the autocomplete system. And create the specific implementation you can use: keywords.txt (this would be the default) and C ++ code (cplus-libparser) Remembering that the project can export the class definitions and functions for a JSON / XML, something like keywords, only without the manual work of the developer, and with the support to include the documentation of the methods. I think this could avoid the need to distribute lib (/ cplus-libparser) along with Arduino PS: Sorry for my bad english |
The main modifications in the IDE are to make the autocomplete smarter by dynamically parsing the main Sketch as the user modifies. This could be left for a second time, but with the loss of some functionality like not recognizing variables with different names of libraries such as: mySerial.xx! I think it's a start, I've done this implementation for 2 years now and no progress has been made. For a tool that is made for beginners, I think the auto-complete is essential, even if it is not perfect ... @cmaglie What would be the way to start this project? |
I think it would be a good feature to add but please add an option to completely disable it. If it's not desirable to do that in the GUI, editing preferences.txt is fine by me. Everyone has a different style of writing code and what's useful to some is an annoyance to others. An example is the automatic closing bracket feature. I'm sure some people love it but it causes way more problems than benefits for me and there's no way to turn it off. |
Hi @ricardojlrufino, I repeated so many times now... but for the sake of getting this thing done, let me be more pragmatic: may I ask you to make a PR to the current IDE that adds only the autocompletion dialog? Something that takes the "code completions" from a CompletionProvider? I imagine something like: package cc.arduino.autocomplete;
import java.util.List;
import processing.app.Sketch;
public interface CompletionProvider {
List<CodeCompletion> getSuggestions(Sketch sketch, int fileIdx, int line, int col);
}
class CodeCompletion {
// TODO: to be agreed
} What I want is a patch that when I press Ctrl+Space (for example) makes the IDE calls Is that feasible? For now I don't want the suggestions to be anything meaningful, to be clear it has to work with a FakeCompletionProvider: class FakeCompletionProvider implements CompletionProvider {
@Override
public List<CodeCompletion> getSuggestions(Sketch sketch, int line, int col) {
List<CodeCompletion> res = new ArrayList<>();
res.add(new CodeCompletion("Hello!")); // or whatever fits
return res;
}
} |
This is Issue 849 moved from a Google Code project.
Added by 2012-03-07T13:26:22.000Z by Wilfried...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Original labels: Type-Enhancement, Priority-Medium
Original description
What change would like to see?
I would like to see a code completion in the IDE like other IDE Editors have. Especially it would be nice, when this feature could interact with the #include keyword.
Why?
Because of simpler programming.
Would this cause any incompatibilities with previous versions? If so, how
can these be mitigated?
I thing, there will be no incompatibilities.
The text was updated successfully, but these errors were encountered: