Skip to content

Use system line ending in services compiler host #1654

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

Merged
merged 1 commit into from
Jan 19, 2015
Merged

Use system line ending in services compiler host #1654

merged 1 commit into from
Jan 19, 2015

Conversation

csnover
Copy link
Contributor

@csnover csnover commented Jan 13, 2015

Fixes #1653.

Let me know where you want tests to go for the language services and I can add some if you’d like.

@msftclas
Copy link

Hi @csnover, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@DanielRosenwasser
Copy link
Member

services.ts isn't supposed to depend on sys.ts as far as I understand. Might be better to parameterize createCompilerHost but that's kind of ugly. @mhegazy might be able to guide you better.

@Arnavion
Copy link
Contributor

Wouldn't it be better to add a getNewLine() method to LanguageServiceHost (just like CompilerHost) and let the implementation provide it? You can continue defaulting to "\r\n" for backward-compat if the LanguageServiceHost implementation doesn't have a getNewLine()

@mhegazy
Copy link
Contributor

mhegazy commented Jan 13, 2015

The problem is that sys may not be defined, e.g. In a web page. I like @Arnavion idea. But I would make the new method optional in the interface and call it to initialize the value of the newline in createlamguageservice.

@csnover
Copy link
Contributor Author

csnover commented Jan 15, 2015

OK, that was the first option in the original bug. I will try to change this over the weekend to add an optional host method if someone else doesn’t get to it first.

@csnover
Copy link
Contributor Author

csnover commented Jan 19, 2015

The PR is updated for language service hosts to provide a getNewLine method instead. This API doesn’t feel great, but, well.

mhegazy added a commit that referenced this pull request Jan 19, 2015
Use system line ending in services compiler host
@mhegazy mhegazy merged commit 8d5b65a into microsoft:master Jan 19, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Jan 19, 2015

Thanks!

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Language services hard-codes newline to \r\n
5 participants