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

Rewrite ide-d using serve-d #34

Merged
merged 49 commits into from
Feb 24, 2021
Merged

Rewrite ide-d using serve-d #34

merged 49 commits into from
Feb 24, 2021

Conversation

aminya
Copy link
Member

@aminya aminya commented Jan 27, 2021

Complete overhaul

Fixes #32
Fixes #28
Closes #24

@aminya
Copy link
Member Author

aminya commented Jan 27, 2021

@WebFreak001 So, this now uses serve-d directly to spawn the language server. However, when I use this on project, I get all sorts of errors. Does serve-d require a specific procedure for spawning?

https://github.com/aminya/atomize-d/blob/update/src/atomize-d.ts#L24

To install:

pnpm i
pnpm get.served
apm link .

Open any D project

atom ./spec/fixtures

@aminya
Copy link
Member Author

aminya commented Feb 4, 2021

So, what is the solution? I am not using workspace-d. I am just using serve-d directly.

@aminya
Copy link
Member Author

aminya commented Feb 4, 2021

I think I fixed the spawn error by coping serve-d exe into code/bin folder

@aminya
Copy link
Member Author

aminya commented Feb 4, 2021

Now, the errors are different when I hover for getting datatip:

image

@WebFreak001
Copy link
Member

workspace-d is used by serve-d, which is why you are seeing the error. Putting the DCD exe next to serve-d will always work because that's the first path serve-d/workspace-d search for the exe, otherwise the configurations (d.dcdServerPath) need to be properly sent with the exe file (not folder or something)

In your last error it somehow crashes fatally (segfault or something), I need to investigate that, but can only do so on linux. If you want you could try compiling serve-d from source in debug mode (just dub build --compiler=ldc2) and try to attach to the process when you launch atom (launch serve-d with --wait for it to wait 2s at startup)

@aminya
Copy link
Member Author

aminya commented Feb 17, 2021

Some of the errors are gone (e.g. these). I had to copy the dll files into the code-d folder! 🤦‍♂️

However, now, the datatips return an empty array:
image

@WebFreak001
Copy link
Member

can you share how atom does the initialization procedure? (initialize, initialized & if it sends any configurations afterwards)

functionality might be there, just not actually resolving to anything.

@aminya
Copy link
Member Author

aminya commented Feb 21, 2021

This is the log. It seems that it is calling the correct code
image

@aminya
Copy link
Member Author

aminya commented Feb 23, 2021

Yay. The datatips and autocomplete are fixed!

image
image

@aminya
Copy link
Member Author

aminya commented Feb 23, 2021

@WebFreak001 Could you please give me write access to this repository? I want to merge and register it. I would like to change the package name to ide-d which is a convention for the ide packages in Atom

@aminya aminya marked this pull request as ready for review February 23, 2021 18:26
Copy link
Member

@WebFreak001 WebFreak001 left a comment

Choose a reason for hiding this comment

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

looks good, gave you access to the repo. Check the comments here as well.

@@ -297,9 +288,6 @@ class ${1:MyException} : ${4:Exception} {
"with":
"prefix": "with"
"body": "with"
"scope":
"prefix": "scope"
"body": "scope"
"asm":
"prefix": "asm"
"body": "asm"
Copy link
Member

@WebFreak001 WebFreak001 Feb 24, 2021

Choose a reason for hiding this comment

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

the snippets can probably completely be removed, they are handled by workspace-d/serve-d now. (needs --provides context-snippets as startup argument)

In code-d there are snippets for diet files which may be useful though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I need to test if the snippet provider works. For now, I think this does the work 🤔

async startServerProcess(projectPath: string) {
const serveDPath = await installServeD()

const serveD = super.spawn(serveDPath, [], {
Copy link
Member

@WebFreak001 WebFreak001 Feb 24, 2021

Choose a reason for hiding this comment

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

there is localization support for UI messages in serve-d. If atom provides the language in 2 letter format (ie. en or en-GB), then you can pass it using ["--lang", language]

Copy link
Member Author

Choose a reason for hiding this comment

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

Not so sure about that. I need to ask.

@aminya aminya changed the title Update Rewrite ide-d using serve-d Feb 24, 2021
@aminya aminya merged commit 8d6c5fb into Pure-D:workspace-d Feb 24, 2021
@aminya aminya deleted the update branch February 24, 2021 17:22
@aminya aminya mentioned this pull request Feb 25, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants