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

mark LanguageService.getSourceFile as internal and rename it #7584

Merged
merged 1 commit into from
Mar 24, 2016

Conversation

vladima
Copy link
Contributor

@vladima vladima commented Mar 18, 2016

fixes #7581.
LanguageService.getSourceFile is a very confusing method - it returns one non-bound source file that is only useful for syntactic analysis. The only consumer of this method uses it to reliably determine if file is an external module.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 18, 2016

this is a breaking change, i remeber other users used it..
// cc: @basarat.

@basarat
Copy link
Contributor

basarat commented Mar 18, 2016

Thanks for mentioning. Double thanks for renaming to indicate difference 🌹

//cc @blakeembrey @jbrantly

@jbrantly
Copy link

Thanks for the mention. ts-loader doesn't use this method so I think it's unaffected.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 18, 2016

// cc: @mprobst

@vladima
Copy link
Contributor Author

vladima commented Mar 18, 2016

//cc: @adidahiya

@vladima vladima added the Breaking Change Would introduce errors in existing code label Mar 18, 2016
@mprobst
Copy link
Contributor

mprobst commented Mar 18, 2016

Thanks for the heads up. I don't think we use this method, we just use ts.createSourceFile, so we should be good.

@blakeembrey
Copy link
Contributor

Ah, I do use it in ts-node 😦 Do you know if source maps generate properly with inline contents now, that's all I was using it for.

@vladima
Copy link
Contributor Author

vladima commented Mar 19, 2016

Will it work if you replace it with LanguageService.getProgram().getSourceFile?

@blakeembrey
Copy link
Contributor

@vladima Yes, definitely. Don't worry about it, I'll look into fixing it at the source too some time.

@adidahiya
Copy link
Contributor

👍 TSLint is not using ts.getSourceFile directly.

@DanielRosenwasser
Copy link
Member

👍

@mhegazy mhegazy added the API Relates to the public API for TypeScript label Mar 24, 2016
@mhegazy mhegazy added this to the TypeScript 2.0 milestone Mar 24, 2016
@vladima vladima merged commit 55cbdc9 into master Mar 24, 2016
@vladima vladima deleted the LS-rename-getSourceFile branch March 24, 2016 21:05
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Relates to the public API for TypeScript Breaking Change Would introduce errors in existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symbols missing from nodes when SourceFile requested via LanguageService, but not via Program
9 participants