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

(feat): implement new section for haxe #1367

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Sukhacoder02
Copy link

@Sukhacoder02 Sukhacoder02 commented Jul 3, 2023

Description

This PR adds a new section to support haxe.
Fixes #1313.

Screenshot

image

@netlify
Copy link

netlify bot commented Jul 3, 2023

Deploy Preview for spaceship-prompt ready!

Name Link
🔨 Latest commit ba491dd
🔍 Latest deploy log https://app.netlify.com/sites/spaceship-prompt/deploys/64a416b8bedb3400081857c1
😎 Deploy Preview https://deploy-preview-1367--spaceship-prompt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Sukhacoder02 Sukhacoder02 mentioned this pull request Jul 3, 2023
Copy link
Member

@denysdovhan denysdovhan left a comment

Choose a reason for hiding this comment

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

Hey! Thanks for contributing!
Please address my comments.

docs/sections/haxe.md Outdated Show resolved Hide resolved
docs/sections/haxe.md Outdated Show resolved Hide resolved
docs/sections/haxe.md Outdated Show resolved Hide resolved
docs/sections/haxe.md Outdated Show resolved Hide resolved
sections/haxe.zsh Outdated Show resolved Hide resolved
sections/haxe.zsh Outdated Show resolved Hide resolved
tests/haxe.test.zsh Outdated Show resolved Hide resolved


SPACESHIP_HAXE_SHOW="${SPACESHIP_HAXE_SHOW=true}"
SPACESHIP_HAXE_ASYNC="${SPACESHIP_HAXE_ASYNC=false}"
Copy link
Member

Choose a reason for hiding this comment

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

Why sync?

Copy link
Author

Choose a reason for hiding this comment

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

I had the idea that we are only rendering the version if the files are found and that too in the haxe project directory only,
async or sync wouldn't make much difference. Would it? Please correct me if I'm wrong...

Copy link
Member

Choose a reason for hiding this comment

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

It depends on how fast haxe --version works. Anyway, upsearch can also be slow to traverse the whole directory tree and check for files. It prefer to keep these runtime sections async.

@denysdovhan denysdovhan added the new-feature A PR that implement feature (section, specific behavior, etc). label Jul 3, 2023
@Sukhacoder02
Copy link
Author

@denysdovhan, I have resolved the comments, Waiting for your review.

sections/haxe.zsh Show resolved Hide resolved
sections/haxe.zsh Show resolved Hide resolved
| `SPACESHIP_HAXE_PREFIX` | `with` | Section's prefix |
| `SPACESHIP_HAXE_SUFFIX` | `$SPACESHIP_PROMPT_DEFAULT_SUFFIX` | Section's suffix |
| `SPACESHIP_HAXE_SYMBOL` | `⌘` | Symbol displayed before the section |
| `SPACESHIP_HAXE_COLOR` | `166` (orange) | Section's color |
Copy link
Member

Choose a reason for hiding this comment

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

Add docs for SPACESHIP_HAXE_VERBOSE option. Preferably, with an example displaying the option. Refer to other sections, like https://spaceship-prompt.sh/sections/rust/?h=#Displaying-verbose-version

Copy link
Author

Choose a reason for hiding this comment

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

Yes, but haxe --version command doesn't yield any verbose result other than just the version number as 4.3.1.

Copy link
Author

Choose a reason for hiding this comment

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

Should we add it in the docs, even if the output remains the same?

Copy link
Member

Choose a reason for hiding this comment

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

Then what does this line do?

[[ $SPACESHIP_HAXE_VERBOSE == false ]] && haxe_version=${haxe_version%-*}

https://github.com/spaceship-prompt/spaceship-prompt/pull/1367/files#diff-335c8b7ab5d29c74c0594739294a74827528d3dd3dc7e78f7119f58ecec40b39R40

Should we remove it them?

Copy link
Author

@Sukhacoder02 Sukhacoder02 Jul 4, 2023

Choose a reason for hiding this comment

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

Yes, I guess so. Will remove in next commit.

Copy link
Author

Choose a reason for hiding this comment

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

Done, @denysdovhan, Awaiting Review.

@Sukhacoder02
Copy link
Author

@denysdovhan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature A PR that implement feature (section, specific behavior, etc).
Development

Successfully merging this pull request may close these issues.

Haxe support
2 participants