Skip to content

Hide fileStatus when compileOnSave is false #546

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 2 commits into from
Aug 31, 2015
Merged

Hide fileStatus when compileOnSave is false #546

merged 2 commits into from
Aug 31, 2015

Conversation

wmaurer
Copy link
Contributor

@wmaurer wmaurer commented Aug 29, 2015

Fixes issue #524

Hope it looks okay. I'm pulling the compileOnSave directly from the cache.

if (status.emitDiffers || status.modified) {
this.fileStatus.text('Js emit is outdated');
this.fileStatus.addClass('icon-x text-error');
let project = getOrCreateProject(filePath);
Copy link
Member

Choose a reason for hiding this comment

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

getOrCreateProject is something that shouldn't be called from the front end code. We have a seperate nodejs process running the background managing projects / language service etc. More docs : https://github.com/TypeStrong/atom-typescript/blob/master/CONTRIBUTING.md#architecture

@wmaurer
Copy link
Contributor Author

wmaurer commented Aug 31, 2015

Ok thanks, that's clearer to me now. Is calling parent.getProjectFileDetails the correct approach?

@basarat
Copy link
Member

basarat commented Aug 31, 2015

Is calling parent.getProjectFileDetails the correct approach?

Yes 👍 However I would prefer you track down usages of updateFileStatus. I suspect they already have access to the projectFileDetails. Look at

if (fileDetails.project.compileOnSave

Maybe add a function like hideEmitStatus there 🌹

@wmaurer
Copy link
Contributor Author

wmaurer commented Aug 31, 2015

Unfortunately, not all other usages of updateFileStatus have immediate access to projectFileDetails, e.g.:

mainPanelView.panelView.updateFileStatus(filePath);

(in this case I could move the updateFileStatus up into the then on line 111)

And here I would have to fetch projectFileDetails, as it's not already called:

panelView.updateFileStatus(filePath);

It seems to me to be a bit anti-DRY to have logic and code calling a hideEmitStatus wherever we currently call updateFileStatus (6 places at the moment), but I can do it if you like ...

Another idea would be to react to changes to the compileOnSave flag, and hide/show the emit status based on that. The updateFileStatus logic would still run for every file, but whether it's hidden or shown would be project-wide.

Let me know what you think.

basarat added a commit that referenced this pull request Aug 31, 2015
Hide fileStatus when compileOnSave is false
@basarat basarat merged commit aac8182 into TypeStrong:master Aug 31, 2015
@basarat
Copy link
Member

basarat commented Aug 31, 2015

It will be in the next release 🌹

@wmaurer
Copy link
Contributor Author

wmaurer commented Aug 31, 2015

Thanks!

@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
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.

2 participants