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

Use of DCD for "Go To Definition" and Code Completion functionality plus other changes. #29

Merged
merged 15 commits into from
Feb 17, 2015

Conversation

Freakazo
Copy link
Contributor

Okay so this is all the changes I've made to fix #20 and fix #5.

There is still a fair bit to do, but I believe this is ready to be merged in.

So firstly I've created a new directory for tools, such as Go to Def and Code Completion. In the hope that the IDE in the future can also be used for other languages, I've created the EditorTool class which will contain abstract methods. We then implement those abstract methods for each language inside a folder with the name of the language. DEditorTool implements those methods and uses DCDInterface to start dcd-client to send the requests to dcd-server. I want to re-implement dcd-client so that we can talk directly to dcd-server through sockets, which should be a big boon to performance for very large documents. However I'm completely unsure of the legality of doing so.
I've also moved SimpleDSyntaxHighlighter out of dsourceedit.d into its own file under tools.

Right now I've assigned Go to Def as SHIFT+G and for Code Completion CTRL+SHIFT+G.
Make sure that dcd-client is in your path and that dcd-server is running.

There still is a fairly lengthy todo list, which I'll get to work on as soon as I get feedback for the changes.

Still to do:
Fix caret disappearing after insertion.
Refactor extprocess so that we have access to stdin.
Handle the user continueing to type, display only matches containing entered text.
Inform user when dcd-client command is not found.
Check that dcd-server is running and attempt to start it if it is not, if we started it we should also kill it.
Let the user know when we don't know of any completions or we don't know where the symbol declaration is.

I've only tested this on Linux at the moment.

Please review and let me know what I should change.

@@ -245,7 +271,7 @@ class SimpleDSyntaxHighlighter : SyntaxHighlighter {
for (;;) {
ch = nextBracket(dir, p);
if (!ch) // no more brackets
return startPos;
break;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This caused a compiler issue for me at the last return in the function: "Statement is not reachable".

@Freakazo Freakazo changed the title Dcd Use of DCD for "Go To Definition" and Code Completion functionality plus other changes. Feb 14, 2015
@buggins
Copy link
Owner

buggins commented Feb 16, 2015

automatic merge is impossible

@buggins
Copy link
Owner

buggins commented Feb 16, 2015

Could you please merge to latest mainstream?

@buggins buggins merged commit bea3c5e into buggins:master Feb 17, 2015
@buggins
Copy link
Owner

buggins commented Feb 17, 2015

Merged. It compiles and runs, but I didn't check new functionality

@buggins
Copy link
Owner

buggins commented Feb 17, 2015

Did some refactoring.
Fixed dcd-client running on windows

@Freakazo Freakazo deleted the dcd branch February 18, 2015 08:52
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.

code completion using DCD Go to definition feature is needed
2 participants