Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Allow formatting unsaved document #54

Merged
merged 4 commits into from Mar 6, 2018
Merged

Conversation

faustinoaq
Copy link
Member

Currently scry can't format an unsaved document, with this PR now you can format even a untitled file 馃帀

ezgif-2-db8399697c

/cc @crystal-lang-tools/scry

@faustinoaq faustinoaq requested a review from a team March 4, 2018 16:16
Copy link
Contributor

@laginha87 laginha87 left a comment

Choose a reason for hiding this comment

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

Awesome 馃憤

@laginha87
Copy link
Contributor

Tried it out on untitled and unsaved files and worked well. Takes a bit to be able to use after opening the document. After that initial slowdown it works pretty fast.

@faustinoaq
Copy link
Member Author

faustinoaq commented Mar 5, 2018

@laginha87 Thank you for testing it! 馃憤

After that initial slowdown it works pretty fast.

That slowdown is because scry blocks the requests using analyzer to check diagnostics in your code via crystal build , semantic diagnostics feature and implementation search are pretty slow features. I tried to make them async but seems is harder that I thought #48 (comment)

You can repeat the slowdown if you save the file or go to a definition and then try immediately formatting or symbol listing or completion, you'll see that request get blocked

@faustinoaq
Copy link
Member Author

@keplersj @bmulvihill Can you review this as well? 馃槄

@faustinoaq
Copy link
Member Author

@bmulvihill Thank you for your review, I'm going to merge it 馃憤

@faustinoaq faustinoaq merged commit c88daaf into master Mar 6, 2018
@faustinoaq faustinoaq deleted the fa/format-unsaved-document branch March 6, 2018 01:20
@faustinoaq faustinoaq added this to Done in Crystal Tools Apr 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Crystal Tools
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants