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

Make the IDE work under Windows #2776

Merged
merged 8 commits into from
Jun 19, 2017
Merged

Conversation

smarter
Copy link
Member

@smarter smarter commented Jun 16, 2017

Also, when running under OS X, it should no longer be necessary to put code on your PATH as open -a "Visual Studio Code" will be used.
Also, always pass -n to Code to always start a new instance, this makes things more reproducible.

@felixmulder Can you check for me that everything still works OK under OS X? Just run sbt launchIDE in dotty and in dotty-example-project and check that they both work as expected.

Classpath elements are separated by ';', not ':' on Windows
@smarter smarter requested a review from felixmulder June 16, 2017 17:13
The DLS runs as many compiler instances as there are subprojects in the
build . When a file is opened we need to decide which compiler instance
should handle it, this is done by matching the file URI against the
source directories configured for each subproject. This commit improves
this matching in two way:
- Use URI#getPath instead of URI#getRawPath to decode percent-encoded
characters in the URI
- Use File#getCanonicalPath instead of File#getAbsolutePath

The first fix is necessary to get the DLS running in Windows, because
URIs start with file:///C%3A/.../ and we need getPath to decode "C%3A" to "C:".
@smarter smarter force-pushed the ide-path branch 2 times, most recently from 059711f to d6c674a Compare June 16, 2017 17:20
@felixmulder
Copy link
Contributor

@smarter - it doesn't correctly open the project on macOS, it opens a new code instance with an "untitled" document.

If I manually open the dotty dir it launches the dotty-language server, but seems to be missing a lot of features - only does "rename all occurrences" on right click, that means the servers not really running right?

@smarter
Copy link
Member Author

smarter commented Jun 16, 2017

Yes, what do you see in the console?

@smarter smarter force-pushed the ide-path branch 3 times, most recently from 8760d26 to 44b2145 Compare June 16, 2017 17:42
@smarter
Copy link
Member Author

smarter commented Jun 16, 2017

@felixmulder I've pushed a potential fix, let me know if it works now.

@smarter
Copy link
Member Author

smarter commented Jun 16, 2017

Actually that's probably not going to help since this code is not run when using launchIDE from the dotty project itself. Can you please give me the output of your console?

@smarter
Copy link
Member Author

smarter commented Jun 16, 2017

OK, thanks to @liufengyun I was able to debug the issue, I'll update the PR soon. Basically we cannot use open on OS X because we first need to do --install-extension ... and that opens a new window if done through open.

On Windows, use "cmd.exe /C", this seems to be necessary.

On every OS, pass "-n" to Code to start a new instance, this makes
things more reproducible.
We cannot use "mkdir -p" because it doesn't work on Windows. Instead,
add the vscode-dotty/out directory to git.
@smarter
Copy link
Member Author

smarter commented Jun 17, 2017

@felixmulder Updated, let me know if everything works OK on OS X now :)

@liufengyun
Copy link
Contributor

@smarter After setting VSCode in PATH, it works well for the dotty project on my Mac 👍

Copy link
Contributor

@felixmulder felixmulder left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

3 participants